mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 06:45:37 +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:
|
||||
do_vatsim_key: ${{ github.event_name == 'push' }}
|
||||
do_symbols: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/develop/') }}
|
||||
eol_months: 12
|
||||
qt_version: 5.15.2
|
||||
bitrock_version: qt-professional-23.1.0
|
||||
bitrock_url: https://releases.bitrock.com/installbuilder
|
||||
@@ -127,11 +126,11 @@ jobs:
|
||||
- name: Build swift (without symbols)
|
||||
if: ${{ env.do_symbols != 'true' }}
|
||||
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)
|
||||
if: ${{ env.do_symbols == 'true' }}
|
||||
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
|
||||
id: warnings
|
||||
run: |
|
||||
@@ -213,12 +212,12 @@ jobs:
|
||||
if: ${{ env.do_symbols != 'true' }}
|
||||
shell: bash
|
||||
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)
|
||||
if: ${{ env.do_symbols == 'true' }}
|
||||
shell: bash
|
||||
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
|
||||
id: warnings
|
||||
run: |
|
||||
@@ -299,12 +298,12 @@ jobs:
|
||||
if: ${{ env.do_symbols != 'true' }}
|
||||
shell: bash
|
||||
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)
|
||||
if: ${{ env.do_symbols == 'true' }}
|
||||
shell: bash
|
||||
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
|
||||
id: warnings
|
||||
run: |
|
||||
@@ -374,11 +373,11 @@ jobs:
|
||||
- name: Build swift (without symbols)
|
||||
if: ${{ env.do_symbols != 'true' }}
|
||||
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)
|
||||
if: ${{ env.do_symbols == 'true' }}
|
||||
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
|
||||
id: warnings
|
||||
run: |
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"doxygen": true,
|
||||
"devBranch": false,
|
||||
"stableBranch": false,
|
||||
"endOfLife": "20300101",
|
||||
"vatsimSupport": true,
|
||||
"vatsim": {
|
||||
"id": "0xb9ba",
|
||||
|
||||
@@ -259,7 +259,6 @@ bitrock_builder_bin = $$(BITROCK_BUILDER)
|
||||
project.installerFilename=$${INSTALLER_BASENAME}.$${INSTALLER_EXT} \
|
||||
project.version=$$swiftConfig(version.full) \
|
||||
versionFull=$$swiftConfig(version.full).$${VER_REV} \
|
||||
endOfLife=$$swiftConfig(endOfLife) \
|
||||
project.windows64bitMode=$${WINDOWS64BITMODE} \
|
||||
project.enableDebugger=$${INSTALLER_DEBUG} \
|
||||
architecture=$${ARCHITECTURE}
|
||||
|
||||
@@ -28,20 +28,6 @@
|
||||
</include>
|
||||
</componentList>
|
||||
<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>
|
||||
<name>checkForRunningSwift</name>
|
||||
<actionList>
|
||||
@@ -104,7 +90,6 @@ It must be closed before the installation can proceed</progressText>
|
||||
</actionDefinition>
|
||||
</functionDefinitionList>
|
||||
<preInstallationActionList>
|
||||
<checkExpiryDate />
|
||||
<checkForRunningSwift />
|
||||
<killDBusDaemon />
|
||||
<!-- TODO Linux/MacOS: Save and load last install dir -->
|
||||
@@ -358,9 +343,6 @@ https://swift-project.org/</text>
|
||||
<default></default>
|
||||
<allowEmptyValue>1</allowEmptyValue>
|
||||
</stringParameter>
|
||||
<stringParameter name="endOfLife" value="21000101" ask="0">
|
||||
<default>21000101</default>
|
||||
</stringParameter>
|
||||
<stringParameter name="architecture" value="64" ask="0">
|
||||
<description></description>
|
||||
<explanation></explanation>
|
||||
|
||||
@@ -41,7 +41,7 @@ class Builder:
|
||||
shared_path = os.path.abspath(os.path.join(source_path, 'resources', 'share'))
|
||||
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
|
||||
"""
|
||||
@@ -55,15 +55,6 @@ class Builder:
|
||||
if dev_build:
|
||||
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]
|
||||
subprocess.check_call(qmake_call, env=dict(os.environ))
|
||||
|
||||
@@ -353,7 +344,7 @@ def print_help():
|
||||
'Windows': ['msvc', 'mingw']
|
||||
}
|
||||
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
|
||||
@@ -363,11 +354,10 @@ def main(argv):
|
||||
dev_build = False
|
||||
jobs = None
|
||||
upload_symbols = False
|
||||
eolInMonth = 0
|
||||
qmake_args = []
|
||||
|
||||
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:
|
||||
print_help()
|
||||
sys.exit(2)
|
||||
@@ -393,8 +383,6 @@ def main(argv):
|
||||
dev_build = True
|
||||
elif opt in ('-u', '--upload'):
|
||||
upload_symbols = True
|
||||
elif opt in ('-e', '--eol'):
|
||||
eolInMonth = int(arg)
|
||||
elif opt in ('-q', '--qmake-arg'):
|
||||
qmake_args += [arg]
|
||||
|
||||
@@ -419,7 +407,7 @@ def main(argv):
|
||||
builder = builders[platform.system()][tool_chain](word_size)
|
||||
|
||||
builder.prepare()
|
||||
builder.build(jobs, qmake_args, dev_build, eolInMonth)
|
||||
builder.build(jobs, qmake_args, dev_build)
|
||||
builder.checks()
|
||||
builder.install()
|
||||
builder.publish()
|
||||
|
||||
@@ -91,17 +91,6 @@ namespace BlackConfig
|
||||
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)
|
||||
{
|
||||
return v ? QStringLiteral("yes") : QStringLiteral("no");
|
||||
|
||||
@@ -103,15 +103,6 @@ namespace BlackConfig
|
||||
//! Known 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
|
||||
static int vatsimClientId(); // defined in buildconfig_gen.cpp.in
|
||||
|
||||
|
||||
@@ -11,13 +11,6 @@
|
||||
#include <QString>
|
||||
#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()
|
||||
{
|
||||
static const int id { $$swiftConfig(vatsim.id) };
|
||||
|
||||
@@ -1430,19 +1430,6 @@ namespace BlackCore
|
||||
if (m_parsed) { return m_parsed; } // already done
|
||||
|
||||
// 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();
|
||||
if (!verifyErrors.isEmpty() && !m_applicationInfo.isUnitTest())
|
||||
{
|
||||
|
||||
@@ -131,8 +131,6 @@ namespace BlackMisc
|
||||
m_stream << " and running with Qt " << qVersion();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user