Initial version.
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| .*.sw* | ||||
							
								
								
									
										117
									
								
								jdb-build-1.0.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								jdb-build-1.0.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,117 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <project name="Jonathan Bernard Build Common"> | ||||
|  | ||||
|     <property environment="env"/> | ||||
|  | ||||
|     <!--======== PATHS ========--> | ||||
|     <path id="groovy.classpath"> | ||||
|         <fileset dir="${env.GROOVY_HOME}/lib"> | ||||
|             <include name="*.jar"/> | ||||
|         </fileset> | ||||
|     </path> | ||||
|  | ||||
|     <path id="groovy.embeddable"> | ||||
|         <fileset dir="${env.GROOVY_HOME}/embeddable"> | ||||
|             <include name="*.jar"/> | ||||
|         </fileset> | ||||
|     </path> | ||||
|  | ||||
|     <path id="compile-libs"> | ||||
|         <fileset dir="${build.dir}/lib/compile/jar"> | ||||
|             <include name="*.jar"/> | ||||
|         </fileset> | ||||
|     </path> | ||||
|  | ||||
|     <path id="runtime-libs"> | ||||
|         <fileset dir="${build.dir}/lib/runtime/jar"> | ||||
|             <include name="*.jar"/> | ||||
|         </fileset> | ||||
|     </path> | ||||
|  | ||||
|     <!--======== INIT TARGETS ========--> | ||||
|     <target name="-init" depends="-common-init,init"/> | ||||
|  | ||||
|     <target name="-common-init"> | ||||
|         <property name="versioning.file" value="project.properties"/> | ||||
|     </target> | ||||
|  | ||||
|     <target name="-init-groovy"> | ||||
|         <taskef name="groovyc" classpathref="groovy.classpath" | ||||
|             classname="org.codehaus.groovy.ant.Groovyc"/> | ||||
|     </target> | ||||
|  | ||||
|     <target name="clean"> | ||||
|         <delete dir="${build.dir}"/> | ||||
|     </target> | ||||
|  | ||||
|     <!--======== LIBRARY TARGETS ========--> | ||||
|     <target name="lib" depends="-lib-local,-lib-ivy"/> | ||||
|  | ||||
|     <target name="-lib-ivy" unless="${lib.local}"/> | ||||
|  | ||||
|     <target name="-lib-local" if="${lib.local}"> | ||||
|         <copy todir="${build.dir}/lib/compile/jar"> | ||||
|             <fileset dir="${lib.dir}/compile"/> | ||||
|         </copy> | ||||
|  | ||||
|         <copy todir="${build.dir}/lib/runtime/jar"> | ||||
|             <fileset dir="${lib.dir}/runtime"/> | ||||
|         </copy> | ||||
|     </target> | ||||
|  | ||||
|     <!--======== VERSIONING TARGETS ========--> | ||||
|     <target name="increment-build-number"> | ||||
|         <propertyfile file="${versioning.file}"> | ||||
|             <entry key="build.number" default="0" type="int" value="1" | ||||
|                 operation="+"/> | ||||
|         </propertyfile> | ||||
|     </target> | ||||
|  | ||||
|     <target name="set-version"> | ||||
|         <input | ||||
|             message="The current version is ${version}. Enter a new version: " | ||||
|             addproperty="new-version"/> | ||||
|         <propertyfile file="${versioning.file}"> | ||||
|             <entry key="version" value="${new-version}" operation="=" | ||||
|                 type="string"/> | ||||
|         </propertyfile> | ||||
|     </target> | ||||
|  | ||||
|     <!--======== COMPILATION TARGETS ========--> | ||||
|     <target name="-compile-groovy" depends="init,-init-groovy,lib"> | ||||
|         <groovyc srcdir="${src.dir}" destdir="${build.dir}/classes" | ||||
|             includeAntRuntime="false"> | ||||
|  | ||||
|             <classpath> | ||||
|                 <path refid="groovy.classpath"/> | ||||
|                 <path refid="compile-libs"/> | ||||
|             </classpath> | ||||
|             <javac/> | ||||
|         </groovyc> | ||||
|     </target> | ||||
|  | ||||
|     <target name="-compile-java" depends="init,lib"> | ||||
|         <javac srcdir="${src.dir}" destdir="${build.dir}/classes" | ||||
|             includeAntRuntime="false" classpathref="compile-libs"/> | ||||
|     </target> | ||||
|  | ||||
|     <target name="compile" depends="-compile-groovy"/> | ||||
|  | ||||
|     <!--======== BUILD TARGETS ========--> | ||||
|     <target name="-build-modular" depends="compile,increment-build-number"> | ||||
|         <jar destfile="${build.dir}/${name}-${version}.${build.number}.jar" | ||||
|             basedir="${build.dir}/classes"/> | ||||
|     </target> | ||||
|  | ||||
|     <target name="-build-packed-libs" depends="compile,increment-build-number"> | ||||
|         <unjar destdir="${build.dir}/classes"> | ||||
|             <fileset dir="${build.dir}/lib/runtime/jar"/> | ||||
|         </unjar> | ||||
|  | ||||
|         <jar destfile="${build.dir}/${name}-${version}.${build.number}.jar" | ||||
|             basedir="${build.dir}/classes"/> | ||||
|     </target> | ||||
|  | ||||
|     <target name="build" depends="-build-modular"/> | ||||
|  | ||||
| </project> | ||||
		Reference in New Issue
	
	Block a user