mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
Remove EOL feature
This commit is contained in:
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -15,7 +15,6 @@ concurrency:
|
|||||||
env:
|
env:
|
||||||
do_vatsim_key: ${{ github.event_name == 'push' }}
|
do_vatsim_key: ${{ github.event_name == 'push' }}
|
||||||
do_symbols: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop/') }}
|
do_symbols: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop/') }}
|
||||||
eol_months: 12
|
|
||||||
qt_version: 5.15.2
|
qt_version: 5.15.2
|
||||||
bitrock_version: qt-professional-23.1.0
|
bitrock_version: qt-professional-23.1.0
|
||||||
bitrock_url: https://releases.bitrock.com/installbuilder
|
bitrock_url: https://releases.bitrock.com/installbuilder
|
||||||
@@ -127,11 +126,11 @@ jobs:
|
|||||||
- name: Build swift (without symbols)
|
- name: Build swift (without symbols)
|
||||||
if: ${{ env.do_symbols != 'true' }}
|
if: ${{ env.do_symbols != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2)
|
python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2)
|
||||||
- name: Build swift (with symbols)
|
- name: Build swift (with symbols)
|
||||||
if: ${{ env.do_symbols == 'true' }}
|
if: ${{ env.do_symbols == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2)
|
python3 -u scripts/build.py -w 64 -t gcc -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2)
|
||||||
- name: Check warnings
|
- name: Check warnings
|
||||||
id: warnings
|
id: warnings
|
||||||
run: |
|
run: |
|
||||||
@@ -213,12 +212,12 @@ jobs:
|
|||||||
if: ${{ env.do_symbols != 'true' }}
|
if: ${{ env.do_symbols != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -u scripts/build.py -w 64 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log
|
python -u scripts/build.py -w 64 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log
|
||||||
- name: Build swift (with symbols)
|
- name: Build swift (with symbols)
|
||||||
if: ${{ env.do_symbols == 'true' }}
|
if: ${{ env.do_symbols == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -u scripts/build.py -w 64 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log
|
python -u scripts/build.py -w 64 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log
|
||||||
- name: Check warnings
|
- name: Check warnings
|
||||||
id: warnings
|
id: warnings
|
||||||
run: |
|
run: |
|
||||||
@@ -299,12 +298,12 @@ jobs:
|
|||||||
if: ${{ env.do_symbols != 'true' }}
|
if: ${{ env.do_symbols != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -u scripts/build.py -w 32 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log
|
python -u scripts/build.py -w 32 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2>&1 | tee error.log
|
||||||
- name: Build swift (with symbols)
|
- name: Build swift (with symbols)
|
||||||
if: ${{ env.do_symbols == 'true' }}
|
if: ${{ env.do_symbols == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -u scripts/build.py -w 32 -t msvc -d -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log
|
python -u scripts/build.py -w 32 -t msvc -d -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2>&1 | tee error.log
|
||||||
- name: Check warnings
|
- name: Check warnings
|
||||||
id: warnings
|
id: warnings
|
||||||
run: |
|
run: |
|
||||||
@@ -374,11 +373,11 @@ jobs:
|
|||||||
- name: Build swift (without symbols)
|
- name: Build swift (without symbols)
|
||||||
if: ${{ env.do_symbols != 'true' }}
|
if: ${{ env.do_symbols != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2)
|
python3 -u scripts/build.py -w 64 -t clang -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" 2> >(tee error.log >&2)
|
||||||
- name: Build swift (with symbols)
|
- name: Build swift (with symbols)
|
||||||
if: ${{ env.do_symbols == 'true' }}
|
if: ${{ env.do_symbols == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2)
|
python3 -u scripts/build.py -w 64 -t clang -d -j2 -q "SWIFT_CONFIG_JSON+=$vatsim_key_file" --upload 2> >(tee error.log >&2)
|
||||||
- name: Check warnings
|
- name: Check warnings
|
||||||
id: warnings
|
id: warnings
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
"doxygen": true,
|
"doxygen": true,
|
||||||
"devBranch": false,
|
"devBranch": false,
|
||||||
"stableBranch": false,
|
"stableBranch": false,
|
||||||
"endOfLife": "20300101",
|
|
||||||
"vatsimSupport": true,
|
"vatsimSupport": true,
|
||||||
"vatsim": {
|
"vatsim": {
|
||||||
"id": "0xb9ba",
|
"id": "0xb9ba",
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ bitrock_builder_bin = $$(BITROCK_BUILDER)
|
|||||||
project.installerFilename=$${INSTALLER_BASENAME}.$${INSTALLER_EXT} \
|
project.installerFilename=$${INSTALLER_BASENAME}.$${INSTALLER_EXT} \
|
||||||
project.version=$$swiftConfig(version.full) \
|
project.version=$$swiftConfig(version.full) \
|
||||||
versionFull=$$swiftConfig(version.full).$${VER_REV} \
|
versionFull=$$swiftConfig(version.full).$${VER_REV} \
|
||||||
endOfLife=$$swiftConfig(endOfLife) \
|
|
||||||
project.windows64bitMode=$${WINDOWS64BITMODE} \
|
project.windows64bitMode=$${WINDOWS64BITMODE} \
|
||||||
project.enableDebugger=$${INSTALLER_DEBUG} \
|
project.enableDebugger=$${INSTALLER_DEBUG} \
|
||||||
architecture=$${ARCHITECTURE}
|
architecture=$${ARCHITECTURE}
|
||||||
|
|||||||
@@ -28,20 +28,6 @@
|
|||||||
</include>
|
</include>
|
||||||
</componentList>
|
</componentList>
|
||||||
<functionDefinitionList>
|
<functionDefinitionList>
|
||||||
<actionDefinition>
|
|
||||||
<name>checkExpiryDate</name>
|
|
||||||
<actionList>
|
|
||||||
<createTimeStamp>
|
|
||||||
<variable>installDate</variable>
|
|
||||||
</createTimeStamp>
|
|
||||||
<throwError>
|
|
||||||
<ruleList>
|
|
||||||
<compareValues value1="${installDate}" logic="greater_or_equal" value2="${endOfLife}" />
|
|
||||||
</ruleList>
|
|
||||||
<customErrorMessage>This version has expired. Please download a more recent version.</customErrorMessage>
|
|
||||||
</throwError>
|
|
||||||
</actionList>
|
|
||||||
</actionDefinition>
|
|
||||||
<actionDefinition>
|
<actionDefinition>
|
||||||
<name>checkForRunningSwift</name>
|
<name>checkForRunningSwift</name>
|
||||||
<actionList>
|
<actionList>
|
||||||
@@ -104,7 +90,6 @@ It must be closed before the installation can proceed</progressText>
|
|||||||
</actionDefinition>
|
</actionDefinition>
|
||||||
</functionDefinitionList>
|
</functionDefinitionList>
|
||||||
<preInstallationActionList>
|
<preInstallationActionList>
|
||||||
<checkExpiryDate />
|
|
||||||
<checkForRunningSwift />
|
<checkForRunningSwift />
|
||||||
<killDBusDaemon />
|
<killDBusDaemon />
|
||||||
<!-- TODO Linux/MacOS: Save and load last install dir -->
|
<!-- TODO Linux/MacOS: Save and load last install dir -->
|
||||||
@@ -358,9 +343,6 @@ https://swift-project.org/</text>
|
|||||||
<default></default>
|
<default></default>
|
||||||
<allowEmptyValue>1</allowEmptyValue>
|
<allowEmptyValue>1</allowEmptyValue>
|
||||||
</stringParameter>
|
</stringParameter>
|
||||||
<stringParameter name="endOfLife" value="21000101" ask="0">
|
|
||||||
<default>21000101</default>
|
|
||||||
</stringParameter>
|
|
||||||
<stringParameter name="architecture" value="64" ask="0">
|
<stringParameter name="architecture" value="64" ask="0">
|
||||||
<description></description>
|
<description></description>
|
||||||
<explanation></explanation>
|
<explanation></explanation>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Builder:
|
|||||||
shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share'))
|
shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share'))
|
||||||
datastore.update_shared(host, datastore_version, shared_path)
|
datastore.update_shared(host, datastore_version, shared_path)
|
||||||
|
|
||||||
def build(self, jobs, qmake_args, dev_build, eolInMonth):
|
def build(self, jobs, qmake_args, dev_build):
|
||||||
"""
|
"""
|
||||||
Run the build itself. Pass dev_build=True to enable a dev build
|
Run the build itself. Pass dev_build=True to enable a dev build
|
||||||
"""
|
"""
|
||||||
@@ -55,15 +55,6 @@ class Builder:
|
|||||||
if dev_build:
|
if dev_build:
|
||||||
qmake_call += ['SWIFT_CONFIG.devBranch=true']
|
qmake_call += ['SWIFT_CONFIG.devBranch=true']
|
||||||
|
|
||||||
if eolInMonth > 0:
|
|
||||||
eolYear = date.today().year
|
|
||||||
eolMonth = date.today().month + eolInMonth - 1
|
|
||||||
eolYear = eolYear + ( eolMonth / 12 )
|
|
||||||
eolMonth = eolMonth % 12 + 1
|
|
||||||
eolDate = date(int(eolYear), int(eolMonth), 1)
|
|
||||||
print('Setting EOL date to ' + eolDate.strftime('%Y%m%d'))
|
|
||||||
qmake_call += ['SWIFT_CONFIG.endOfLife=' + eolDate.strftime('%Y%m%d')]
|
|
||||||
|
|
||||||
qmake_call += ['-r', os.pardir]
|
qmake_call += ['-r', os.pardir]
|
||||||
subprocess.check_call(qmake_call, env=dict(os.environ))
|
subprocess.check_call(qmake_call, env=dict(os.environ))
|
||||||
|
|
||||||
@@ -353,7 +344,7 @@ def print_help():
|
|||||||
'Windows': ['msvc', 'mingw']
|
'Windows': ['msvc', 'mingw']
|
||||||
}
|
}
|
||||||
compiler_help = '|'.join(supported_compilers[platform.system()])
|
compiler_help = '|'.join(supported_compilers[platform.system()])
|
||||||
print('build.py -w <32|64> -t <' + compiler_help + '> [-v] [-d] [-e <end of life in month>] [-q <extra qmake argument>]')
|
print('build.py -w <32|64> -t <' + compiler_help + '> [-v] [-d] [-q <extra qmake argument>]')
|
||||||
|
|
||||||
|
|
||||||
# Entry point if called as a standalone program
|
# Entry point if called as a standalone program
|
||||||
@@ -363,11 +354,10 @@ def main(argv):
|
|||||||
dev_build = False
|
dev_build = False
|
||||||
jobs = None
|
jobs = None
|
||||||
upload_symbols = False
|
upload_symbols = False
|
||||||
eolInMonth = 0
|
|
||||||
qmake_args = []
|
qmake_args = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(argv, 'hw:t:j:due:q:v', ['wordsize=', 'toolchain=', 'jobs=', 'dev', 'upload', 'eol', 'qmake-arg=', 'version'])
|
opts, args = getopt.getopt(argv, 'hw:t:j:duq:v', ['wordsize=', 'toolchain=', 'jobs=', 'dev', 'upload', 'qmake-arg=', 'version'])
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
print_help()
|
print_help()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
@@ -393,8 +383,6 @@ def main(argv):
|
|||||||
dev_build = True
|
dev_build = True
|
||||||
elif opt in ('-u', '--upload'):
|
elif opt in ('-u', '--upload'):
|
||||||
upload_symbols = True
|
upload_symbols = True
|
||||||
elif opt in ('-e', '--eol'):
|
|
||||||
eolInMonth = int(arg)
|
|
||||||
elif opt in ('-q', '--qmake-arg'):
|
elif opt in ('-q', '--qmake-arg'):
|
||||||
qmake_args += [arg]
|
qmake_args += [arg]
|
||||||
|
|
||||||
@@ -419,7 +407,7 @@ def main(argv):
|
|||||||
builder = builders[platform.system()][tool_chain](word_size)
|
builder = builders[platform.system()][tool_chain](word_size)
|
||||||
|
|
||||||
builder.prepare()
|
builder.prepare()
|
||||||
builder.build(jobs, qmake_args, dev_build, eolInMonth)
|
builder.build(jobs, qmake_args, dev_build)
|
||||||
builder.checks()
|
builder.checks()
|
||||||
builder.install()
|
builder.install()
|
||||||
builder.publish()
|
builder.publish()
|
||||||
|
|||||||
@@ -91,17 +91,6 @@ namespace BlackConfig
|
|||||||
return devBuild;
|
return devBuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBuildConfig::isLifetimeExpired()
|
|
||||||
{
|
|
||||||
if (!getEol().isValid()) { return true; }
|
|
||||||
return QDateTime::currentDateTime() > getEol();
|
|
||||||
}
|
|
||||||
|
|
||||||
int CBuildConfig::daysTillLifetimeExpiry()
|
|
||||||
{
|
|
||||||
return QDateTime::currentDateTime().daysTo(getEol());
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString boolToYesNo(bool v)
|
static QString boolToYesNo(bool v)
|
||||||
{
|
{
|
||||||
return v ? QStringLiteral("yes") : QStringLiteral("no");
|
return v ? QStringLiteral("yes") : QStringLiteral("no");
|
||||||
|
|||||||
@@ -103,15 +103,6 @@ namespace BlackConfig
|
|||||||
//! Known executable
|
//! Known executable
|
||||||
static bool isKnownExecutableName(const QString &executable);
|
static bool isKnownExecutableName(const QString &executable);
|
||||||
|
|
||||||
//! End of lifetime
|
|
||||||
static const QDateTime &getEol(); // defined in buildconfig_gen.cpp.in
|
|
||||||
|
|
||||||
//! Lifetime ended?
|
|
||||||
static bool isLifetimeExpired();
|
|
||||||
|
|
||||||
//! Days till lifetime end
|
|
||||||
static int daysTillLifetimeExpiry();
|
|
||||||
|
|
||||||
//! Vatsim client id
|
//! Vatsim client id
|
||||||
static int vatsimClientId(); // defined in buildconfig_gen.cpp.in
|
static int vatsimClientId(); // defined in buildconfig_gen.cpp.in
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
const QDateTime &BlackConfig::CBuildConfig::getEol()
|
|
||||||
{
|
|
||||||
static const QString eol(\"$$swiftConfig(endOfLife)\"); // config.pri, defaults in default.json
|
|
||||||
static const QDateTime dt(eol.isEmpty() ? QDateTime() : QDateTime::fromString(eol, \"yyyyMMdd\"));
|
|
||||||
return dt;
|
|
||||||
}
|
|
||||||
|
|
||||||
int BlackConfig::CBuildConfig::vatsimClientId()
|
int BlackConfig::CBuildConfig::vatsimClientId()
|
||||||
{
|
{
|
||||||
static const int id { $$swiftConfig(vatsim.id) };
|
static const int id { $$swiftConfig(vatsim.id) };
|
||||||
|
|||||||
@@ -1430,19 +1430,6 @@ namespace BlackCore
|
|||||||
if (m_parsed) { return m_parsed; } // already done
|
if (m_parsed) { return m_parsed; } // already done
|
||||||
|
|
||||||
// checks
|
// checks
|
||||||
if (CBuildConfig::isLifetimeExpired())
|
|
||||||
{
|
|
||||||
this->cmdLineErrorMessage("Program expired since " + CBuildConfig::getEol().date().toString(),
|
|
||||||
"This version is no longer supported and usable. You have to install a newer version.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(CBuildConfig::daysTillLifetimeExpiry() <= 30)
|
|
||||||
{
|
|
||||||
this->cmdLineWarningMessage("This version will expire in " + QString::number(CBuildConfig::daysTillLifetimeExpiry()) + " days!",
|
|
||||||
"You'll need to update swift in order to use it thereafter.");
|
|
||||||
}
|
|
||||||
|
|
||||||
const QStringList verifyErrors = CSwiftDirectories::verifyRuntimeDirectoriesAndFiles();
|
const QStringList verifyErrors = CSwiftDirectories::verifyRuntimeDirectoriesAndFiles();
|
||||||
if (!verifyErrors.isEmpty() && !m_applicationInfo.isUnitTest())
|
if (!verifyErrors.isEmpty() && !m_applicationInfo.isUnitTest())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,8 +131,6 @@ namespace BlackMisc
|
|||||||
m_stream << " and running with Qt " << qVersion();
|
m_stream << " and running with Qt " << qVersion();
|
||||||
m_stream << " " << QSysInfo::buildAbi() << Qt::endl;
|
m_stream << " " << QSysInfo::buildAbi() << Qt::endl;
|
||||||
|
|
||||||
m_stream << "Program is going to expire on " + CBuildConfig::getEol().toString() << "." << Qt::endl;
|
|
||||||
|
|
||||||
m_stream << "Application started." << Qt::endl;
|
m_stream << "Application started." << Qt::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user