diff --git a/.gitignore b/.gitignore index e859f5df..40577945 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ mobile/IngressIntelTC/bin build +localbuildsettings.py *.pyc diff --git a/build.py b/build.py index 34cf2588..dd8b87c5 100755 --- a/build.py +++ b/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') diff --git a/buildsettings.py b/buildsettings.py index 6245b574..2edefe9f 100644 --- a/buildsettings.py +++ b/buildsettings.py @@ -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 = { - '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', + #}, + + }