[jffi-next] 02/24: Build Version.java from pom.xml

Tim Potter tpot-guest at moszumanska.debian.org
Wed Mar 4 04:51:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

tpot-guest pushed a commit to tag 0.6.5
in repository jffi-next.

commit 9bbde43fdd84fcee7590d4cc2a4aaf1ba0fbb18e
Author: Wayne Meissner <wmeissner at gmail.com>
Date:   Tue Oct 20 08:12:32 2009 +1000

    Build Version.java from pom.xml
---
 build.xml        |  1 +
 custom-build.xml | 18 +-----------------
 pom.xml          | 28 ++++++++++++++++++++++++++++
 version.xml      | 19 +++++++++++++++++++
 4 files changed, 49 insertions(+), 17 deletions(-)

diff --git a/build.xml b/build.xml
index 8fc52b6..a63d433 100644
--- a/build.xml
+++ b/build.xml
@@ -95,6 +95,7 @@
     </target>
 
     <import file="custom-build.xml"/>
+    <import file="version.xml"/>
     <target name="-post-init" depends="-init-vars"/>
     <target name="-post-compile" depends="-build-native-library"/>
     <target name="-post-compile-test" depends="-build-native-testlib"/>
diff --git a/custom-build.xml b/custom-build.xml
index 0bdcb8f..b410202 100644
--- a/custom-build.xml
+++ b/custom-build.xml
@@ -8,9 +8,6 @@
         <property name="build.native.dir" location="${build.dir}/jni"/>
         <property name="src.native.dir" location="jni"/>
         <property name="complete.jar" value="${dist.dir}/jffi-complete.jar"/>
-        <property name="jffi.version.major" value="0"/>
-        <property name="jffi.version.minor" value="6"/>
-        <property name="jffi.version.micro" value="2"/>
         <mkdir dir="${build.native.dir}"/>
         
         <!-- normalize the various os.arch naming conventions -->
@@ -66,20 +63,7 @@
           <not><isset property="make.exe"/></not>
         </condition>
     </target>
-    <target name="-generate-version" depends="init,-init-vars">
-        <!-- <delete file="${build.dir}/java/com/kenai/jffi/Version.java" quiet="true"/> -->
-        <echo message="Generating Version.java"/>
-        <mkdir dir="${build.classes.dir}"/>
-        <mkdir dir="${build.dir}/java/com/kenai/jffi"/>
-        <echo file="${build.dir}/java/com/kenai/jffi/Version.java" append="false">
-            package com.kenai.jffi;
-            public final class Version {
-                private Version() {}
-                public static final int MAJOR = ${jffi.version.major};
-                public static final int MINOR = ${jffi.version.minor};
-                public static final int MICRO = ${jffi.version.micro};
-            }
-        </echo>
+    <target name="-generate-version" depends="init,-init-vars,-generate-version-source">
         <javac target="1.5" destdir="${build.classes.dir}" srcdir="${build.dir}/java"/>
     </target>
     <target name="-generate-native-headers" depends="-init-vars,-generate-version,-compile-java">
diff --git a/pom.xml b/pom.xml
index d077c85..64d8a57 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,6 +139,34 @@
         </executions>
       </plugin>
 -->
+    <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.1</version>
+        <executions>
+          <execution>
+            <id>build-native-library</id>
+            <phase>generate-sources</phase>
+            <configuration>
+              <tasks>
+                <property name="os.name" value="${os.name}"/>
+                <property name="os.arch" value="${os.arch}"/>
+                <property name="java.home" value="${java.home}"/>
+                <property name="dist.dir" value="${project.build.directory}"/>
+                <property name="build.dir" value="${project.build.directory}"/>
+                <property name="build.classes.dir" value="${project.build.outputDirectory}"/>
+                <ant antfile="version.xml" dir="." target="-generate-version-source"/>
+              </tasks>
+              <sourceRoot>
+                ${project.build.directory}/java
+              </sourceRoot>
+
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <extensions>
       <extension>
diff --git a/version.xml b/version.xml
new file mode 100644
index 0000000..250e8b8
--- /dev/null
+++ b/version.xml
@@ -0,0 +1,19 @@
+<project name="version" default="default" basedir=".">
+    <property name="jffi.version.major" value="0"/>
+    <property name="jffi.version.minor" value="6"/>
+    <property name="jffi.version.micro" value="2"/>
+    <target name="-generate-version-source" depends="">
+        <echo message="Generating Version.java"/>
+        <mkdir dir="${build.classes.dir}"/>
+        <mkdir dir="${build.dir}/java/com/kenai/jffi"/>
+        <echo file="${build.dir}/java/com/kenai/jffi/Version.java" append="false">
+            package com.kenai.jffi;
+            public final class Version {
+                private Version() {}
+                public static final int MAJOR = ${jffi.version.major};
+                public static final int MINOR = ${jffi.version.minor};
+                public static final int MICRO = ${jffi.version.micro};
+            }
+        </echo>
+    </target>
+</project>
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jffi-next.git



More information about the pkg-java-commits mailing list