forked from GoogleCloudPlatform/PerfKitExplorer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.cmd
52 lines (41 loc) · 2.09 KB
/
compile.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@ECHO OFF
REM PerfKit Explorer deployment script for Windows clients.
REM Requirements:
REM * Java 7 JRE
REM * Python 2.7
REM * Google App Engine
REM * Closure Compiler
ECHO ** Clean out the existing deployment content.
rmdir /S /Q deploy
ECHO ** Copy config files (json, yaml ^& appengine_config.py) to deploy.
xcopy .\config\*.json .\deploy\config\ >> last_compile.log
copy *.yaml .\deploy\ >> last_compile.log
copy *.py .\deploy\ >> last_compile.log
ECHO ** Copy server/*.py files (not tests) to deploy/server
xcopy .\server\*.py .\deploy\server\ /S >> last_compile.log
FOR /f %%f IN ('dir /s /b .\deploy\server\*_test.py') DO del %%f >> last_compile.log
ECHO ** Copy server/*.html files to deploy/server
xcopy .\server\*.html .\deploy\server\ /S >> last_compile.log
ECHO ** Copy third_party/py files to deploy/server/third_party
xcopy .\third_party\py\*.* .\deploy\server\third_party\ /S >> last_compile.log
ECHO ** Copy client/*.html template files to deploy/client.
xcopy .\client\*.html .\deploy\client\ /S >> last_compile.log
ECHO ** Compile client/*.js files to deploy/client/perfkit_scripts.js.
python %closurelib%/closure/bin/build/closurebuilder.py ^
--root=%closurelib%/ ^
--root=client/ ^
--namespace="p3rf.perfkit.explorer.application.module" ^
--output_mode=compiled ^
--compiler_jar=bin/closure-compiler.jar ^
--compiler_flags="--angular_pass" ^
--compiler_flags="--compilation_level=WHITESPACE_ONLY" ^
--compiler_flags="--language_in=ECMASCRIPT5" ^
--compiler_flags="--formatting=PRETTY_PRINT" ^
--output_file=deploy/client/perfkit_scripts.js >> last_compile.log
SET CSS_TEMPFILE=deploy\perfkit_styles_raw.css
ECHO ** Combine the client/*.css stylesheets into a single file.
ECHO. /* Concatenated CSS */ > %CSS_TEMPFILE%
FOR /F %%k in ('dir /b /s /-p client /o:n /a:-d ^| findstr /E .css') DO copy /y /b "%CSS_TEMPFILE%" + "%%k" "%CSS_TEMPFILE%" >> last_compile.log
java -jar bin/closure-stylesheets.jar --pretty-print --output-file deploy/client/perfkit_styles.css ^
--allow-unrecognized-functions --allow-unrecognized-properties "%CSS_TEMPFILE%" >> last_compile.log
ECHO Compilation complete.