brett       2004/04/24 19:34:08

  Modified:    native   plugin.jelly project.xml
               native/samples/helloworld maven.xml
               native/xdocs changes.xml goals.xml index.xml navigation.xml
                        properties.xml
  Added:       native   plugin.properties
  Log:
  PR: MPNATIVE-3
  more configurable
  
  Revision  Changes    Path
  1.8       +29 -24    maven-plugins/native/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/plugin.jelly,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- plugin.jelly      15 Apr 2004 06:15:43 -0000      1.7
  +++ plugin.jelly      25 Apr 2004 02:34:08 -0000      1.8
  @@ -43,12 +43,17 @@
          <ant:available property="jniFilesPresent" 
file="${maven.build.dir}/native/jni"/>
           
          <!-- for some reason '.' aren't allow as parameter for outfile-->
  -       <cc outfile="${maven.build.dir}/native/_" link="shared" debug="true">
  -         <compiler name="gcc"/>
  -         <fileset dir="src/unix"/>
  +       <cc outfile="${maven.build.dir}/native/_" link="${maven.native.link}" 
debug="${maven.native.debug}">
  +         <compiler name="${maven.native.compiler.name}">
  +           <compilerparam name="target" value="${maven.native.compiler.target}"/>
  +          </compiler>
  +         <linker name="${maven.native.linker.name}">     
  +           <linkerparam name="target" value="${maven.native.linker.target}"/>
  +         </linker>
  +         <fileset dir="${maven.native.src}" />
            <j:if test="${jniFilesPresent == 'true'}">
               <includepath location="${java.home}/../include"/>
  -            <includepath location="${java.home}/../include/linux"/>
  +            <includepath 
location="${java.home}/../include/${maven.native.include.os}"/>
               <includepath location="${maven.build.dir}/native/jni"/>
            </j:if>   
          </cc>
  @@ -109,7 +114,7 @@
           <ant:echo>Running Javah on java classes</ant:echo>
           <mkdir dir="${maven.build.dir}/native/jni"/>
   
  -<!-- need ANT 1.6
  +<!--  need ANT 1.6
   
           <javah destdir="${maven.build.dir}/native/jni">
             <classpath>
  @@ -129,25 +134,25 @@
             </j:forEach>
           </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>
  +        <!--  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>
  
  
  
  1.15      +5 -1      maven-plugins/native/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/project.xml,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- project.xml       29 Mar 2004 08:43:20 -0000      1.14
  +++ project.xml       25 Apr 2004 02:34:08 -0000      1.15
  @@ -52,7 +52,11 @@
         </roles>
       </developer>
     </developers>
  -  <contributors/>
  +  <contributors>
  +    <contributor>
  +      <name>Joachim Bader</name>
  +    </contributor>
  +  </contributors>
     <dependencies>
       <dependency>
         <groupId>ant-contrib</groupId>
  
  
  
  1.1                  maven-plugins/native/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  maven.native.link=shared
  maven.native.include.os=linux
  maven.native.debug=true
  maven.native.src=src/unix
  
  maven.native.compiler.name=gcc
  maven.native.linker.name=${maven.native.compiler.name}
  maven.native.compiler.target=
  maven.native.linker.target=${maven.native.compiler.target}
  
  
  
  
  1.6       +0 -5      maven-plugins/native/samples/helloworld/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/samples/helloworld/maven.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- maven.xml 4 Mar 2004 18:37:53 -0000       1.5
  +++ maven.xml 25 Apr 2004 02:34:08 -0000      1.6
  @@ -20,11 +20,6 @@
     xmlns:ant="jelly:ant">
   
     <goal name="runsample" description="run sample" prereqs="native:compile">
  -     <mkdir dir="${maven.build.dir}/samples"/>
  -       <javac srcdir="${basedir}/src/sample/java"
  -         destdir="${maven.build.dir}/samples"
  -         fork="true"
  -     />
       <java classname="org.apache.maven.natives.sample.helloworld.HelloWorld" 
fork="yes">
        <sysproperty key="java.library.path" value="${maven.build.dir}/native"/> 
          <classpath>
  
  
  
  1.2       +1 -0      maven-plugins/native/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/xdocs/changes.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- changes.xml       15 Apr 2004 06:15:43 -0000      1.1
  +++ changes.xml       25 Apr 2004 02:34:08 -0000      1.2
  @@ -25,6 +25,7 @@
     </properties>
     <body>
       <release version="1.1-SNAPSHOT" date="in CVS">
  +      <action dev="brett" type="fix" issue="MPNATIVE-3" due-to="Joachim Bader">Use 
properties more</action>
         <action dev="brett" type="fix" issue="MPNATIVE-1" due-to="Joachim Bader">Help 
javah work on all JDK features</action>
       </release>
     </body>
  
  
  
  1.3       +8 -0      maven-plugins/native/xdocs/goals.xml
  
  Index: goals.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/xdocs/goals.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- goals.xml 4 Mar 2004 18:37:54 -0000       1.2
  +++ goals.xml 25 Apr 2004 02:34:08 -0000      1.3
  @@ -26,9 +26,17 @@
     <body>
       <goals>
         <goal>
  +        <name>native:compile</name>
  +        <description>Compile the native sources</description>
  +      </goal>        
  +      <goal>
           <name>native:jniheader</name>
           <description>Generates JNI header files</description>
         </goal>
  +      <goal>
  +        <name>native:install</name>
  +        <description>Install the lib in the local repository</description>
  +      </goal>          
       </goals>
     </body>
   </document>
  
  
  
  1.3       +0 -3      maven-plugins/native/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/xdocs/index.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.xml 4 Mar 2004 18:37:54 -0000       1.2
  +++ index.xml 25 Apr 2004 02:34:08 -0000      1.3
  @@ -31,9 +31,6 @@
           different compilers such as gcc, msvc, bcc, ...
          
         </p>
  -      <p>
  -        Currently, this plugin only supports generation of jni header files.
  -      </p>
       </section>
       <section name="News">
         <table>
  
  
  
  1.3       +1 -0      maven-plugins/native/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/xdocs/navigation.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- navigation.xml    4 Mar 2004 18:37:54 -0000       1.2
  +++ navigation.xml    25 Apr 2004 02:34:08 -0000      1.3
  @@ -24,6 +24,7 @@
     <body>
       <links>
         <item name="Maven" href="http://maven.apache.org/"/>
  +       <item name="ant-contrib" href="http://ant-contrib.sourceforge.net/"/>
       </links>
       <menu name="Overview">
         <item href="/index.html" name="Overview"/>
  
  
  
  1.3       +57 -0     maven-plugins/native/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/native/xdocs/properties.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- properties.xml    4 Mar 2004 18:37:54 -0000       1.2
  +++ properties.xml    25 Apr 2004 02:34:08 -0000      1.3
  @@ -39,6 +39,63 @@
                 <code>${maven.build.dir}/jni</code>.</p>
             </td>
           </tr>
  +             
  +        <tr>
  +          <td>maven.native.src</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>Directory for native source files. 
  +                       Default value is <code>src/unix</code>.
  +                  </p>
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.native.link</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>Sets the output file type. Supported values "executable", 
  +                       "shared", and "static".
  +                       Default value is <code>shared</code>.
  +                  </p>
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.native.compiler.name</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>Sets compiler type.
  +                       Default value is <code>gcc</code>.
  +                  </p>
  +          </td>
  +        </tr>                
  +        <tr>
  +          <td>maven.native.linker.name</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>Sets linker type.
  +                       Default value is <code>${maven.native.compiler.name}</code>.
  +                  </p>
  +          </td>
  +        </tr>                                
  +        <tr>
  +          <td>maven.native.debug</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>If set true, all targets will be built for debugging.
  +                       Default value is <code>true</code>.
  +                  </p>
  +          </td>
  +        </tr>                                
  +        <tr>
  +          <td>maven.native.include.os</td>
  +          <td>Yes</td>
  +          <td>
  +            <p>JDK directory for plattform depended include files.
  +                       Default value is <code>linux</code>.
  +                  </p>
  +          </td>
  +        </tr>                                
  +             
         </table>
       </section>
     </body>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to