git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113198 13f79535-47bb-0310-9956-ffa450edef68
48 lines
1.8 KiB
XML
48 lines
1.8 KiB
XML
<?xml version="1.0"?>
|
|
<project xmlns:j="jelly:core" xmlns:util="jelly:util">
|
|
<!--==================================================================-->
|
|
<!-- Compile all source code -->
|
|
<!--==================================================================-->
|
|
<goal name="native" description="NAtive compiler" prereqs="native:compile"/>
|
|
|
|
<goal name="native:compile" description="Compile the native compiler">
|
|
<echo>a</echo>
|
|
<taskdef name="cc" classname="net.sf.antcontrib.cpptasks.CCTask"/>
|
|
<typedef name="linker" classname="net.sf.antcontrib.cpptasks.LinkerDef"/>
|
|
<typedef name="compiler" classname="net.sf.antcontrib.cpptasks.CompilerDef"/>
|
|
<echo>b</echo>
|
|
<compiler id="gcc" name="gcc" if="use-gcc">
|
|
<compilerarg value="-O" unless="is-debug"/>
|
|
</compiler>
|
|
</goal>
|
|
|
|
<goal name="native:jniheader" description="make jniheaders for classes" prereqs="java:compile">
|
|
<fileScanner var="classFiles">
|
|
<fileset dir="${maven.build.dest}">
|
|
<patternset>
|
|
<include name="**/*.class"/>
|
|
</patternset>
|
|
</fileset>
|
|
</fileScanner>
|
|
<mkdir dir="${maven.build.dir}/jni"/>
|
|
<javah destdir="${maven.build.dir}/jni">
|
|
<classpath>
|
|
<pathelement location="${maven.build.dest}"/>
|
|
</classpath>
|
|
<j:useBean var="javaSourceTool" class="org.apache.maven.natives.util.JavaSourceTool"/>
|
|
<j:forEach var="file" items="${classFiles.iterator()}">
|
|
<j:set var="isNative" value="false"/>
|
|
<j:set var="clazz" value="${javaSourceTool.getBcelClass(file.toString())}"/>
|
|
<j:forEach var="method" items="${clazz.getMethods()}">
|
|
<j:if test="${method.isNative() == 'true'}">
|
|
<j:set var="isNative" value="true"/>
|
|
</j:if>
|
|
</j:forEach>
|
|
<j:if test="${isNative == 'true'}">
|
|
<class name="${clazz.className}"/>
|
|
</j:if>
|
|
</j:forEach>
|
|
</javah>
|
|
</goal>
|
|
</project>
|