--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>maven-argeo-pde-plugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
--- /dev/null
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.argeo.slc.maven.plugins</groupId>
+ <artifactId>maven-argeo-pde-plugin</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+ <name>Argeo PDE Plugin</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-script-ant</artifactId>
+ <version>2.0.9</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-tools-ant</artifactId>
+ <version>2.1</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <goalPrefix>argeo-pde</goalPrefix>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
--- /dev/null
+<project>
+ <property name="projectDirectory" location="${basedir}" />
+ <property name="eclipseAntArgs" value="" />
+ <property name="elementBuildScript" location="${projectDirectory}/build.xml" />
+ <property name="buildTempFolder" location="${projectDirectory}/target/argeo-pde-temp" />
+ <property name="buildScriptProperties" value="" />
+
+ <available file="${projectDirectory}/plugin.xml" property="elementType" value="plugin" />
+ <available file="${projectDirectory}/feature.xml" property="elementType" value="feature" />
+
+ <property name="pluginDestination" location="${projectDirectory}/target/plugins" />
+ <property name="featureDestination" location="${projectDirectory}/target/features" />
+
+ <target name="build" depends="init">
+ <fail message="Property buildScriptTargets has to be set" unless="buildScriptTargets" />
+ <eclipseAnt antfile="${ant.file}" antargs="eclipse.generateScripts" />
+ <eclipseAnt antfile="${elementBuildScript}" antargs="${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} ${buildScriptProperties}" />
+ </target>
+
+ <target name="clean" depends="logContext,clean.elementBuildScript">
+ <delete file="${projectDirectory}/javaCompiler...args" verbose="true" />
+ </target>
+
+ <target name="clean.elementBuildScript" if="elementBuildScript.exists">
+ <ant antfile="${elementBuildScript}" target="clean" />
+ <delete file="${elementBuildScript}" verbose="true" />
+ </target>
+
+ <target name="logContext">
+ <echo message="basedir=${basedir}" />
+ <echo message="ant.file=${ant.file}" />
+ <echo message="projectDirectory=${projectDirectory}" />
+ <echo message="baseLocation=${baseLocation}" />
+ <echo message="elementId=${elementId}" />
+ <echo message="elementBuildScript=${elementBuildScript}" />
+ <echo message="eclipseAntArgs=${eclipseAntArgs}" />
+ <echo message="buildScriptTargets=${buildScriptTargets}" />
+ <echo message="buildScriptProperties=${buildScriptProperties}" />
+
+ <available file="${elementBuildScript}" property="elementBuildScript.exists" value="true" />
+ </target>
+
+ <target name="init" depends="logContext">
+ <mkdir dir="${projectDirectory}/target/plugins" />
+ <mkdir dir="${projectDirectory}/target/features" />
+ </target>
+
+ <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
+ <target name="eclipse.generateScripts">
+ <fail message="Property elementType has to be set" unless="elementType" />
+ <eclipse.buildScript elements="${elementType}@${elementId}" buildDirectory="${projectDirectory}/../.." baseLocation="${baseLocation}" outputUpdateJars="true" generateVersionsLists="true"/>
+ </target>
+
+ <!-- MACRODEFS -->
+ <macrodef name="eclipseAnt">
+ <attribute name="antfile" />
+ <attribute name="antargs" />
+ <sequential>
+ <java fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
+ <classpath>
+ <fileset dir="${baseLocation}/plugins">
+ <include name="org.eclipse.equinox.launcher_*.jar" />
+ </fileset>
+ </classpath>
+ <arg line="-application org.eclipse.ant.core.antRunner" />
+ <arg line="-buildfile @{antfile}" />
+ <arg line="-DbaseLocation=${baseLocation} -DprojectDirectory=${projectDirectory} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder" />
+ <arg line="${eclipseAntArgs}" />
+ <arg line="@{antargs}" />
+ </java>
+ </sequential>
+ </macrodef>
+</project>
\ No newline at end of file
--- /dev/null
+<pluginMetadata>
+ <mojos>
+ <mojo>
+ <goal>build</goal>
+ <call>build</call>
+ <description>Generate PDE build scripts</description>
+
+ <requiresProject>true</requiresProject>
+
+ <parameters>
+ <parameter>
+ <name>baseLocation</name>
+ <property>baseLocation</property>
+ <required>true</required>
+ <expression>${baseLocation}</expression>
+ <type>java.lang.String</type>
+ <description>The Eclipse base location</description>
+ </parameter>
+ <parameter>
+ <name>buildScriptTargets</name>
+ <property>buildScriptTargets</property>
+ <required>true</required>
+ <expression>${buildScriptTargets}</expression>
+ <defaultValue>
+ clean build.jars zip.plugin
+ </defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The targets to execute in the generated build
+ script
+ </description>
+ </parameter>
+ <parameter>
+ <name>buildScriptProperties</name>
+ <property>buildScriptProperties</property>
+ <required>true</required>
+ <expression>${buildScriptProperties}</expression>
+ <defaultValue></defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The properties to pass to the generated build
+ script
+ </description>
+ </parameter>
+ <parameter>
+ <name>eclipseAntArgs</name>
+ <property>eclipseAntArgs</property>
+ <expression>${eclipseAntArgs}</expression>
+ <defaultValue></defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ Additional args passed to Eclipse Ant (such as
+ verbose/debug level)
+ </description>
+ </parameter>
+ <parameter>
+ <name>elementId</name>
+ <property>elementId</property>
+ <required>true</required>
+ <readonly>true</readonly>
+ <defaultValue>${project.artifactId}</defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The artifact id of the project by default, will
+ be used as element id.
+ </description>
+ </parameter>
+ </parameters>
+ </mojo>
+ <mojo>
+ <goal>clean</goal>
+ <call>clean</call>
+ <description>Clean generated artifacts</description>
+
+ <requiresProject>true</requiresProject>
+ <parameters>
+ <parameter>
+ <name>elementId</name>
+ <property>elementId</property>
+ <required>true</required>
+ <readonly>true</readonly>
+ <defaultValue>${project.artifactId}</defaultValue>
+ <type>java.lang.String</type>
+ <description>
+ The artifact id of the project by default, will
+ be used as element id.
+ </description>
+ </parameter>
+ </parameters>
+ </mojo>
+ </mojos>
+</pluginMetadata>
\ No newline at end of file