From e28417b83d56c351810b9aa48b4beaea7aad236c Mon Sep 17 00:00:00 2001 From: knielsen Date: Wed, 26 Mar 2003 19:32:13 +0000 Subject: [PATCH] Initial checking of the Native compilation plugin git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113198 13f79535-47bb-0310-9956-ffa450edef68 --- native/.cvsignore | 6 ++ native/LICENSE.txt | 57 ++++++++++++ native/plugin.jelly | 47 ++++++++++ native/project.properties | 7 ++ native/project.xml | 56 ++++++++++++ .../maven/natives/util/JavaSourceTool.java | 89 +++++++++++++++++++ native/xdocs/.cvsignore | 1 + native/xdocs/goals.xml | 16 ++++ native/xdocs/index.xml | 36 ++++++++ native/xdocs/navigation.xml | 17 ++++ native/xdocs/properties.xml | 27 ++++++ native/xdocs/tasks.xml | 23 +++++ 12 files changed, 382 insertions(+) create mode 100644 native/.cvsignore create mode 100644 native/LICENSE.txt create mode 100644 native/plugin.jelly create mode 100644 native/project.properties create mode 100644 native/project.xml create mode 100644 native/src/main/org/apache/maven/natives/util/JavaSourceTool.java create mode 100644 native/xdocs/.cvsignore create mode 100644 native/xdocs/goals.xml create mode 100644 native/xdocs/index.xml create mode 100644 native/xdocs/navigation.xml create mode 100644 native/xdocs/properties.xml create mode 100644 native/xdocs/tasks.xml diff --git a/native/.cvsignore b/native/.cvsignore new file mode 100644 index 00000000..f7c90c3b --- /dev/null +++ b/native/.cvsignore @@ -0,0 +1,6 @@ +target +maven.log +velocity.log +build.properties +.classpath +.project diff --git a/native/LICENSE.txt b/native/LICENSE.txt new file mode 100644 index 00000000..5a4aec31 --- /dev/null +++ b/native/LICENSE.txt @@ -0,0 +1,57 @@ + + +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache Maven" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache Maven", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * ==================================================================== + */ diff --git a/native/plugin.jelly b/native/plugin.jelly new file mode 100644 index 00000000..dd3d7ac5 --- /dev/null +++ b/native/plugin.jelly @@ -0,0 +1,47 @@ + + + + + + + + + a + + + + b + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/native/project.properties b/native/project.properties new file mode 100644 index 00000000..24787b8b --- /dev/null +++ b/native/project.properties @@ -0,0 +1,7 @@ +# ------------------------------------------------------------------- +# P R O J E C T P R O P E R T I E S +# ------------------------------------------------------------------- +maven.xdoc.date=left +maven.xdoc.version=${pom.currentVersion} +maven.checkstyle.format = turbine +maven.license.licenseFile=${basedir}/../../../LICENSE.txt \ No newline at end of file diff --git a/native/project.xml b/native/project.xml new file mode 100644 index 00000000..01ffbb54 --- /dev/null +++ b/native/project.xml @@ -0,0 +1,56 @@ + + + + ${basedir}/../project.xml + 3 + maven-native-plugin + Maven Native Plug-in + 1.0 + Plugin for native compilation c,c++, fortran + Native plugin + http://maven.apache.org/reference/plugins/native/ + + /www/maven.apache.org/reference/plugins/native/ + + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven/src/plugins-build/native/ + http://cvs.apache.org/viewcvs/maven/src/plugins-build/native/ + + + + + + + Kasper Nielsen + knielsen + apache@kav.dk + it.edu + + Architect + + + + + + + + + + + ant-contrib:cpptasks + 20030309.134440 + + root + + + + + bcel + 5.0 + + root + + + + + diff --git a/native/src/main/org/apache/maven/natives/util/JavaSourceTool.java b/native/src/main/org/apache/maven/natives/util/JavaSourceTool.java new file mode 100644 index 00000000..71964c2e --- /dev/null +++ b/native/src/main/org/apache/maven/natives/util/JavaSourceTool.java @@ -0,0 +1,89 @@ +package org.apache.maven.natives.util; + +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache Maven" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache Maven", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + * + * ==================================================================== + */ + +import java.io.IOException; + +import org.apache.bcel.classfile.ClassParser; +import org.apache.bcel.classfile.JavaClass; + +/** + * @author Kasper Nielsen + * + */ +public class JavaSourceTool { + + + /** + * Parses the java class file and returns an isntance of a Bcel Class + * + * @param absoluteFileName the absolute file name to transform + * @return the Bcel Class. + * @throws IOException upon failure to read the java file + */ + public static final JavaClass getBcelClass(String absoluteFileName) throws IOException { + try { + ClassParser parser = new ClassParser(absoluteFileName); + JavaClass clazz= parser.parse(); + return clazz; + + } catch (Exception e) { + System.out.println("\nError parsing " + absoluteFileName + ": " + e + "\n"); + return null; + } + } +} diff --git a/native/xdocs/.cvsignore b/native/xdocs/.cvsignore new file mode 100644 index 00000000..cb6131bb --- /dev/null +++ b/native/xdocs/.cvsignore @@ -0,0 +1 @@ +stylesheets diff --git a/native/xdocs/goals.xml b/native/xdocs/goals.xml new file mode 100644 index 00000000..db8cfccf --- /dev/null +++ b/native/xdocs/goals.xml @@ -0,0 +1,16 @@ + + + + + Maven Native Plug-in Goals + Kasper Nielsen + + + + + native:jniheader + Generates JNI header files + + + + \ No newline at end of file diff --git a/native/xdocs/index.xml b/native/xdocs/index.xml new file mode 100644 index 00000000..995b1a4e --- /dev/null +++ b/native/xdocs/index.xml @@ -0,0 +1,36 @@ + + + + + Maven Native Plug-in + Kasper Nielsen + + + +
+

+ This is a plugin that allows to compile c,c++,fortran code under maven with + different compilers such as gcc, msvc, bcc, ... + +

+

+ Currently, this plugin only supports generation of jni header files. +

+
+
+ + + + + + + + + +
DateDescription
26 Mar 2003 + Project Created +
+
+ + +
diff --git a/native/xdocs/navigation.xml b/native/xdocs/navigation.xml new file mode 100644 index 00000000..d2715659 --- /dev/null +++ b/native/xdocs/navigation.xml @@ -0,0 +1,17 @@ + + + + Maven Native Plugin + + + + + + + + + + + + + diff --git a/native/xdocs/properties.xml b/native/xdocs/properties.xml new file mode 100644 index 00000000..1e725b54 --- /dev/null +++ b/native/xdocs/properties.xml @@ -0,0 +1,27 @@ + + + + + Maven Native Plugin Properties + Kasper Nielsen + + +
+ + + + + + + + + + + +
PropertyOptional?Description
maven.jni.destYes +

Default value is + ${maven.build.dir}/jni.

+
+
+ +
\ No newline at end of file diff --git a/native/xdocs/tasks.xml b/native/xdocs/tasks.xml new file mode 100644 index 00000000..bbe732b3 --- /dev/null +++ b/native/xdocs/tasks.xml @@ -0,0 +1,23 @@ + + + + + Tasks + Kasper Nielsen + + + +
+

+ Lists of todos and ideas for future versions. +

+ + +

+

+
+ +
+ + +