@@ -14,8 +14,7 @@ import time
1414#=======================================================================================================================
1515PROJECT_PATH = os .path .abspath (os .path .dirname (__file__ ))
1616CONTRIB_PATH = os .path .join (PROJECT_PATH , 'contrib' )
17- COMPILER_VERSION = '20160911'
18- COMPILER_PATH = os .path .join (CONTRIB_PATH , 'compiler' , 'closure-compiler-v%s.jar' % COMPILER_VERSION )
17+ COMPILER_PATH = os .path .join (CONTRIB_PATH , 'compiler' , 'compiler.jar' )
1918SRC_PATH = os .path .join (PROJECT_PATH , 'src' )
2019OUT_PATH = os .path .join (PROJECT_PATH , 'out' )
2120CLOSURE_LIBRARY_PATH = os .path .join (CONTRIB_PATH , 'closure-library' )
@@ -29,7 +28,6 @@ PYTHON = 'python'
2928if not (platform .system () == 'Windows' ):
3029 PYTHON = 'python2.7'
3130
32-
3331#=======================================================================================================================
3432# Synchronize contributions.
3533#=======================================================================================================================
@@ -76,10 +74,10 @@ def __sync_contrib():
7674
7775 #Download closure compiler
7876 if not os .path .exists (COMPILER_PATH ):
79- print 'Downloading Google Closure Compiler v.' + COMPILER_VERSION
77+ print 'Downloading Google Closure Compiler v.20151216'
8078 try :
8179 __download_and_unzip_from_http (
82- 'http://dl.google.com/closure-compiler/compiler-%s .zip' % COMPILER_VERSION ,
80+ 'http://dl.google.com/closure-compiler/compiler-20151216 .zip' ,
8381 'compiler'
8482 )
8583 except StandardError as e :
@@ -153,26 +151,30 @@ def __getNotOptimizedCompilerArgs():
153151
154152def __getOptimizedCompilerArgs ():
155153 compilerArgs = [
156- '--compilation_level ADVANCED' ,
157- '--env BROWSER' ,
154+ '--compilation_level ADVANCED_OPTIMIZATIONS' ,
158155 '--warning_level VERBOSE' ,
159156 '--jscomp_warning accessControls' ,
160157 '--jscomp_warning ambiguousFunctionDecl' ,
158+ '--jscomp_warning checkDebuggerStatement' ,
161159 '--jscomp_warning checkEventfulObjectDisposal' ,
162160 '--jscomp_warning checkRegExp' ,
163161 '--jscomp_warning checkTypes' ,
164162 '--jscomp_warning checkVars' ,
163+ '--jscomp_warning closureDepMethodUsageChecks' ,
165164 '--jscomp_warning conformanceViolations' ,
166165 '--jscomp_warning const' ,
167166 '--jscomp_warning constantProperty' ,
168167 '--jscomp_warning deprecated' ,
169168 '--jscomp_warning deprecatedAnnotations' ,
169+ '--jscomp_warning duplicate' ,
170170 '--jscomp_warning duplicateMessage' ,
171171 '--jscomp_warning es3' ,
172172 '--jscomp_warning es5Strict' ,
173173 '--jscomp_warning externsValidation' ,
174+ '--jscomp_warning extraRequire' ,
174175 '--jscomp_warning fileoverviewTags' ,
175176 '--jscomp_warning globalThis' ,
177+ '--jscomp_warning inferredConstCheck' ,
176178 '--jscomp_warning internetExplorerChecks' ,
177179 '--jscomp_warning invalidCasts' ,
178180 '--jscomp_warning misplacedTypeAnnotation' ,
@@ -181,24 +183,22 @@ def __getOptimizedCompilerArgs():
181183 '--jscomp_warning missingProvide' ,
182184 '--jscomp_warning missingRequire' ,
183185 '--jscomp_warning missingReturn' ,
184- '--jscomp_warning msgDescriptions' ,
185186 '--jscomp_warning newCheckTypes' ,
187+ #'--jscomp_warning msgDescriptionsNewCheckTypes',
186188 '--jscomp_warning nonStandardJsDocs' ,
189+ #'--jscomp_warning reportUnknownTypes',
187190 '--jscomp_warning suspiciousCode' ,
188191 '--jscomp_warning strictModuleDepCheck' ,
192+ '--jscomp_warning tweakValidation' ,
189193 '--jscomp_warning typeInvalidation' ,
190194 '--jscomp_warning undefinedNames' ,
191195 '--jscomp_warning undefinedVars' ,
192196 '--jscomp_warning unknownDefines' ,
193- # '--jscomp_warning unusedLocalVariables',
194- # '--jscomp_warning unusedPrivateMembers',
197+ #+'--jscomp_warning unnecessaryCasts',
195198 '--jscomp_warning uselessCode' ,
196- # '--jscomp_warning useOfGoogBase',
197- '--jscomp_warning underscore ' ,
199+ #+ '--jscomp_warning useOfGoogBase',
200+ '--jscomp_warning violatedModuleDep ' ,
198201 '--jscomp_warning visibility' ,
199- # '--use_types_for_optimization',
200- '--rewrite_polyfills' ,
201- '--process_closure_primitives' ,
202202 ]
203203 return compilerArgs
204204
@@ -208,14 +208,12 @@ def __getDefaultCompilerArgs(outputFile):
208208 'java -jar' ,
209209 COMPILER_PATH ,
210210 '--charset UTF-8' ,
211- '--dependency_mode STRICT ' ,
211+ '--only_closure_dependencies ' ,
212212 '--externs ' + EXTERNS_PATH ,
213213 '--js="%s"' % os .path .join (SRC_PATH , '**.js' ),
214214 '--js="%s"' % os .path .join (CLOSURE_LIBRARY_PATH , '**.js' ),
215- '--entry_point acgraph' ,
216- '--js_output_file ' + outputFile ,
217- '--assume_function_wrapper' ,
218- '--output_wrapper "(function(){%output%}).apply(this);"'
215+ '--closure_entry_point acgraph' ,
216+ '--js_output_file ' + outputFile
219217 ]
220218 return result
221219
0 commit comments