Permalink
Browse files

beginning to use build.xml over Makefile

  • Loading branch information...
1 parent 3acd7e6 commit 6118276a7f83ddcc06719078dee39aae157e80c6 @league committed Aug 11, 2009
Showing with 37 additions and 0 deletions.
  1. +24 −0 build.xml
  2. +13 −0 net/contrapunctus/lzma/Version.template
View
@@ -1,5 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="lzmajio" default="jar" basedir=".">
+
+ <property name="major" value="0" />
+ <property name="minor" value="95" />
+
+ <target name="context">
+ <exec executable="git" outputproperty="context">
+ <arg value="describe" />
+ </exec>
+ </target>
+
+ <target name="version-stamp" depends="context">
+ <filter token="major" value="${major}" />
+ <filter token="minor" value="${minor}" />
+ <filter token="context" value="${context}" />
+ <copy file="net/contrapunctus/lzma/Version.template"
+ tofile="net/contrapunctus/lzma/Version.java"
+ filtering="on"
+ overwrite="true" />
+ </target>
+
<target name="init">
<mkdir dir="build"/>
<mkdir dir="docs"/>
@@ -20,3 +40,7 @@
</javadoc>
</target>
</project>
+<!-- Local variables: -->
+<!-- indent-tabs-mode: t -->
+<!-- tab-width: 2 -->
+<!-- End: -->
@@ -0,0 +1,13 @@
+package net.contrapunctus.lzma;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+public class Version {
+public static final int major = @major@;
+public static final int minor = @minor@;
+public static final String context = "@context@";
+public static void main( String[] args ) {
+ if( args.length > 0 ) System.out.println(context);
+ else System.out.printf("lzmajio-%d.%d%n", major, minor);
+ }
+}

0 comments on commit 6118276

Please sign in to comment.