mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
remove the minifyjs in waf build
This commit is contained in:
parent
d4c361aa84
commit
566521fbf3
@ -5,37 +5,3 @@ bld.install_files("${MSENVIRON}/webapps/client",bld.path.ant_glob("*.ico **/*png
|
||||
|
||||
# text substitutable files (substitute with tokens from the environment bld.env):
|
||||
bld.substitute('*html **/*html **/*js **/*css **/*properties **/*jsp *jsp',install_to="${MSENVIRON}/webapps/client")
|
||||
|
||||
# -> minification of UI files
|
||||
def minifyjs(task):
|
||||
tgt = task.outputs[0].bldpath(task.env)
|
||||
inputfiles = []
|
||||
outputfile = ['--js_output_file',tgt]
|
||||
for inp in task.inputs:
|
||||
src = inp.srcpath(task.env)
|
||||
inputfiles.append(src)
|
||||
newinputfiles = []
|
||||
for inputfile in inputfiles:
|
||||
if inputfile not in newinputfiles:
|
||||
newinputfiles.append('--js')
|
||||
newinputfiles.append(inputfile)
|
||||
compilerjar = os.path.join(bld.srcnode.abspath(),'tools','gcc','compiler.jar')
|
||||
return Utils.exec_command(["java",'-jar',compilerjar] + newinputfiles + outputfile,log=True)
|
||||
|
||||
javascripts = [
|
||||
['scripts/jquery-1.4.2.min.js','scripts/date.js'],
|
||||
Utils.to_list(bld.path.ant_glob('scripts/jquery*js')),
|
||||
['scripts/cloud.core.js','scripts/cloud.core.callbacks.js'],
|
||||
Utils.to_list(bld.path.ant_glob('scripts/cloud*js')),
|
||||
]
|
||||
sourcefiles = []
|
||||
for lst in javascripts:
|
||||
for x in lst:
|
||||
if x not in sourcefiles: sourcefiles.append(x)
|
||||
tgen = bld(
|
||||
rule = minifyjs,
|
||||
source = sourcefiles,
|
||||
target = 'scripts/cloud.min.js',
|
||||
name = 'minifyjs',
|
||||
)
|
||||
bld.install_files("${MSENVIRON}/webapps/client/scripts", "scripts/cloud.min.js")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user