brett 2004/04/14 23:15:43
Modified: native plugin.jelly
Added: native/xdocs changes.xml
Log:
PR: MPNATIVE-1
fix javah usage
Revision Changes Path
1.7 +25 -1 maven-plugins/native/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/native/plugin.jelly,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- plugin.jelly 4 Mar 2004 18:37:53 -0000 1.6
+++ plugin.jelly 15 Apr 2004 06:15:43 -0000 1.7
@@ -108,6 +108,9 @@
<j:if test="${compileJNI == 'true'}">
<ant:echo>Running Javah on java classes</ant:echo>
<mkdir dir="${maven.build.dir}/native/jni"/>
+
+<!-- need ANT 1.6
+
<javah destdir="${maven.build.dir}/native/jni">
<classpath>
<pathelement location="${maven.build.dest}"/>
@@ -124,7 +127,28 @@
<class name="${clazz.className}"/>
</j:if>
</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>
</goal>
</project>
1.1 maven-plugins/native/xdocs/changes.xml
Index: changes.xml
===================================================================
<?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="[EMAIL PROTECTED]">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>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]