Fix build of JNI sources.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 22 Sep 2009 09:07:19 +0000 (11:07 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 22 Sep 2009 09:07:19 +0000 (11:07 +0200)
Fix build of JNI sources. Use the generate-sources phase.

libyaz4j/Makefile
pom.xml

index d151414..ebbdb9c 100644 (file)
@@ -6,6 +6,10 @@ YAZ_LIBS=`${YAZ_CONFIG} --libs`
 
 all: lib/libyaz4j.so
 
+.PHONY: generate-sources
+
+generate-sources: src/libyaz4j.cpp
+
 src/libyaz4j.cpp: libyaz4j.i
        swig -I"include" -I"$(YAZ_PREFIX)/include" -outdir ../src/main/java/org/yaz4j/jni -package org.yaz4j.jni -o src/libyaz4j.cpp -c++ -java libyaz4j.i
 
diff --git a/pom.xml b/pom.xml
index 92a7226..195d321 100644 (file)
--- a/pom.xml
+++ b/pom.xml
              <artifactId>maven-antrun-plugin</artifactId>
              <executions>
                <execution>
+                 <id>native-sources</id>
+                 <phase>generate-sources</phase>
+                 <goals>
+                   <goal>run</goal>
+                 </goals>
+                 <configuration>
+                   <tasks>
+                     <exec dir="libyaz4j" executable="make" failonerror="true">
+                       <arg value="generate-sources"/>
+                     </exec>
+                   </tasks>
+                 </configuration>
+               </execution>
+
+               <execution>
                  <id>build-native</id>
                  <phase>compile</phase>
                  <goals>