added a build settings file, and build script uses it
ignored compiled python .pyc files
This commit is contained in:
parent
46bfed5d2f
commit
4a0f2aa5e4
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
mobile/IngressIntelTC/bin
|
mobile/IngressIntelTC/bin
|
||||||
build
|
build
|
||||||
|
*.pyc
|
||||||
|
26
build.py
26
build.py
@ -4,6 +4,7 @@ import glob
|
|||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
import io
|
import io
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
@ -34,12 +35,19 @@ def extractUserScriptMeta(var):
|
|||||||
|
|
||||||
utcTime = time.gmtime()
|
utcTime = time.gmtime()
|
||||||
buildDate = time.strftime('%Y-%m-%d-%H%M%S',utcTime)
|
buildDate = time.strftime('%Y-%m-%d-%H%M%S',utcTime)
|
||||||
|
# userscripts have specific specifications for version numbers - the above date format doesn't match
|
||||||
dateTimeVersion = time.strftime('%Y%m%d.%H%M%S',utcTime)
|
dateTimeVersion = time.strftime('%Y%m%d.%H%M%S',utcTime)
|
||||||
|
|
||||||
# TODO: some kind of settings files for these
|
# build name from command line
|
||||||
resourceUrlBase = 'http://iitc.jonatkins.com/dist'
|
buildName = sys.argv[1]
|
||||||
distUrlBase = 'http://iitc.jonatkins.com/dist'
|
|
||||||
buildName = 'jonatkins'
|
# load settings file
|
||||||
|
from buildsettings import buildSettings
|
||||||
|
settings = buildSettings[buildName]
|
||||||
|
|
||||||
|
# extract required values from the named settings entry
|
||||||
|
resourceUrlBase = settings['resourceUrlBase']
|
||||||
|
distUrlBase = settings['distUrlBase']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +78,7 @@ def saveScriptAndMeta(script,fn,metafn):
|
|||||||
f.write(meta)
|
f.write(meta)
|
||||||
|
|
||||||
|
|
||||||
outDir = 'build/jonatkins-dist'
|
outDir = os.path.join('build', buildName)
|
||||||
|
|
||||||
|
|
||||||
# create the build output
|
# create the build output
|
||||||
@ -85,14 +93,14 @@ shutil.copytree('dist', outDir)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# load main.js, parse, and create main total-conversion.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.user.js'
|
downloadUrl = distUrlBase + '/total-conversion-build.user.js'
|
||||||
updateUrl = distUrlBase + '/total-conversion.meta.js'
|
updateUrl = distUrlBase + '/total-conversion-build.meta.js'
|
||||||
main = doReplacements(main,downloadUrl=downloadUrl,updateUrl=updateUrl)
|
main = doReplacements(main,downloadUrl=downloadUrl,updateUrl=updateUrl)
|
||||||
|
|
||||||
saveScriptAndMeta(main, os.path.join(outDir,'total-conversion.user.js'), os.path.join(outDir,'total-conversion.meta.js'))
|
saveScriptAndMeta(main, os.path.join(outDir,'total-conversion-build.user.js'), os.path.join(outDir,'total-conversion-build.meta.js'))
|
||||||
|
|
||||||
|
|
||||||
# for each plugin, load, parse, and save output
|
# for each plugin, load, parse, and save output
|
||||||
|
20
buildsettings.py
Normal file
20
buildsettings.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# settings file for builds.
|
||||||
|
|
||||||
|
buildSettings = {
|
||||||
|
'jonatkins': {
|
||||||
|
'resourceUrlBase': 'http://iitc.jonatkins.com/dist',
|
||||||
|
'distUrlBase': 'http://iitc.jonatkins.com/dist',
|
||||||
|
},
|
||||||
|
|
||||||
|
'jonatkins-dev': {
|
||||||
|
'resourceUrlBase': 'http://iitc.jonatkins.com/dev',
|
||||||
|
'distUrlBase': 'http://iitc.jonatkins.com/dev',
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'local8000': {
|
||||||
|
'resourceUrlBase': 'http://0.0.0.0:8000/dist',
|
||||||
|
'distUrlBase': 'http://nohost.invalid/nopath',
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user