Closed GoogleCodeExporter closed 9 years ago
Here is an example of ANT script:
build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Juridoc Client" basedir=".">
<property file="build.properties" />
<!-- Init all properties for the ANT script -->
<property name="jarsDir" value="${build.dir}/${build.dir.package}" />
<property name="compileDir" value="${build.dir}/${build.dir.gson}" />
<property name="resourcesDir" value="${project.dir}/src/main/resources" />
<property name="sourceDir" value="${project.dir}/src/main/java" />
<property name="jarName" value="${build.name.gson}" />
<target name="compile" depends="setup" description="Compile into ${compileDir}">
<!-- Compile the client source -->
<javac srcdir="${sourceDir}" destdir="${compileDir}" source="${version.source}"
target="${version.compile}" debug="on" encoding="${compile.encoding}">
</javac>
</target>
<target name="package" depends="setupJAR, compile" description="Package to file
${jarName}">
<!-- Build the manifest file -->
<manifest file="MANIFEST.MF">
<attribute name="Build-Version" value="${build.version.num}"/>
</manifest>
<copy todir="${compileDir}">
<fileset dir="${resourcesDir}" includes="**/*.*" />
</copy>
<!-- Build the jar with compilation folder content -->
<jar destfile="${jarsDir}/${jarName}" manifest="MANIFEST.MF">
<fileset dir="${compileDir}" includes="**" />
</jar>
<!-- Delete the compilation folder -->
<delete dir="${compileDir}" />
<!-- Delete the manifest file -->
<delete file="MANIFEST.MF" />
</target>
<target name="deploy" depends="package" />
<target name="setup" description="Creates the ${compileDir} directory">
<!-- generate the client compilation folder -->
<delete dir="${compileDir}" />
<mkdir dir="${compileDir}" />
</target>
<target name="setupJAR" description="Creates the ${jarsDir} directory">
<!-- generate the jar folder -->
<mkdir dir="${jarsDir}" />
</target>
</project>
build.properties:
build.dir=c:/temp/gson
build.dir.gson=gson-core
build.name.gson=gson-1.3-patch.jar
build.dir.package=jars
build.version.num=1.3
project.dir=.
compile.encoding=ISO_8859-1
version.source=1.5
version.compile=1.5
Original comment by lapinouj...@gmail.com
on 15 May 2010 at 12:52
Original comment by limpbizkit
on 6 Oct 2010 at 5:52
It's hard enough to support one build system. If you'd like to use Ant, I
invite you to copy the build.xml above into your copy of GSON.
Original comment by limpbizkit
on 1 Jul 2011 at 9:46
Original issue reported on code.google.com by
bolinf...@gmail.com
on 27 Apr 2010 at 4:06