]>
git.argeo.org Git - gpl/argeo-slc.git/blob - maven/plugins/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml
3 <property name=
"projectDirectory" location=
"${basedir}" />
4 <property name=
"project.build.directory"
5 location=
"${projectDirectory}/target" />
6 <property name=
"dependencyDir"
7 location=
"${project.build.directory}/dependency" />
8 <property name=
"eclipseAntArgs" value=
"" />
10 <!-- Element build properties-->
11 <property name=
"elementBuildScript"
12 location=
"${projectDirectory}/build.xml" />
13 <property name=
"buildTempFolder"
14 location=
"${project.build.directory}/argeo-pde-temp" />
15 <property name=
"buildScriptProperties" value=
"" />
17 <available file=
"${projectDirectory}/plugin.xml"
18 property=
"elementType"
20 <available file=
"${projectDirectory}/feature.xml"
21 property=
"elementType"
24 <property name=
"pluginDestination"
25 location=
"${project.build.directory}/plugins" />
26 <property name=
"featureDestination"
27 location=
"${project.build.directory}/features" />
29 <!-- Product build properties -->
30 <property name=
"buildConfiguration" value=
"buildConfiguration" />
31 <property name=
"buildConfiguration.dir"
32 location=
"${projectDirectory}/${buildConfiguration}" />
34 <!-- TARGET Build Element -->
35 <target name=
"buildElement"
36 depends=
"init,setPluginPath"
37 description=
"Builds an element (plugin or feature)">
38 <fail message=
"Property buildScriptTargets has to be set"
39 unless=
"buildScriptTargets" />
41 <mkdir dir=
"${pluginDestination}" />
42 <mkdir dir=
"${featureDestination}" />
44 <eclipseAnt antfile=
"${ant.file}"
45 antargs=
"eclipse.generateScripts -DpluginPath=${pluginPath} -DprojectDirectory=${projectDirectory} -DeclipseBuildDir=${eclipseBuildDir} -DelementId=${elementId}" />
46 <eclipseAnt antfile=
"${elementBuildScript}"
47 antargs=
"${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder ${buildScriptProperties}" />
49 <copy todir=
"${project.build.directory}">
50 <fileset dir=
"${featureDestination}">
51 <include name=
"*.zip" />
53 <mergemapper to=
"${elementId}.zip" />
57 <!-- TARGET Build Product -->
58 <target name=
"buildProduct"
59 depends=
"init,setPluginPath"
60 description=
"Builds a product">
61 <!-- Load provided build.properties to leave a chance to override -->
62 <property file=
"${buildConfiguration.dir}/build.properties" />
63 <!-- Set default properties -->
64 <property name=
"archivePrefix" value=
"${elementId}" />
65 <property name=
"buildId" value=
"${archivePrefix}" />
66 <property name=
"buildLabel" value=
"${archivePrefix}" />
67 <property name=
"collectingFolder" value=
"${archivePrefix}" />
68 <property name=
"skipFetch" value=
"true" />
69 <property name=
"skipMaps" value=
"true" />
70 <property name=
"runPackager" value=
"true" />
72 <!-- Find PDE build file -->
73 <pathconvert pathsep=
"" property=
"productBuildFile">
75 <fileset dir=
"${pdeBuilder}/plugins">
76 <include name=
"org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
80 <echo message=
"productBuildFile=${productBuildFile}" />
83 <property name=
"buildDirectory"
84 location=
"${project.build.directory}/productBuild" />
85 <mkdir dir=
"${buildDirectory}" />
86 <copy todir=
"${buildDirectory}" includeemptydirs=
"true" verbose=
"true">
87 <fileset dir=
"${projectDirectory}/../..">
88 <include name=
"plugins/**" />
89 <include name=
"features/**" />
90 <exclude name=
"**/.svn/**" />
91 <exclude name=
"**/target/**" />
96 <eclipseAnt antfile=
"${productBuildFile}"
97 antargs=
"-Dbuilder=${buildConfiguration.dir} -DbuildDirectory=${buildDirectory} -DbaseLocation=${baseLocation} -Dbase=${base} -DpluginPath=${pluginPath} -DarchivePrefix=${archivePrefix} -DbuildLabel=${buildLabel} -DbuildId=${buildId} -DcollectingFolder=${collectingFolder} -DskipFetch=${skipFetch} -DskipMaps=${skipMaps} -DrunPackager=${runPackager}" />
99 <!-- Copy to target dir -->
100 <copy todir=
"${project.build.directory}">
101 <fileset dir=
"${buildDirectory}/${collectingFolder}">
102 <include name=
"*.zip" />
104 <globmapper from=
"${archivePrefix}-*" to=
"${elementId}-*" />
108 <!-- TARGET Clean -->
110 depends=
"init,clean.elementBuildScript"
111 description=
"Cleans the generated resources">
112 <delete dir=
"${projectDirectory}/workspace" verbose=
"true" />
113 <delete file=
"${projectDirectory}/javaCompiler...args" verbose=
"true" />
115 <fileset dir=
"${projectDirectory}/../..">
116 <include name=
"final*.properties" />
117 <include name=
"assemble*.xml" />
118 <include name=
"package*.xml" />
123 <target name=
"clean.elementBuildScript" if=
"elementBuildScript.exists">
124 <ant antfile=
"${elementBuildScript}" target=
"clean" />
125 <delete file=
"${elementBuildScript}" verbose=
"true" />
128 <!-- COMMON UTILITIES -->
131 <property name=
"base" location=
"${eclipseBuildDir}" />
132 <property name=
"baseLocation" location=
"${base}/eclipse-SDK-DP-3.3.2" />
133 <property name=
"pdeBuilder"
134 location=
"${eclipseBuildDir}/argeo-slc-pde" />
135 <property name=
"pluginPathBase"
136 location=
"${eclipseBuildDir}/pluginPath" />
138 <path id=
"pdeBuilder.launcher.classpath">
139 <fileset dir=
"${pdeBuilder}/plugins">
140 <include name=
"org.eclipse.equinox.launcher_*.jar" />
144 <!-- Log properties -->
145 <echo message=
"basedir=${basedir}" />
146 <echo message=
"ant.file=${ant.file}" />
147 <echo message=
"projectDirectory=${projectDirectory}" />
149 <echo message=
"eclipseBuildDir=${eclipseBuildDir}" />
150 <echo message=
"base=${base}" />
151 <echo message=
"baseLocation=${baseLocation}" />
152 <echo message=
"pdeBuilder=${pdeBuilder}" />
153 <echo message=
"localBuildDir=${localBuildDir}" />
154 <echo message=
"pluginPathBase=${pluginPathBase}" />
156 <echo message=
"elementType=${elementType}" />
157 <echo message=
"elementId=${elementId}" />
158 <echo message=
"elementBuildScript=${elementBuildScript}" />
159 <echo message=
"buildScriptTargets=${buildScriptTargets}" />
160 <echo message=
"buildScriptProperties=${buildScriptProperties}" />
162 <echo message=
"eclipseAntArgs=${eclipseAntArgs}" />
164 <echo message=
"buildConfiguration.dir=${buildConfiguration.dir}" />
166 <available file=
"${elementBuildScript}"
167 property=
"elementBuildScript.exists"
171 <target name=
"setPluginPath">
172 <mkdir dir=
"${dependencyDir}" />
173 <pathconvert property=
"pluginPath">
175 <pathelement location=
"${dependencyDir}" />
176 <dirset dir=
"${pluginPathBase}">
181 <echo message=
"pluginPath=${pluginPath}" />
184 <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
185 <target name=
"eclipse.generateScripts" depends=
"init">
186 <fail message=
"Property elementType has to be set"
187 unless=
"elementType" />
188 <property name=
"buildDirectory" location=
"${projectDirectory}/../.." />
189 <eclipse.buildScript
elements=
"${elementType}@${elementId}"
190 buildDirectory=
"${buildDirectory}"
191 baseLocation=
"${baseLocation}"
192 outputUpdateJars=
"true"
193 generateVersionsLists=
"true"
194 pluginPath=
"${pluginPath}" />
198 <macrodef name=
"eclipseAnt">
199 <attribute name=
"antfile" />
200 <attribute name=
"antargs" />
202 <echo message=
"Call Eclipse Ant for file @{antfile} with args ${eclipseAntArgs} @{antargs}" />
204 classname=
"org.eclipse.core.launcher.Main"
206 <classpath refid=
"pdeBuilder.launcher.classpath" />
207 <arg line=
"-data ${project.build.directory}/workspace" />
208 <arg line=
"-application org.eclipse.ant.core.antRunner" />
209 <arg line=
"-buildfile @{antfile}" />
210 <arg line=
"${eclipseAntArgs}" />
211 <arg line=
"@{antargs}" />