]> git.argeo.org Git - gpl/argeo-slc.git/blob - maven/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml
Introduce Argeo PDE Maven plugin
[gpl/argeo-slc.git] / maven / plugins / maven-argeo-pde-plugin / src / main / scripts / argeo-pde.build.xml
1 <project>
2 <property name="projectDirectory" location="${basedir}" />
3 <property name="eclipseAntArgs" value="" />
4 <property name="elementBuildScript" location="${projectDirectory}/build.xml" />
5 <property name="buildTempFolder" location="${projectDirectory}/target/argeo-pde-temp" />
6 <property name="buildScriptProperties" value="" />
7
8 <available file="${projectDirectory}/plugin.xml" property="elementType" value="plugin" />
9 <available file="${projectDirectory}/feature.xml" property="elementType" value="feature" />
10
11 <property name="pluginDestination" location="${projectDirectory}/target/plugins" />
12 <property name="featureDestination" location="${projectDirectory}/target/features" />
13
14 <target name="build" depends="init">
15 <fail message="Property buildScriptTargets has to be set" unless="buildScriptTargets" />
16 <eclipseAnt antfile="${ant.file}" antargs="eclipse.generateScripts" />
17 <eclipseAnt antfile="${elementBuildScript}" antargs="${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} ${buildScriptProperties}" />
18 </target>
19
20 <target name="clean" depends="logContext,clean.elementBuildScript">
21 <delete file="${projectDirectory}/javaCompiler...args" verbose="true" />
22 </target>
23
24 <target name="clean.elementBuildScript" if="elementBuildScript.exists">
25 <ant antfile="${elementBuildScript}" target="clean" />
26 <delete file="${elementBuildScript}" verbose="true" />
27 </target>
28
29 <target name="logContext">
30 <echo message="basedir=${basedir}" />
31 <echo message="ant.file=${ant.file}" />
32 <echo message="projectDirectory=${projectDirectory}" />
33 <echo message="baseLocation=${baseLocation}" />
34 <echo message="elementId=${elementId}" />
35 <echo message="elementBuildScript=${elementBuildScript}" />
36 <echo message="eclipseAntArgs=${eclipseAntArgs}" />
37 <echo message="buildScriptTargets=${buildScriptTargets}" />
38 <echo message="buildScriptProperties=${buildScriptProperties}" />
39
40 <available file="${elementBuildScript}" property="elementBuildScript.exists" value="true" />
41 </target>
42
43 <target name="init" depends="logContext">
44 <mkdir dir="${projectDirectory}/target/plugins" />
45 <mkdir dir="${projectDirectory}/target/features" />
46 </target>
47
48 <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
49 <target name="eclipse.generateScripts">
50 <fail message="Property elementType has to be set" unless="elementType" />
51 <eclipse.buildScript elements="${elementType}@${elementId}" buildDirectory="${projectDirectory}/../.." baseLocation="${baseLocation}" outputUpdateJars="true" generateVersionsLists="true"/>
52 </target>
53
54 <!-- MACRODEFS -->
55 <macrodef name="eclipseAnt">
56 <attribute name="antfile" />
57 <attribute name="antargs" />
58 <sequential>
59 <java fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true">
60 <classpath>
61 <fileset dir="${baseLocation}/plugins">
62 <include name="org.eclipse.equinox.launcher_*.jar" />
63 </fileset>
64 </classpath>
65 <arg line="-application org.eclipse.ant.core.antRunner" />
66 <arg line="-buildfile @{antfile}" />
67 <arg line="-DbaseLocation=${baseLocation} -DprojectDirectory=${projectDirectory} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder" />
68 <arg line="${eclipseAntArgs}" />
69 <arg line="@{antargs}" />
70 </java>
71 </sequential>
72 </macrodef>
73 </project>