Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10282 closed enhancement (fixed)

Support for Google Closure Compiler in build scripts

Reported by: Adam Peller Owned by: James Burke
Priority: high Milestone: 1.4
Component: BuildTools Version: 1.4.0b
Keywords: Cc: Nathan Toone
Blocked By: Blocking:

Description

as an alternative to shrinksafe, packer, etc.

Attachments (2)

10282.patch (2.9 KB) - added by James Burke 10 years ago.
Beginning of a patch, but has a type error.
10282.liucougar.patch (2.8 KB) - added by liucougar 10 years ago.
fixing the type error and add keepLines support

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by James Burke

Attachment: 10282.patch added

Beginning of a patch, but has a type error.

comment:1 Changed 10 years ago by James Burke

I'm trying to get closure to work, but just for the "simple optimizations" minification. I'm running into what I believe are type conversion issues with JavaScript? talking to Java. I attached a patch showing where I am at. To try it:

  • Place it in dojo/util/closurecompiler/compiler.jar
  • Apply the above patch from the dojo/util/buildscripts directory.
  • Run the following build command:

java -classpath ../shrinksafe/js.jar:../closurecompiler/compiler.jar org.mozilla.javascript.tools.shell.Main build.js profile=base releaseName=clos layerOptimize=closure action=release

I complains about:

js: Cannot convert com.google.javascript.jscomp.SourceFile$Preloaded@26afa68a to com.google.javascript.jscomp.JSSourceFile

Even though I am calling JSSourceFile.fromCode() to generate the source file. Not sure how to resolve the issue. Any ideas are appreciated.

Changed 10 years ago by liucougar

Attachment: 10282.liucougar.patch added

fixing the type error and add keepLines support

comment:2 Changed 10 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [20740]) Fixes #10282, thanks to liucougar's wizardry. Only simple optimization support is supported with Closure compiler right now.

comment:3 Changed 10 years ago by James Burke

Milestone: tbd1.4

Docs added here: http://docs.dojocampus.org/build/index#using-google-s-closure-compiler

and the 1.4 release notes were updated.

Note: See TracTickets for help on using tickets.