build.py - read optional defaultBuild from localbuildsettings.py
fix for #20 also, some other minor tweaks/cleanups in that area of the code
This commit is contained in:
parent
f0e3de1a80
commit
d0245394a3
20
build.py
20
build.py
@ -19,14 +19,24 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# load default build
|
||||||
|
try:
|
||||||
|
from localbuildsettings import defaultBuild
|
||||||
|
except ImportError:
|
||||||
|
defaultBuild = None
|
||||||
|
|
||||||
|
|
||||||
|
buildName = defaultBuild
|
||||||
|
|
||||||
# build name from command line
|
# build name from command line
|
||||||
if len(sys.argv) != 2: # argv[0] = program, argv[1] = buildname, len=2
|
if len(sys.argv) == 2: # argv[0] = program, argv[1] = buildname, len=2
|
||||||
print ("Usage: build.py buildname")
|
buildName = sys.argv[1]
|
||||||
print (" available build names:", ','.join(buildSettings.keys()))
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
buildName = sys.argv[1]
|
|
||||||
|
if buildName is None or not buildName in buildSettings:
|
||||||
|
print ("Usage: build.py buildname")
|
||||||
|
print (" available build names: %s" % ', '.join(buildSettings.keys()))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
settings = buildSettings[buildName]
|
settings = buildSettings[buildName]
|
||||||
|
|
||||||
|
@ -28,3 +28,8 @@ buildSettings = {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# defaultBuild - the name of the default build to use if none is specified on the build.py command line
|
||||||
|
# (in here as an example - it only works in localbuildsettings.py)
|
||||||
|
#defaultBuild = 'local'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user