-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
85 lines (69 loc) · 3.92 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
include Makefile.include
private_source_dirs := tpl demos
template_build_dir := tpl
soy_compiler_options = \
--shouldGenerateGoogMsgDefs \
--useGoogIsRtlForBidiGlobalDir \
--outputPathFormat \
'$(template_build_dir)/{INPUT_FILE_NAME_NO_EXT}.soy.js'
public_deps_cmdline = $(shell echo $(public_source_dirs) | sed 's+$(sed_tokenizer)+$(sed_deps_subst)+g')
private_deps_cmdline = $(shell echo $(private_source_dirs) | sed 's+$(sed_tokenizer)+$(sed_deps_subst)+g')
js_src = $(shell echo $(public_source_dirs) | sed 's+$(sed_tokenizer)+--js="./&/**.js"+g')
# Defines the files that should trigger rebuilding of the ppublic dependency file.
public_dep_file_deps := $(shell for folder in $(public_source_dirs) ; do find $$folder -name '*.js' ; done)
private_dep_file_deps = $(template_build_dir)/*.soy.js demos/*/*.js demos/*/*/*.js
all: $(lintfile) $(private_deps_file) $(public_deps_file)
@echo '>>> pstj library all done'
$(lintfile): $(public_dep_file_deps) demos/*/*.js
clang-format -style=Google -i $?
$(lint_cmd) $?
touch $@
# $(template_build_dir):
# mkdir $@
$(private_deps_file): $(private_dep_file_deps)
$(python) $(depswriter) $(private_deps_cmdline) --output_file=$@
$(public_deps_file): $(public_dep_file_deps)
$(python) $(depswriter) $(public_deps_cmdline) --output_file=$@
$(template_build_dir)/%.soy.js: $(template_source_dir)/%.soy
$(java) $(soy_compiler) $(soy_compiler_options) --srcs $?
# Clearly mark the dependency on the source as well as on the files
# used to produce the result so when we change the parsers the result
# changes as well.
#
# Also hardcode the input so it is not passed in when parser deps change.
templates/icons.soy: templates/icons.xml ds/autogen/iconrenderer.js ds/autogen/iconparser.js nodejs/icongen.js
node nodejs/icongen.js templates/icons.xml
clang-format -style=Google -i autogenerated/*.js
$(lint_cmd) autogenerated/*.js
schemes: schemes/*.json
mkdir -p autogenerated/ds/
node nodejs/dtogen.js pstj.gen.dto schemes autogenerated/ds/
clang-format -style=Google -i autogenerated/ds/*.js
$(lint_cmd) autogenerated/ds/*.js
lint:
$(lint_cmd) \
$(shell for folder in $(public_source_dirs) ; do find $$folder -name '*.js' ; done) \
demos/*/*.js demos/*/*/*.js
blia:
@echo $(python) $(depswriter) $(private_deps_cmdline)
single:
java -jar ../../compiler/compiler.jar \
--charset=UTF-8 \
--dependency_mode=STRICT \
--entry_point=goog:$(ns) \
--define='goog.LOCALE="en"' \
--define='goog.DEBUG=true' \
--process_closure_primitives \
--use_types_for_optimization \
--compilation_level=ADVANCED \
--assume_function_wrapper \
--jscomp_warning accessControls --jscomp_warning ambiguousFunctionDecl --jscomp_warning checkEventfulObjectDisposal --jscomp_warning checkRegExp --jscomp_warning checkTypes --jscomp_warning checkVars --jscomp_warning const --jscomp_warning constantProperty --jscomp_warning deprecated --jscomp_warning duplicateMessage --jscomp_warning es5Strict --jscomp_warning externsValidation --jscomp_warning fileoverviewTags --jscomp_warning globalThis --jscomp_warning internetExplorerChecks --jscomp_warning invalidCasts --jscomp_warning misplacedTypeAnnotation --jscomp_warning missingProperties --jscomp_warning missingProvide --jscomp_warning missingRequire --jscomp_warning missingReturn --jscomp_warning nonStandardJsDocs --jscomp_warning suspiciousCode --jscomp_warning strictModuleDepCheck --jscomp_warning typeInvalidation --jscomp_warning undefinedNames --jscomp_warning undefinedVars --jscomp_warning unknownDefines --jscomp_warning uselessCode --jscomp_warning visibility \
--formatting=PRETTY_PRINT \
--js_output_file=.artefact \
$(js_src) --js=./demos/**.js \
--js="../../templates/soyutils_usegoog.js" \
--js="../../library/closure/goog/**.js" \
--js="../../library/third_party/closure/goog/mochikit/async/deferred.js" \
--js="../../library/third_party/closure/goog/mochikit/async/deferredlist.js" \
--js="!**_test.js" \
--js="!*/*/node_modules/**.js"