build improvements
- add optional localbuildsettings.py - remove the 'jonatkins' and 'jonatkins-dev' from buildsettings.py - some devs were using them and it'll give them unexpected update behaviour - add a 'local' build - uses the public release for external resources (rather than a local web server as for local8000), but no distUrlBase. perfect for code-only changes - distUrlBase can now be None - no more wacky invalid URLs (the resourceUrlBase will become redundant once all resources are embedded, but that's still pending)
This commit is contained in:
parent
8e7681427e
commit
06778b2a6a
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
mobile/IngressIntelTC/bin
|
mobile/IngressIntelTC/bin
|
||||||
build
|
build
|
||||||
|
localbuildsettings.py
|
||||||
*.pyc
|
*.pyc
|
||||||
|
15
build.py
15
build.py
@ -12,6 +12,13 @@ import shutil
|
|||||||
# load settings file
|
# load settings file
|
||||||
from buildsettings import buildSettings
|
from buildsettings import buildSettings
|
||||||
|
|
||||||
|
# load option local settings file
|
||||||
|
try:
|
||||||
|
from localbuildsettings import buildSettings as localBuildSettings
|
||||||
|
buildSettings.update(localBuildSettings)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
@ -103,8 +110,8 @@ shutil.copytree('dist', outDir)
|
|||||||
# load main.js, parse, and create main total-conversion-build.user.js
|
# load main.js, parse, and create main total-conversion-build.user.js
|
||||||
main = readfile('main.js')
|
main = readfile('main.js')
|
||||||
|
|
||||||
downloadUrl = distUrlBase + '/total-conversion-build.user.js'
|
downloadUrl = distUrlBase and distUrlBase + '/total-conversion-build.user.js' or 'none'
|
||||||
updateUrl = distUrlBase + '/total-conversion-build.meta.js'
|
updateUrl = distUrlBase and distUrlBase + '/total-conversion-build.meta.js' or 'none'
|
||||||
main = doReplacements(main,downloadUrl=downloadUrl,updateUrl=updateUrl)
|
main = doReplacements(main,downloadUrl=downloadUrl,updateUrl=updateUrl)
|
||||||
|
|
||||||
saveScriptAndMeta(main, os.path.join(outDir,'total-conversion-build.user.js'), os.path.join(outDir,'total-conversion-build.meta.js'))
|
saveScriptAndMeta(main, os.path.join(outDir,'total-conversion-build.user.js'), os.path.join(outDir,'total-conversion-build.meta.js'))
|
||||||
@ -116,8 +123,8 @@ os.mkdir(os.path.join(outDir,'plugins'))
|
|||||||
for fn in glob.glob("plugins/*.user.js"):
|
for fn in glob.glob("plugins/*.user.js"):
|
||||||
script = readfile(fn)
|
script = readfile(fn)
|
||||||
|
|
||||||
downloadUrl = distUrlBase + '/' + fn.replace("\\","/")
|
downloadUrl = distUrlBase and distUrlBase + '/' + fn.replace("\\","/") or 'none'
|
||||||
updateUrl = downloadUrl.replace('.user.js', '.meta.js')
|
updateUrl = distUrlBase and downloadUrl.replace('.user.js', '.meta.js') or 'none'
|
||||||
script = doReplacements(script, downloadUrl=downloadUrl, updateUrl=updateUrl)
|
script = doReplacements(script, downloadUrl=downloadUrl, updateUrl=updateUrl)
|
||||||
|
|
||||||
metafn = fn.replace('.user.js', '.meta.js')
|
metafn = fn.replace('.user.js', '.meta.js')
|
||||||
|
@ -1,20 +1,30 @@
|
|||||||
# settings file for builds.
|
# settings file for builds.
|
||||||
|
|
||||||
|
# if you want to have custom builds, copy this file to "localbuildsettings.py" and make changes there.
|
||||||
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
'jonatkins': {
|
# local: use this build if you're not modifying external resources
|
||||||
|
# external resources will be loaded from the public live release
|
||||||
|
'local': {
|
||||||
'resourceUrlBase': 'http://iitc.jonatkins.com/release',
|
'resourceUrlBase': 'http://iitc.jonatkins.com/release',
|
||||||
'distUrlBase': 'https://secure.jonatkins.com/iitc/release',
|
'distUrlBase': None,
|
||||||
},
|
},
|
||||||
|
|
||||||
'jonatkins-dev': {
|
# local8000: if you need to modify external resources, this build will load them from
|
||||||
'resourceUrlBase': 'http://iitc.jonatkins.com/dev',
|
# the web server at http://0.0.0.0:8000/dist
|
||||||
'distUrlBase': 'https://secure.jonatkins.com/iitc/dev',
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
'local8000': {
|
'local8000': {
|
||||||
'resourceUrlBase': 'http://0.0.0.0:8000/dist',
|
'resourceUrlBase': 'http://0.0.0.0:8000/dist',
|
||||||
'distUrlBase': 'http://nohost.invalid/nopath',
|
'distUrlBase': None,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
# if you want to publish your own fork of the project, and host it on your own web site
|
||||||
|
# create a localbuildsettings.py file containing something similar to this
|
||||||
|
# note: Firefox+Greasemonkey require the distUrlBase to be "https" - they won't check for updates on regular "http" URLs
|
||||||
|
#'example': {
|
||||||
|
# 'resourceBaseUrl': 'http://www.example.com/iitc/dist',
|
||||||
|
# 'distUrlBase': 'https://secure.example.com/iitc/dist',
|
||||||
|
#},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user