]>
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 <property name=
"siteTemplate"
30 location=
"${projectDirectory}/site.template" />
32 <!-- Product build properties -->
33 <property name=
"buildConfiguration" value=
"buildConfiguration" />
34 <property name=
"buildConfiguration.dir"
35 location=
"${projectDirectory}/${buildConfiguration}" />
37 <!-- TARGET Build Element -->
38 <target name=
"buildElement"
39 depends=
"init,setPluginPath"
40 description=
"Builds an element (plugin or feature)">
41 <fail message=
"Property buildScriptTargets has to be set"
42 unless=
"buildScriptTargets" />
44 <mkdir dir=
"${pluginDestination}" />
45 <mkdir dir=
"${featureDestination}" />
47 <property name=
"buildDirectory" location=
"${projectDirectory}/../.." />
49 <eclipseAnt antfile=
"${ant.file}"
50 antargs=
"eclipse.generateScripts -DpluginPath=${pluginPath} -DprojectDirectory=${projectDirectory} -DeclipseBuildDir=${eclipseBuildDir} -DelementId=${elementId} -DbuildDirectory=${buildDirectory}" />
51 <eclipseAnt antfile=
"${elementBuildScript}"
52 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}" />
54 <copy todir=
"${project.build.directory}">
55 <fileset dir=
"${featureDestination}">
56 <include name=
"*.zip" />
58 <mergemapper to=
"${elementId}.zip" />
62 <copy tofile=
"${project.build.directory}/site.xml"
63 file=
"${siteTemplate}">
64 <filterset begintoken=
"$${" endtoken=
"}">
65 <filtersfile file=
"${buildDirectory}/finalFeaturesVersions.properties" />
68 <zip destfile=
"${project.build.directory}/${elementId}-updatesite.zip">
69 <fileset dir=
"${project.build.directory}">
70 <include name=
"plugins/*.jar" />
71 <include name=
"features/*.jar" />
72 <include name=
"site.xml" />
77 <!-- TARGET Build Product -->
78 <target name=
"buildProduct"
79 depends=
"init,setPluginPath"
80 description=
"Builds a product">
81 <!-- Load provided build.properties to leave a chance to override -->
82 <property file=
"${buildConfiguration.dir}/build.properties" />
83 <!-- Set default properties -->
84 <property name=
"archivePrefix" value=
"${elementId}" />
85 <property name=
"buildId" value=
"${archivePrefix}" />
86 <property name=
"buildLabel" value=
"${archivePrefix}" />
87 <property name=
"collectingFolder" value=
"${archivePrefix}" />
88 <property name=
"skipFetch" value=
"true" />
89 <property name=
"skipMaps" value=
"true" />
90 <property name=
"runPackager" value=
"true" />
92 <!-- Find PDE build file -->
93 <pathconvert pathsep=
"" property=
"productBuildFile">
95 <fileset dir=
"${pdeBuilder}/plugins">
96 <include name=
"org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
100 <echo message=
"productBuildFile=${productBuildFile}" />
102 <!-- Copy sources -->
103 <property name=
"buildDirectory"
104 location=
"${project.build.directory}/productBuild" />
105 <mkdir dir=
"${buildDirectory}" />
106 <copy todir=
"${buildDirectory}" includeemptydirs=
"true" verbose=
"true">
107 <fileset dir=
"${projectDirectory}/../..">
108 <include name=
"plugins/**" />
109 <include name=
"features/**" />
110 <exclude name=
"**/.svn/**" />
111 <exclude name=
"**/target/**" />
116 <eclipseAnt antfile=
"${productBuildFile}"
117 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}" />
119 <!-- Copy to target dir -->
120 <copy todir=
"${project.build.directory}">
121 <fileset dir=
"${buildDirectory}/${collectingFolder}">
122 <include name=
"*.zip" />
124 <globmapper from=
"${archivePrefix}-*" to=
"${elementId}-*" />
128 <!-- TARGET Clean -->
130 depends=
"init,clean.elementBuildScript"
131 description=
"Cleans the generated resources">
132 <delete dir=
"${projectDirectory}/workspace" verbose=
"true" />
133 <delete file=
"${projectDirectory}/javaCompiler...args" verbose=
"true" />
135 <fileset dir=
"${projectDirectory}/../..">
136 <include name=
"final*.properties" />
137 <include name=
"assemble*.xml" />
138 <include name=
"package*.xml" />
143 <target name=
"clean.elementBuildScript" if=
"elementBuildScript.exists">
144 <ant antfile=
"${elementBuildScript}" target=
"clean" />
145 <delete file=
"${elementBuildScript}" verbose=
"true" />
148 <!-- COMMON UTILITIES -->
151 <property name=
"base" location=
"${eclipseBuildDir}" />
152 <property name=
"baseLocation" location=
"${base}/eclipse" />
153 <property name=
"pdeBuilder"
154 location=
"${eclipseBuildDir}/argeo-slc-pde" />
155 <property name=
"pluginPathBase"
156 location=
"${eclipseBuildDir}/pluginPath" />
158 <path id=
"pdeBuilder.launcher.classpath">
159 <fileset dir=
"${pdeBuilder}/plugins">
160 <include name=
"org.eclipse.equinox.launcher_*.jar" />
164 <!-- Log properties -->
165 <echo message=
"basedir=${basedir}" />
166 <echo message=
"ant.file=${ant.file}" />
167 <echo message=
"projectDirectory=${projectDirectory}" />
169 <echo message=
"eclipseBuildDir=${eclipseBuildDir}" />
170 <echo message=
"base=${base}" />
171 <echo message=
"baseLocation=${baseLocation}" />
172 <echo message=
"pdeBuilder=${pdeBuilder}" />
173 <echo message=
"localBuildDir=${localBuildDir}" />
174 <echo message=
"pluginPathBase=${pluginPathBase}" />
176 <echo message=
"elementType=${elementType}" />
177 <echo message=
"elementId=${elementId}" />
178 <echo message=
"elementBuildScript=${elementBuildScript}" />
179 <echo message=
"buildScriptTargets=${buildScriptTargets}" />
180 <echo message=
"buildScriptProperties=${buildScriptProperties}" />
182 <echo message=
"eclipseAntArgs=${eclipseAntArgs}" />
184 <echo message=
"buildConfiguration.dir=${buildConfiguration.dir}" />
186 <available file=
"${elementBuildScript}"
187 property=
"elementBuildScript.exists"
191 <target name=
"setPluginPath">
192 <mkdir dir=
"${dependencyDir}" />
193 <pathconvert property=
"pluginPath">
195 <pathelement location=
"${dependencyDir}" />
196 <dirset dir=
"${pluginPathBase}">
201 <echo message=
"pluginPath=${pluginPath}" />
204 <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
205 <target name=
"eclipse.generateScripts" depends=
"init">
206 <fail message=
"Property elementType has to be set"
207 unless=
"elementType" />
208 <eclipse.buildScript
elements=
"${elementType}@${elementId}"
209 buildDirectory=
"${buildDirectory}"
210 baseLocation=
"${baseLocation}"
211 outputUpdateJars=
"true"
212 generateVersionsLists=
"true"
213 pluginPath=
"${pluginPath}" />
217 <macrodef name=
"eclipseAnt">
218 <attribute name=
"antfile" />
219 <attribute name=
"antargs" />
221 <echo message=
"Call Eclipse Ant for file @{antfile} with args ${eclipseAntArgs} @{antargs}" />
223 classname=
"org.eclipse.core.launcher.Main"
225 <classpath refid=
"pdeBuilder.launcher.classpath" />
226 <arg line=
"-data ${project.build.directory}/workspace" />
227 <arg line=
"-application org.eclipse.ant.core.antRunner" />
228 <arg line=
"-buildfile @{antfile}" />
229 <arg line=
"${eclipseAntArgs}" />
230 <arg line=
"@{antargs}" />