forked from google/blockly-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (100 loc) · 5.61 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
##############################
# Definitions
##############################
USER_APPS = {index,puzzle,maze,bird,turtle,movie,pond/docs,pond/tutor,pond/duck}
ALL_JSON = {./,index,puzzle,maze,bird,turtle,movie,pond/docs,pond,pond/tutor,pond/duck}
ALL_TEMPLATES = appengine/template.soy,appengine/index/template.soy,appengine/puzzle/template.soy,appengine/maze/template.soy,appengine/bird/template.soy,appengine/turtle/template.soy,appengine/movie/template.soy,appengine/pond/docs/template.soy,appengine/pond/template.soy,appengine/pond/tutor/template.soy,appengine/pond/duck/template.soy
APP_ENGINE_THIRD_PARTY = appengine/third-party
SOY_COMPILER = java -jar third-party/SoyToJsSrcCompiler.jar --shouldProvideRequireSoyNamespaces --isUsingIjData
SOY_EXTRACTOR = java -jar third-party/SoyMsgExtractor.jar
##############################
# Rules
##############################
all: deps languages
index-en:
mkdir -p appengine/generated/en/
$(SOY_COMPILER) --outputPathFormat appengine/index/generated/en/soy.js --srcs appengine/index/template.soy
python build-app.py index en
puzzle-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/puzzle/generated/en/soy.js --srcs appengine/puzzle/template.soy
python build-app.py puzzle en
maze-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/maze/generated/en/soy.js --srcs appengine/maze/template.soy
python build-app.py maze en
bird-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/bird/generated/en/soy.js --srcs appengine/bird/template.soy
python build-app.py bird en
turtle-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/turtle/generated/en/soy.js --srcs appengine/turtle/template.soy
python build-app.py turtle en
movie-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/movie/generated/en/soy.js --srcs appengine/movie/template.soy
python build-app.py movie en
pond-docs-en:
mkdir -p appengine/pond/generated/en/
$(SOY_COMPILER) --outputPathFormat appengine/pond/docs/generated/en/soy.js --srcs appengine/pond/docs/template.soy
python build-app.py pond/docs en
pond-tutor-en: pond-common-en
$(SOY_COMPILER) --outputPathFormat appengine/pond/tutor/generated/en/soy.js --srcs appengine/pond/tutor/template.soy
python build-app.py pond/tutor en
pond-duck-en: pond-common-en
$(SOY_COMPILER) --outputPathFormat appengine/pond/duck/generated/en/soy.js --srcs appengine/pond/duck/template.soy
python build-app.py pond/duck en
genetics-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/genetics/generated/en/soy.js --srcs appengine/genetics/template.soy
python build-app.py genetics en
pond-common-en: common-en
$(SOY_COMPILER) --outputPathFormat appengine/pond/generated/en/soy.js --srcs appengine/pond/template.soy
common-en:
$(SOY_COMPILER) --outputPathFormat appengine/generated/en/soy.js --srcs appengine/template.soy
en: index-en puzzle-en maze-en bird-en turtle-en movie-en pond-docs-en pond-tutor-en pond-duck-en genetics-en
languages:
$(SOY_EXTRACTOR) --outputFile extracted_msgs.xlf --srcs $(ALL_TEMPLATES)
i18n/xliff_to_json.py --xlf extracted_msgs.xlf --templates $(ALL_TEMPLATES)
@for app in $(ALL_JSON); do \
mkdir -p appengine/$$app/generated; \
i18n/json_to_js.py --path_to_jar third-party --output_dir appengine/$$app/generated --template appengine/$$app/template.soy --key_file json/keys.json json/*.json; \
done
@for app in $(USER_APPS); do \
echo; \
echo --- $$app; \
for lang in `ls appengine/$$app/generated`; do \
python build-app.py $$app $$lang; \
done \
done
deps:
mkdir -p third-party
@# All following commands are in third-party, use backslashes to keep them on the same line as the cd command.
cd third-party; \
svn checkout https://github.com/google/closure-library/trunk/closure/bin/build build; \
wget -N https://dl.google.com/closure-templates/closure-templates-for-javascript-latest.zip; \
unzip -o closure-templates-for-javascript-latest.zip SoyToJsSrcCompiler.jar; \
unzip -o closure-templates-for-javascript-latest.zip -d ../$(APP_ENGINE_THIRD_PARTY) soyutils_usegoog.js; \
wget -N https://dl.google.com/closure-templates/closure-templates-msg-extractor-latest.zip; \
unzip -o closure-templates-msg-extractor-latest.zip SoyMsgExtractor.jar; \
wget -N https://dl.google.com/closure-compiler/compiler-latest.zip; \
unzip -o compiler-latest.zip -x COPYING README.md; \
mv -f closure-compiler-v*.jar closure-compiler.jar; \
chmod +x build/closurebuilder.py
mkdir -p $(APP_ENGINE_THIRD_PARTY)
svn checkout https://github.com/google/closure-library/trunk/closure/goog/ $(APP_ENGINE_THIRD_PARTY)/goog
svn checkout https://github.com/google/closure-library/trunk/third_party/closure/goog/ $(APP_ENGINE_THIRD_PARTY)/third_party_goog
svn checkout https://github.com/ajaxorg/ace-builds/trunk/src-min-noconflict/ $(APP_ENGINE_THIRD_PARTY)/ace
svn checkout https://github.com/google/blockly/trunk/ $(APP_ENGINE_THIRD_PARTY)/blockly
svn checkout https://github.com/mudcube/MIDI.js/trunk/@365 $(APP_ENGINE_THIRD_PARTY)/midi-js
@# messages.js confuses the compiler by also providing "Blockly.Msg.en".
rm $(APP_ENGINE_THIRD_PARTY)/blockly/msg/messages.js
svn checkout https://github.com/NeilFraser/JS-Interpreter/trunk/ $(APP_ENGINE_THIRD_PARTY)/JS-Interpreter
java -jar third-party/closure-compiler.jar\
--js appengine/third-party/JS-Interpreter/acorn.js\
--js appengine/third-party/JS-Interpreter/interpreter.js\
--js_output_file appengine/third-party/JS-Interpreter/compiled.js
clean: clean-languages clean-deps
clean-languages:
rm -rf appengine/$(ALL_JSON)/generated
rm -f json/keys.json
clean-deps:
rm -rf appengine/third-party
rm -rf third-party
# Prevent non-traditional rules from exiting with no changes.
.PHONY: deps