PR: MPNATIVE-1

fix javah usage


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
brett 2004-04-15 06:15:43 +00:00
parent 4a3ce72dd8
commit 47996d66c3
2 changed files with 56 additions and 1 deletions

View File

@ -108,6 +108,9 @@
<j:if test="${compileJNI == 'true'}"> <j:if test="${compileJNI == 'true'}">
<ant:echo>Running Javah on java classes</ant:echo> <ant:echo>Running Javah on java classes</ant:echo>
<mkdir dir="${maven.build.dir}/native/jni"/> <mkdir dir="${maven.build.dir}/native/jni"/>
<!-- need ANT 1.6
<javah destdir="${maven.build.dir}/native/jni"> <javah destdir="${maven.build.dir}/native/jni">
<classpath> <classpath>
<pathelement location="${maven.build.dest}"/> <pathelement location="${maven.build.dest}"/>
@ -124,7 +127,28 @@
<class name="${clazz.className}"/> <class name="${clazz.className}"/>
</j:if> </j:if>
</j:forEach> </j:forEach>
</javah> </javah> -->
<!-- workaround -->
<property environment="env"/>
<exec executable="${env.JAVA_HOME}/bin/javah">
<arg line="-d ${maven.build.dir}/native/jni"/>
<arg line="-classpath ${maven.build.dest}"/>
<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'}">
<arg value="${clazz.className}"/>
</j:if>
</j:forEach>
</exec>
</j:if> </j:if>
</goal> </goal>
</project> </project>

31
native/xdocs/changes.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<document>
<properties>
<title>Changes</title>
<author email="brett@apache.org">Brett Porter</author>
</properties>
<body>
<release version="1.1-SNAPSHOT" date="in CVS">
<action dev="brett" type="fix" issue="MPNATIVE-1" due-to="Joachim Bader">Help javah work on all JDK features</action>
</release>
</body>
</document>