Ant task for compiling JavaScript

717 views
Skip to first unread message

Sten Roger

unread,
Jan 8, 2010, 6:46:09 PM1/8/10
to Closure Compiler Discuss
Hi all.

I have (by request) submitted a patch to include a Ant task for
compiling javascripts with closure compiler. Instead of hosting such
tools myself it's better to be included under closure compiler project
(or any closure-compiler-tools) itself.

Really hope you guys include it since it will ease the job of
integrating this great tool in existing build environments. Can also
be used in builder (my favourite), gradle and Maven. Anyway, I have a
Maven plugin too that will be contributed as soon as I can manage to
clean up the code a bit.

/srs

An example on how to use it:
<?xml version="1.0"?>
<project basedir="." default="compile">

<taskdef name="jscomp"
classname="com.google.javascript.jscomp.ant.CompileTask"
classpath="../build/compiler.jar"/>

<target name="compile">

<jscomp compilation="simple" warning="verbose" debug="false"
output="output/file.js">

<externs dir="${basedir}/src">
<file name="extern.js"/>
</externs>

<sources dir="${basedir}/src">
<file name="simple1.js"/>
<file name="simple2.js"/>
</sources>

<sources dir="${basedir}/other">
<file name="simple3.js"/>
</sources>

</jscomp>

</target>

</project>

Reply all
Reply to author
Forward
0 new messages