Commits

Stephen McKamey committed 0b46382

- adding placeholder for duel-maven-plugin

  • Participants
  • Parent commits b891b53

Comments (0)

Files changed (7)

 relre:duel/duel-runtime/target/*
 relre:duel/duel-compiler/target/*
 relre:duel/duel-js/target/*
+relre:duel/duel-maven-plugin/target/*
 relre:duel/target/*

duel/duel-compiler/pom.xml

 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
+	<parent>
+		<artifactId>duel</artifactId>
+		<groupId>org.duelengine.duel</groupId>
+		<version>1.0-SNAPSHOT</version>
+	</parent>
+
 	<groupId>org.duelengine.duel</groupId>
 	<artifactId>duel-compiler</artifactId>
 	<version>1.0-SNAPSHOT</version>

duel/duel-js/pom.xml

 <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-4.0.0.xsd">
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
+	<parent>
+		<artifactId>duel</artifactId>
+		<groupId>org.duelengine.duel</groupId>
+		<version>1.0-SNAPSHOT</version>
+	</parent>
+
 	<groupId>org.duelengine.duel</groupId>
 	<artifactId>duel-js</artifactId>
 	<version>1.0-SNAPSHOT</version>

duel/duel-maven-plugin/pom.xml

+<?xml version="1.0"?>
+<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-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<artifactId>duel</artifactId>
+		<groupId>org.duelengine.duel</groupId>
+		<version>1.0-SNAPSHOT</version>
+	</parent>
+
+	<groupId>org.duelengine.duel</groupId>
+	<artifactId>duel-maven-plugin</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<packaging>maven-plugin</packaging>
+
+	<name>DUEL Maven Plugin</name>
+	<description>Dual-side template engine for the JVM, using 100% pure JavaScript as the binding language.</description>
+	<url>http://www.duelengine.org</url>
+	<licenses>
+		<license>
+			<name>MIT License</name>
+			<url>http://www.duelengine.org/LICENSE.txt</url>
+		</license>
+	</licenses>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.duelengine.duel</groupId>
+			<artifactId>duel-compiler</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.maven</groupId>
+			<artifactId>maven-plugin-api</artifactId>
+			<version>2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.2</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-plugin-plugin</artifactId>
+				<version>2.5.1</version>
+				<executions>
+					<execution>
+						<id>generated-helpmojo</id>
+						<goals>
+							<goal>helpmojo</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<goalPrefix>duel</goalPrefix>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

duel/duel-maven-plugin/src/main/java/org/duelengine/duel/maven/DuelMojo.java

+package org.duelengine.duel.maven;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ *
+ * @goal touch
+ * @phase process-sources
+ */
+public class DuelMojo
+    extends AbstractMojo {
+
+    /**
+     * Location of the file.
+     * @parameter expression="${project.build.directory}"
+     * @required
+     */
+    private File outputDirectory;
+
+    public void execute()
+        throws MojoExecutionException {
+
+        File f = outputDirectory;
+
+        if (!f.exists()) {
+            f.mkdirs();
+        }
+
+        File touch = new File(f, "touch.txt");
+
+        FileWriter w = null;
+        try {
+            w = new FileWriter( touch );
+            w.write("touch.txt");
+
+        } catch (IOException e) {
+            throw new MojoExecutionException("Error creating file " + touch, e);
+
+        } finally {
+            if (w != null) {
+                try {
+                    w.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
+        }
+    }
+}

duel/duel-runtime/pom.xml

 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
+	<parent>
+		<artifactId>duel</artifactId>
+		<groupId>org.duelengine.duel</groupId>
+		<version>1.0-SNAPSHOT</version>
+	</parent>
+
 	<groupId>org.duelengine.duel</groupId>
 	<artifactId>duel-runtime</artifactId>
 	<version>1.0-SNAPSHOT</version>
 		<module>duel-runtime</module>
 		<module>duel-compiler</module>
 		<module>duel-js</module>
+		<module>duel-maven-plugin</module>
 	</modules>
 </project>