using the compiler.jar file

98 views
Skip to first unread message

Ron Derksen

unread,
Jan 8, 2010, 5:20:05 AM1/8/10
to Closure Compiler Discuss
Hi list,

I've been looking into using the jar file as part of our build
process, but it seems that the only way to configure what to process
is through the command line call. I think it would be nice to set the
configuration in a file. e.g. something like:

// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name core.js
// @warning_level quiet
// @code_url http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js
// @code_url http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject_src.js
// ==/ClosureCompiler

Did I miss something and is this already possible?

Thanks,
Ron

Alan Leung

unread,
Jan 8, 2010, 10:41:14 AM1/8/10
to closure-comp...@googlegroups.com
Hi Ron:

There is currently no way to do that. I suggest writing a small script with your favorite language and convert that config to command line options.

-Alan

John Lenz

unread,
Jan 8, 2010, 11:18:57 AM1/8/10
to closure-comp...@googlegroups.com
You can specify the command-line flags in a file, it would look like this:

java -jar compiler.jar --flagfile=flags.txt

where "flags.txt" contains the actual flags as you would otherwise put on the command-line:

--js=first.js
--js=second.js
--js_output_file=js
--warning_level=QUIET
--compilation_level=ADVANCED_OPTIMIZATIONS

The compiler.jar does not have any support for retrieving files via URL.


On Fri, Jan 8, 2010 at 2:20 AM, Ron Derksen <chev...@gmail.com> wrote:

John Lenz

unread,
May 11, 2010, 6:28:25 PM5/11/10
to Joel Cairney, closure-compiler
I didn't plan on doing anything, but you can file an issue and maybe someone will pick it up.  http://code.google.com/p/closure-compiler/issues/list

On Mon, May 10, 2010 at 10:25 AM, Joel Cairney <cairne...@gmail.com> wrote:
Hi John,
 
Thanks for the reply. I'm still trying to figure out how to add to a Closure Compiler discussion when only the 'Reply to author' link is available.
 
Will you be looking into replacing the --flagfile option in the future? Right now I would like to be listing around 100 externs, but don't have enough room on the Windows command line.
 
Joel

On Sat, May 8, 2010 at 3:05 PM, John Lenz <conca...@gmail.com> wrote:

I believe the feature was lost when we switched to args4j. I haven't looked into replacing it.

On May 5, 2010 12:01 PM, "Joel Cairney" <cairne...@gmail.com> wrote:

Hi John,

I'm getting --flagfile is not a valid option. Does this option
actually exist yet?

-Joel


On Jan 8, 12:18 pm, John Lenz <concavel...@gmail.com> wrote:
> You can specify the command-line fla...

> On Fri, Jan 8, 2010 at 2:20 AM, Ron Derksen <cheval...@gmail.com> wrote:
> > Hi list,
>

> > I've b...

> > Ron- Hide quoted text -
>
> - Show quoted text -



Reply all
Reply to author
Forward
0 new messages