Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding build.xml support so that dist jar contains the commit id in m…

…eta-data
  • Loading branch information...
commit 53a1d635d53874e21b9744789dead480b4caac2c 1 parent 3481984
@xiaoyang xiaoyang authored
Showing with 35 additions and 2 deletions.
  1. +7 −0 .gitignore
  2. +28 −2 build.xml
View
7 .gitignore
@@ -0,0 +1,7 @@
+build
+dist
+doc
+ivy
+lib
+build-test
+SerialDocSet
View
30 build.xml
@@ -123,8 +123,34 @@
</target>
<echo>"jar destfile is : ${dist}/${project.name}-${version}.jar"</echo>
- <target name="jar" depends="compile">
- <jar destfile="${dist}/${project.name}-${version}.jar" basedir="${build}" />
+ <target name="gitversion" description="--> create git version information">
+ <exec executable="git" outputproperty="gitversion">
+ <arg value="log" />
+ <arg value="-1" />
+ <arg value="--pretty=oneline" />
+ </exec>
+ <exec executable="git" outputproperty="gitusername">
+ <arg value="config" />
+ <arg value="--get" />
+ <arg value="user.name" />
+ </exec>
+ <exec executable="git" outputproperty="gituseremail">
+ <arg value="config" />
+ <arg value="--get" />
+ <arg value="user.email" />
+ </exec>
+ </target>
+ <target name="jar" depends="compile,gitversion">
+ <tstamp>
+ <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
+ </tstamp>
+ <manifest file="MANIFEST.MF">
+ <attribute name="Built-By" value="${gitusername} ${gituseremail}" />
+ <attribute name="Git-Version" value="${gitversion}" />
+ <attribute name="Built-Date" value="${TODAY}" />
+ </manifest>
+ <jar destfile="${dist}/${project.name}-${version}.jar" manifest="MANIFEST.MF" basedir="${build}" />
+ <delete file="MANIFEST.MF"/>
</target>
<target name="javadoc" depends="init">
<javadoc packagenames="com.kamikaze.*" sourcepath="src" defaultexcludes="yes" destdir="${doc}" author="true" version="true" use="true" windowtitle="Kamikaze">
Please sign in to comment.
Something went wrong with that request. Please try again.