@@ -824,45 +824,54 @@ def handle(fun, dir, args)
824824 formatting =
825825 ( ENV [ 'pretty_print' ] == 'true' ) ? "--formatting=PRETTY_PRINT" : ""
826826
827- cmd = "java -cp third_party/closure/bin/compiler.jar com.google.javascript.jscomp.CommandLineRunner " <<
828- "--js_output_file=#{ output } " <<
829- "--output_wrapper=\" #{ wrapper } \" " <<
830- "--compilation_level=#{ compilation_level ( minify ) } " <<
831- "--define=goog.NATIVE_ARRAY_PROTOTYPES=false " <<
832- "--define=bot.json.NATIVE_JSON=false " <<
833- "#{ defines } " <<
834- "#{ formatting } " <<
835- "--jscomp_off=unknownDefines " <<
836- "--jscomp_off=deprecated " <<
837- "--jscomp_error=accessControls " <<
838- "--jscomp_error=ambiguousFunctionDecl " <<
839- "--jscomp_error=checkDebuggerStatement " <<
840- "--jscomp_error=checkRegExp " <<
841- "--jscomp_error=checkTypes " <<
842- "--jscomp_error=checkVars " <<
843- "--jscomp_error=const " <<
844- "--jscomp_error=constantProperty " <<
845- "--jscomp_error=duplicate " <<
846- "--jscomp_error=duplicateMessage " <<
847- "--jscomp_error=externsValidation " <<
848- "--jscomp_error=fileoverviewTags " <<
849- "--jscomp_error=globalThis " <<
850- "--jscomp_error=internetExplorerChecks " <<
851- "--jscomp_error=invalidCasts " <<
852- "--jscomp_error=missingProperties " <<
853- "--jscomp_error=nonStandardJsDocs " <<
854- "--jscomp_error=strictModuleDepCheck " <<
855- "--jscomp_error=typeInvalidation " <<
856- "--jscomp_error=undefinedNames " <<
857- "--jscomp_error=undefinedVars " <<
858- "--jscomp_error=uselessCode " <<
859- "--jscomp_error=visibility " <<
860- "--js='" <<
861- all_deps . join ( "' --js='" ) << "'"
827+ flags = [ ]
828+ flags . push ( "--js_output_file=#{ output } " )
829+ flags . push ( "--output_wrapper=\" #{ wrapper } \" " )
830+ flags . push ( "--compilation_level=#{ compilation_level ( minify ) } " )
831+ flags . push ( "--define=goog.NATIVE_ARRAY_PROTOTYPES=false" )
832+ flags . push ( "--define=bot.json.NATIVE_JSON=false" )
833+ flags . push ( "#{ defines } " )
834+ flags . push ( "#{ formatting } " )
835+ flags . push ( "--jscomp_off=unknownDefines" )
836+ flags . push ( "--jscomp_off=deprecated" )
837+ flags . push ( "--jscomp_error=accessControls" )
838+ flags . push ( "--jscomp_error=ambiguousFunctionDecl" )
839+ flags . push ( "--jscomp_error=checkDebuggerStatement" )
840+ flags . push ( "--jscomp_error=checkRegExp" )
841+ flags . push ( "--jscomp_error=checkTypes" )
842+ flags . push ( "--jscomp_error=checkVars" )
843+ flags . push ( "--jscomp_error=const" )
844+ flags . push ( "--jscomp_error=constantProperty" )
845+ flags . push ( "--jscomp_error=duplicate" )
846+ flags . push ( "--jscomp_error=duplicateMessage" )
847+ flags . push ( "--jscomp_error=externsValidation" )
848+ flags . push ( "--jscomp_error=fileoverviewTags" )
849+ flags . push ( "--jscomp_error=globalThis" )
850+ flags . push ( "--jscomp_error=internetExplorerChecks" )
851+ flags . push ( "--jscomp_error=invalidCasts" )
852+ flags . push ( "--jscomp_error=missingProperties" )
853+ flags . push ( "--jscomp_error=nonStandardJsDocs" )
854+ flags . push ( "--jscomp_error=strictModuleDepCheck" )
855+ flags . push ( "--jscomp_error=typeInvalidation" )
856+ flags . push ( "--jscomp_error=undefinedNames" )
857+ flags . push ( "--jscomp_error=undefinedVars" )
858+ flags . push ( "--jscomp_error=uselessCode" )
859+ flags . push ( "--jscomp_error=visibility" )
860+
861+ expanded_flags = flags . join ( " " ) <<
862+ " --js='" <<
863+ all_deps . join ( "' --js='" ) << "'"
862864
863865 mkdir_p File . dirname ( output )
864866
867+ flag_file = File . join ( File . dirname ( output ) , "closure_flags.txt" )
868+ File . open ( flag_file , 'w' ) { |f | f . write ( expanded_flags ) }
869+
870+ cmd = "java -cp third_party/closure/bin/compiler.jar com.google.javascript.jscomp.CommandLineRunner " <<
871+ "--flagfile " << flag_file
872+
865873 sh cmd
874+ rm_rf flag_file
866875 end
867876
868877 output_task = Rake ::Task [ output ]
0 commit comments