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
|
||||
build
|
||||
localbuildsettings.py
|
||||
*.pyc
|
||||
|
15
build.py
15
build.py
@ -12,6 +12,13 @@ import shutil
|
||||
# load settings file
|
||||
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
|
||||
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
|
||||
main = readfile('main.js')
|
||||
|
||||
downloadUrl = distUrlBase + '/total-conversion-build.user.js'
|
||||
updateUrl = distUrlBase + '/total-conversion-build.meta.js'
|
||||
downloadUrl = distUrlBase and distUrlBase + '/total-conversion-build.user.js' or 'none'
|
||||
updateUrl = distUrlBase and distUrlBase + '/total-conversion-build.meta.js' or 'none'
|
||||
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'))
|
||||
@ -116,8 +123,8 @@ os.mkdir(os.path.join(outDir,'plugins'))
|
||||
for fn in glob.glob("plugins/*.user.js"):
|
||||
script = readfile(fn)
|
||||
|
||||
downloadUrl = distUrlBase + '/' + fn.replace("\\","/")
|
||||
updateUrl = downloadUrl.replace('.user.js', '.meta.js')
|
||||
downloadUrl = distUrlBase and distUrlBase + '/' + fn.replace("\\","/") or 'none'
|
||||
updateUrl = distUrlBase and downloadUrl.replace('.user.js', '.meta.js') or 'none'
|
||||
script = doReplacements(script, downloadUrl=downloadUrl, updateUrl=updateUrl)
|
||||
|
||||
metafn = fn.replace('.user.js', '.meta.js')
|
||||
|
@ -1,20 +1,30 @@
|
||||
# settings file for builds.
|
||||
|
||||
# if you want to have custom builds, copy this file to "localbuildsettings.py" and make changes there.
|
||||
|
||||
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',
|
||||
'distUrlBase': 'https://secure.jonatkins.com/iitc/release',
|
||||
'distUrlBase': None,
|
||||
},
|
||||
|
||||
'jonatkins-dev': {
|
||||
'resourceUrlBase': 'http://iitc.jonatkins.com/dev',
|
||||
'distUrlBase': 'https://secure.jonatkins.com/iitc/dev',
|
||||
},
|
||||
|
||||
|
||||
# local8000: if you need to modify external resources, this build will load them from
|
||||
# the web server at http://0.0.0.0:8000/dist
|
||||
'local8000': {
|
||||
'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