Improve defaults in prepare script.

This commit is contained in:
John Preston 2021-10-29 21:21:33 +04:00
parent 1297860652
commit f71a2149f3

View file

@ -35,24 +35,20 @@ libsDir = rootDir + dirSep + libsLoc
thirdPartyDir = rootDir + dirSep + 'ThirdParty' thirdPartyDir = rootDir + dirSep + 'ThirdParty'
usedPrefix = libsDir + dirSep + 'local' usedPrefix = libsDir + dirSep + 'local'
processedArgs = [] optionsList = [
skipReleaseBuilds = False 'skip-release',
buildQt5 = True 'build-qt5',
buildQt6 = False 'skip-qt5',
buildMinidumpStackwalk = False 'build-qt6',
'skip-qt6',
'build-stackwalk',
]
options = []
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if arg == 'skip-release': if arg in optionsList:
processedArgs.append(arg) options.append(arg)
skipReleaseBuilds = True buildQt5 = not 'skip-qt5' in options if win else 'build-qt5' in options
elif arg == 'qt6': buildQt6 = 'build-qt6' in options if win else not 'skip-qt6' in options
processedArgs.append(arg)
buildQt6 = True
elif arg == 'skip-qt5':
processedArgs.append(arg)
buildQt5 = False
elif arg == 'minidump_stackwalk':
processedArgs.append(arg)
buildMinidumpStackwalk = True
if not os.path.isdir(libsDir + '/' + keysLoc): if not os.path.isdir(libsDir + '/' + keysLoc):
pathlib.Path(libsDir + '/' + keysLoc).mkdir(parents=True, exist_ok=True) pathlib.Path(libsDir + '/' + keysLoc).mkdir(parents=True, exist_ok=True)
@ -205,7 +201,7 @@ def filterByPlatform(commands):
# if linux and 'linux' in scopes: # if linux and 'linux' in scopes:
# inscope = True # inscope = True
if 'release' in scopes: if 'release' in scopes:
if skipReleaseBuilds: if 'skip-release' in options:
inscope = False inscope = False
elif len(scopes) == 1: elif len(scopes) == 1:
continue continue
@ -320,7 +316,7 @@ def runStages():
onlyStages = [] onlyStages = []
rebuildStale = False rebuildStale = False
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if arg in processedArgs: if arg in options:
continue continue
elif arg == 'silent': elif arg == 'silent':
rebuildStale = True rebuildStale = True
@ -399,7 +395,7 @@ mac:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
""", 'ThirdParty') """, 'ThirdParty')
if not mac or buildMinidumpStackwalk: if not mac or 'build-stackwalk' in options:
stage('gyp', """ stage('gyp', """
win: win:
git clone https://chromium.googlesource.com/external/gyp git clone https://chromium.googlesource.com/external/gyp
@ -878,7 +874,7 @@ mac:
make install make install
""") """)
if buildMinidumpStackwalk: if 'build-stackwalk' in options:
stage('stackwalk', """ stage('stackwalk', """
mac: mac:
git clone https://chromium.googlesource.com/breakpad/breakpad stackwalk git clone https://chromium.googlesource.com/breakpad/breakpad stackwalk