Commit 8c3bf614 authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Added a simple plugin for using the compiler in a maven build.

parent 837dc0b9
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>se.lth.control</groupId>
<artifactId>labcomm-compiler-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>2014.3.0-SNAPSHOT</version>
<name>Labcomm Compiler Maven Plugin</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>se.lth.control</groupId>
<artifactId>labcomm_compiler</artifactId>
<version>2014.3.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>CSLTH</id>
<name>CS LTH maven repo</name>
<url>http://maven.cs.lth.se/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>CS LTH snapshots maven repo</name>
<url>http://maven.cs.lth.se/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>releases</id>
<name>CS LTH release maven repo</name>
<url>http://maven.cs.lth.se/content/repositories/releases</url>
</repository>
</distributionManagement>
</project>
package se.lth.control;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import se.lth.control.labcomm2014.compiler.LabComm;
/**
* @goal genjava
*/
//@Mojo(name = "genjava")
public class App extends AbstractMojo {
/**
* @parameter default-value="notafile.lc"
*/
private String lc;
/**
* @parameter default-value="/tmp"
*/
private String dir;
/**
* @parameter default-value="generated_sources"
*/
private String pkg;
public void execute() throws MojoExecutionException {
getLog().info("Does not do anything!");
String[] args = new String[3];
args[0] = "--java=" + dir;
args[1] = "--javapackage=" + pkg;
args[2] = lc;
LabComm.main(args);
}
}
package se.lth.control;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment