Migrated common build to 1.10 (from 1.3).

This commit is contained in:
Jonathan Bernard 2013-08-27 19:03:27 -05:00
parent c3dfb014a2
commit 49b7524eb7
5 changed files with 76 additions and 15 deletions

View File

@ -1,7 +1,7 @@
<project name="gritter" basedir="." default="ng-deploy"> <project name="gritter" basedir="." default="ng-deploy">
<property file="project.properties"/> <property file="project.properties"/>
<import file="jdb-build-1.3.xml"/> <import file="jdb-build-1.10.xml"/>
<target name="init"> <target name="init">
<mkdir dir="${build.dir}/main/classes"/> <mkdir dir="${build.dir}/main/classes"/>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project name="Jonathan Bernard Build Common"> <project name="Jonathan Bernard Build Common"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/> <property environment="env"/>
@ -16,6 +17,7 @@
<property name="build.dir" value="${basedir}/build"/> <property name="build.dir" value="${basedir}/build"/>
<property name="lib.dir" value="${basedir}/lib"/> <property name="lib.dir" value="${basedir}/lib"/>
<property name="resources.dir" value="${basedir}/resources"/> <property name="resources.dir" value="${basedir}/resources"/>
<property name="splash.image" value="splash.png"/>
<!--======== PATHS ========--> <!--======== PATHS ========-->
<path id="groovy.classpath"> <path id="groovy.classpath">
@ -47,19 +49,42 @@
<target name="-init-groovy"> <target name="-init-groovy">
<taskdef name="groovyc" classpathref="groovy.classpath" <taskdef name="groovyc" classpathref="groovy.classpath"
classname="org.codehaus.groovy.ant.Groovyc"/> classname="org.codehaus.groovy.ant.Groovyc"/>
<taskdef name="groovy" classpathref="groovy.classpath"
classname="org.codehaus.groovy.ant.Groovy"/>
</target> </target>
<target name="init"/>
<target name="clean" depends="-init"> <target name="clean" depends="-init">
<delete dir="${build.dir}"/> <delete dir="${build.dir}"/>
</target> </target>
<!--======== LIBRARY TARGETS ========--> <!--======== LIBRARY TARGETS ========-->
<target name="lib" depends="-lib-local,-lib-ivy"/> <target name="-lib" depends="-lib-local,-lib-ivy,lib"/>
<target name="-lib-ivy" unless="${lib.local}"/> <target name="lib"/>
<target name="-init-ivy">
<ivy:settings id="ivy.settings" file="ivysettings.xml"/>
</target>
<target name="-lib-ivy" depends="-init-ivy" unless="${lib.local}">
<ivy:retrieve settingsRef="ivy.settings"
pattern="${lib.dir}/[conf]/[type]/[artifact]-[revision].[ext]"
conf="compile,runtime"/>
</target>
<target name="-lib-groovy" if="${lib.local}">
<copy todir="${build.dir}/lib/runtime/jar">
<fileset dir="${env.GROOVY_HOME}/embeddable"/>
</copy>
</target>
<target name="-lib-local" if="${lib.local}"> <target name="-lib-local" if="${lib.local}">
<echo message="Resolving libraries locally."/> <echo message="Resolving libraries locally."/>
<mkdir dir="${build.dir}/lib/compile/jar"/>
<mkdir dir="${build.dir}/lib/runtime/jar"/>
<copy todir="${build.dir}/lib/compile/jar" failonerror="false"> <copy todir="${build.dir}/lib/compile/jar" failonerror="false">
<fileset dir="${lib.dir}/compile/jar"/> <fileset dir="${lib.dir}/compile/jar"/>
</copy> </copy>
@ -84,13 +109,15 @@
<propertyfile file="${versioning.file}"> <propertyfile file="${versioning.file}">
<entry key="version" value="${new-version}" operation="=" <entry key="version" value="${new-version}" operation="="
type="string"/> type="string"/>
<entry key="build.number" value="0" type="int" operation="="/>
</propertyfile> </propertyfile>
</target> </target>
<!--======== COMPILATION TARGETS ========--> <!--======== COMPILATION TARGETS ========-->
<target name="-compile-groovy" depends="-init,-init-groovy,lib"> <target name="-compile-groovy" depends="-init,-init-groovy,-lib,-lib-groovy">
<groovyc srcdir="${src.dir}" destdir="${build.dir}/main/classes" <mkdir dir="${build.dir}/main/classes"/>
includeAntRuntime="false"> <groovyc srcdir="${src.dir}/main" destdir="${build.dir}/main/classes"
includeAntRuntime="false" fork="true">
<classpath> <classpath>
<path refid="groovy.classpath"/> <path refid="groovy.classpath"/>
@ -100,8 +127,9 @@
</groovyc> </groovyc>
</target> </target>
<target name="-compile-java" depends="-init,lib"> <target name="-compile-java" depends="-init,-lib">
<javac srcdir="${src.dir}" destdir="${build.dir}/main/classes" <mkdir dir="${build.dir}/main/classes"/>
<javac srcdir="${src.dir}/main" destdir="${build.dir}/main/classes"
includeAntRuntime="false" classpathref="compile-libs"/> includeAntRuntime="false" classpathref="compile-libs"/>
</target> </target>
@ -109,8 +137,9 @@
<!--======== JUNIT TARGETS ========--> <!--======== JUNIT TARGETS ========-->
<target name="-compile-tests-groovy" depends="-init,compile"> <target name="-compile-tests-groovy" depends="-init,compile">
<groovyc srcdir="${test.dir}" destdir="${build.dir}/test/classes" <mkdir dir="${build.dir}/test/classes"/>
includeAntRuntime="false"> <groovyc srcdir="${src.dir}/test" destdir="${build.dir}/test/classes"
includeAntRuntime="false" fork="true">
<classpath> <classpath>
<path refid="groovy.classpath"/> <path refid="groovy.classpath"/>
@ -121,7 +150,8 @@
</target> </target>
<target name="-compile-tests-java" depends="-init,compile"> <target name="-compile-tests-java" depends="-init,compile">
<javac srcdir="${test.dir}" destdir="${build.dir}/test/classes" <mkdir dir="${build.dir}/test/classes"/>
<javac srcdir="${src.dir}/test" destdir="${build.dir}/test/classes"
includeAntRuntime="false"> includeAntRuntime="false">
<classpath> <classpath>
<path refid="compile-libs"/> <path refid="compile-libs"/>
@ -152,25 +182,56 @@
<!--======== RESOURCES TARGETS ========--> <!--======== RESOURCES TARGETS ========-->
<target name="resources" depends="-init"> <target name="resources" depends="-init">
<mkdir dir="${build.dir}/main/classes"/>
<copy todir="${build.dir}/main/classes" failonerror="false"> <copy todir="${build.dir}/main/classes" failonerror="false">
<fileset dir="${resources.dir}/main/"/> <fileset dir="${resources.dir}/main/"/>
</copy> </copy>
</target> </target>
<target name="resources-test" depends="-init"> <target name="resources-test" depends="-init">
<mkdir dir="${build.dir}/test/classes"/>
<copy todir="${build.dir}/test/classes" failonerror="false"> <copy todir="${build.dir}/test/classes" failonerror="false">
<fileset dir="${resources.dir}/test/"/> <fileset dir="${resources.dir}/test/"/>
</copy> </copy>
</target> </target>
<!--======== BUILD TARGETS ========--> <!--======== BUILD TARGETS ========-->
<target name="-build-modular" <target name="-build-modular-lib" unless="executable.jar"
depends="compile,increment-build-number,resources"> depends="compile,increment-build-number,resources">
<jar destfile="${build.dir}/${name}-${version}.${build.number}.jar" <jar destfile="${build.dir}/${name}-${version}.${build.number}.jar"
basedir="${build.dir}/main/classes"/> basedir="${build.dir}/main/classes"/>
</target> </target>
<target name="-build-modular-executable" if="executable.jar"
depends="compile,increment-build-number,resources">
<pathconvert property="jar.classpath" pathsep=" " refid="runtime-libs">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper />
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
</pathconvert>
<jar destfile="${build.dir}/${name}-${version}.${build.number}.jar"
basedir="${build.dir}/main/classes">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
<attribute name="SplashScreen-Image" value="${splash.image}"/>
</manifest>
</jar>
</target>
<target name="-build-modular"
depends="-build-modular-lib,-build-modular-executable"/>
<target name="-build-packed-libs" <target name="-build-packed-libs"
depends="compile,increment-build-number,resources"> depends="compile,increment-build-number,resources">

View File

@ -1,7 +1,7 @@
#Wed, 15 Jun 2011 09:48:23 -0500 #Tue, 27 Aug 2013 19:02:29 -0500
lib.local=true lib.local=true
name=gritter name=gritter
version=1.0 version=1.0
build.number=1 build.number=2
linux.nailgun.classpath.dir=/home/jdbernard/programs/nailgun/classpath linux.nailgun.classpath.dir=/home/jdbernard/programs/nailgun/classpath
nailgun.classpath.dir=C\:/Documents and Settings/jbernard/My Documents/ng-classpath nailgun.classpath.dir=C\:/Documents and Settings/jbernard/My Documents/ng-classpath