Skip to content

Commit

Permalink
antrun exec - failonerror
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdickmeiss committed Jan 2, 2021
1 parent 94fce06 commit 0dfb3d9
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
<inherited>false</inherited>
<configuration>
<target>
<echo message="Using CFLAGS: ${yaz.cflags} ${yaz.include}" />
<echo message="Using CFLAGS: ${yaz.cflags} ${yaz.include}" />
<mkdir dir="target/generated-sources/java/org/yaz4j/jni" />
<mkdir dir="target/generated-sources/native" />
<mkdir dir="${native.dir}" />
<exec executable="${swig}">
<exec failonerror="true" executable="${swig}">
<arg value="-Isrc/main/native" />
<arg value="${yaz.cflags}" />
<arg value="-I${yaz.include}" />
Expand All @@ -142,7 +142,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.1</version>
<configuration>
<forkMode>once</forkMode>
<argLine>"-Djava.library.path=${native.dir}"</argLine>
Expand Down Expand Up @@ -245,23 +245,19 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>write-swig-include</id>
<id>write-yaz-properties</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<exec executable="${yaz.config}" outputproperty="yaz.cflags" errorproperty="yaz-config.error">
<exec failonerror="true" executable="${yaz.config}" outputproperty="yaz.cflags">
<arg value="--cflags" />
</exec>
<echo message="yaz-config error (if any): ${yaz-config.error}" />
<echo message="YAZ CFLAGS=${yaz.cflags}" />
<exec executable="${yaz.config}" outputproperty="yaz.libs" errorproperty="yaz-config.error">
<exec failonerror="true" executable="${yaz.config}" outputproperty="yaz.libs">
<arg value="--libs" />
</exec>
<echo message="yaz-config error (if any): ${yaz-config.error}" />
<echo message="YAZ LIBS=${yaz.libs}" />
<mkdir dir="${basedir}/target" />
<propertyfile file="${basedir}/target/yaz.properties" comment="YAZ COMPILER/LINKER FLAGS">
<entry key="yaz.cflags" value="${yaz.cflags}" />
Expand All @@ -278,7 +274,7 @@
</goals>
<configuration>
<target>
<exec executable="${compiler}">
<exec failonerror="true" executable="${compiler}">
<arg value="-fPIC"/>
<arg line="${compiler.flags}"/>
<arg value="-Wno-deprecated-declarations" />
Expand All @@ -291,7 +287,7 @@
<arg value="-o"/>
<arg value="${basedir}/target/zoom-extra.o" />
</exec>
<exec executable="${compiler}">
<exec failonerror="true" executable="${compiler}">
<arg value="-fPIC"/>
<arg line="${compiler.flags}"/>
<arg value="-Wno-deprecated-declarations" />
Expand All @@ -304,7 +300,7 @@
<arg value="-o"/>
<arg value="${basedir}/target/libyaz4j.o" />
</exec>
<exec executable="${compiler}">
<exec failonerror="true" executable="${compiler}">
<arg value="-shared"/>
<arg line="${compiler.flags}"/>
<arg value="-o" />
Expand All @@ -324,7 +320,7 @@
<version>1.0.0</version>
<executions>
<execution>
<id>read-yaz-config</id>
<id>read-yaz-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
Expand All @@ -349,12 +345,17 @@
</os>
</activation>
<properties>
<!-- SWIG file name - just "swig" if it's in the PATH -->
<swig>swig</swig>
<native.file>yaz4j.dll</native.file>
<yaz.path>c:\Program Files\YAZ</yaz.path>
<yaz.lib>${yaz.path}\lib\yaz5.lib</yaz.lib>
<yaz.include>${yaz.path}\include</yaz.include>
<yaz.cflags></yaz.cflags>
<!-- resulting DLL - bad idea to change this -->
<native.file>yaz4j.dll</native.file>
<yaz.path>c:\Program Files\YAZ</yaz.path>
<!-- import library -->
<yaz.lib>${yaz.path}\lib\yaz5.lib</yaz.lib>
<!-- include directory for YAZ -->
<yaz.include>${yaz.path}\include</yaz.include>
<!-- yaz.cflags: also passed to swig. Only -Defines and -Includes -->
<yaz.cflags></yaz.cflags>
</properties>
<build>
<plugins>
Expand All @@ -369,27 +370,27 @@
</goals>
<configuration>
<target>
<exec executable="cl">
<exec failonerror="true" executable="cl">
<arg value="-I${java.home}/include" />
<arg value="-I${java.home}/include/win32" />
<arg value="-I${basedir}/src/main/native" />
<arg value="-I${yaz.include}" />
<arg value="/Fo${basedir}/target/zoom-extra.obj" />
<arg value="-I${yaz.include}" />
<arg value="/Fo${basedir}/target/zoom-extra.obj" />
<arg value="-c" />
<arg value="${basedir}/src/main/native/zoom-extra.cpp" />
</exec>
<exec executable="cl">
<exec failonerror="true" executable="cl">
<arg value="-I${java.home}/include" />
<arg value="-I${java.home}/include/win32" />
<arg value="-I${basedir}/src/main/native" />
<arg value="-I${yaz.include}" />
<arg value="/Fo${basedir}/target/libyaz4j.obj" />
<arg value="-I${yaz.include}" />
<arg value="/Fo${basedir}/target/libyaz4j.obj" />
<arg value="-c" />
<arg value="${basedir}/target/generated-sources/native/libyaz4j.cpp" />
</exec>
<exec executable="link">
<arg value="/dll"/>
<arg value="/out:${native.dir}/${native.file}"/>
<exec failonerror="true" executable="link">
<arg value="/dll"/>
<arg value="/out:${native.dir}/${native.file}"/>
<arg value="${basedir}/target/libyaz4j.obj"/>
<arg value="${basedir}/target/zoom-extra.obj"/>
<arg value="${yaz.lib}" />
Expand Down

0 comments on commit 0dfb3d9

Please sign in to comment.