diff --git a/labcomm-compiler-plugin/.gitignore b/labcomm-compiler-plugin/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..2f7896d1d1365eafb0da03d9fe456fac81408487 --- /dev/null +++ b/labcomm-compiler-plugin/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/labcomm-compiler-plugin/pom.xml b/labcomm-compiler-plugin/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..53cf683cba17a36cfb2e684c805e84087190711c --- /dev/null +++ b/labcomm-compiler-plugin/pom.xml @@ -0,0 +1,67 @@ +<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> diff --git a/labcomm-compiler-plugin/src/main/java/se/lth/control/App.java b/labcomm-compiler-plugin/src/main/java/se/lth/control/App.java new file mode 100644 index 0000000000000000000000000000000000000000..e9a11b5b222d72f2efcf3a1ad5d9d603ada558ea --- /dev/null +++ b/labcomm-compiler-plugin/src/main/java/se/lth/control/App.java @@ -0,0 +1,37 @@ +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); + } +} diff --git a/labcomm-compiler-plugin/src/test/java/se/lth/control/AppTest.java b/labcomm-compiler-plugin/src/test/java/se/lth/control/AppTest.java new file mode 100644 index 0000000000000000000000000000000000000000..9be0f93dd236ba50152bfac9eb46f69aa812ebc9 --- /dev/null +++ b/labcomm-compiler-plugin/src/test/java/se/lth/control/AppTest.java @@ -0,0 +1,38 @@ +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 ); + } +}