Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Initial skeleton for jar2lib-based cppwrap Maven plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed Feb 18, 2011
0 parents commit 4cbffc4
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 0 deletions.
27 changes: 27 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
C++ Wrapper Maven plugin for generating C++ proxy classes for a Java library.

Copyright (c) 2011, UW-Madison LOCI
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of the UW-Madison LOCI nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS 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 COPYRIGHT HOLDERS OR 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.
91 changes: 91 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-v4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>loci</groupId>
<artifactId>loci-base</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<groupId>loci.maven.plugins</groupId>
<artifactId>cppwrap-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

<name>C++ Wrapper Maven Plugin</name>
<description>Maven 2.0 plugin for wrapping a Java library as a C++ project. Produces one C++ proxy class and header per Java class. Operates via the Jar2Lib command line tool.</description>
<url>http://loci.wisc.edu/software/jar2lib</url>
<inceptionYear>2011</inceptionYear>

<licenses>
<license>
<name>BSD</name>
<url>http://dev.loci.wisc.edu/svn/java/trunk/projects/cppwrap-maven-plugin/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>loci</groupId>
<artifactId>jar2lib</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>loci.maven.plugin.cppwrap</mainClass>
<packageName>loci.maven.plugin.cppwrap</packageName>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>

<developers>
<developer>
<id>curtis</id>
<name>Curtis Rueden</name>
<email>ctrueden@wisc.edu</email>
<url>http://loci.wisc.edu/people/curtis-rueden</url>
<organization>UW-Madison LOCI</organization>
<organizationUrl>http://loci.wisc.edu/</organizationUrl>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
<timezone>-6</timezone>
<properties>
<picUrl>http://loci.wisc.edu/files/loci/images/people/curtis-2010.jpg</picUrl>
</properties>
</developer>
</developers>

<!-- NB: for loci-base, in case of partial checkout -->
<repositories>
<repository>
<id>loci.releases</id>
<url>http://dev.loci.wisc.edu/maven2/releases</url>
</repository>
<repository>
<id>loci.snapshots</id>
<url>http://dev.loci.wisc.edu/maven2/snapshots</url>
</repository>
</repositories>

</project>
61 changes: 61 additions & 0 deletions src/main/java/loci/maven/plugin/cppwrap/CppWrapMojo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// CppWrapMojo.java
//

/*
C++ Wrapper Maven plugin for generating C++ proxy classes for a Java library.
Copyright (c) 2011, UW-Madison LOCI
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of the UW-Madison LOCI nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS 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 COPYRIGHT HOLDERS OR 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.
*/

package loci.jar2lib.maven;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;

import java.io.File;
import java.io.IOException;

/**
* Goal which creates a C++ project wrapping a Maven Java project.
*
* @author Curtis Rueden
*
* @goal cppwrap
*/
public class CppWrapMojo extends AbstractMojo {

/**
* TODO
*/
public void execute() throws MojoExecutionException {
getLog().info("Hello, world.");
// TODO throw MojoExecutionException to cause BUILD ERROR message
// TODO throw MojoFailureException to cause BUILD FAILURE message
}

}

0 comments on commit 4cbffc4

Please sign in to comment.