Skip to content

Instantly share code, notes, and snippets.

@addyosmani
Forked from millermedeiros/build.xml
Created April 7, 2011 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addyosmani/907047 to your computer and use it in GitHub Desktop.
Save addyosmani/907047 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<project name="sample-require-js" default="" basedir=".">
<!-- properties -->
<property name="requirejs.dir" value="_build/requirejs" />
<!-- custom tasks -->
<!-- targets -->
<target name="-optimize" description="Combine and minify files.">
<java classname="org.mozilla.javascript.tools.shell.Main">
<classpath>
<pathelement location="${requirejs.dir}/build/lib/rhino/js.jar" />
<pathelement location="${requirejs.dir}/build/lib/closure/compiler.jar" />
</classpath>
<arg value="${requirejs.dir}/bin/x.js"/>
<arg value="${requirejs.dir}/bin"/>
<arg value="${requirejs.dir}/build/build.js"/>
<arg value="${requirejs.optimizer.settings}"/>
</java>
</target>
<target name="optimizeJS">
<echo message="Combining and minifying JS files." />
<antcall target="-optimize">
<param name="requirejs.optimizer.settings" value="_build/js.build.js" />
</antcall>
</target>
<target name="optimizeCSS">
<echo message="Combining and compressing CSS files." />
<antcall target="-optimize">
<param name="requirejs.optimizer.settings" value="_build/css.build.js" />
</antcall>
</target>
</project>
({
appDir: "../style",
baseUrl: "../style",
optimizeCss : "standard",
dir: "../../../deploy/style"
})
({
appDir: "../scripts",
baseUrl: "../scripts",
dir: "../../../deploy/scripts",
modules: [
{
name: "main",
include : [
"lib/my_awesome_shared_lib"
],
includeRequire: true
},
{
name : "sections/home/main",
exclude : [
"lib/my_awesome_shared_lib"
]
},
{
name : "sections/gallery/main",
exclude : [
"lib/my_awesome_shared_lib"
]
}
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment