]>
git.argeo.org Git - gpl/argeo-slc.git/blob - maven/maven-argeo-pde-plugin/src/main/scripts/argeo-pde.build.xml
6203b76341f983695997831c2015193f9781b3ed
6 <!-- Maven project basedir -->
7 <property name=
"projectDirectory" location=
"${basedir}" />
8 <!-- Maven build dir -->
9 <property name=
"project.build.directory" location=
"${projectDirectory}/target" />
10 <!-- Maven dependency plugin dir -->
11 <property name=
"dependencyDir" location=
"${project.build.directory}/dependency" />
12 <!-- Arguments passed to Eclipse ant -->
13 <property name=
"eclipseAntArgs" value=
"" />
14 <!-- Additional arguments passed to Eclipse build script -->
15 <property name=
"buildScriptProperties" value=
"" />
20 <!-- Argeo PDE plugin dir -->
21 <property name=
"argeo-pde.dir" location=
"${project.build.directory}/argeo-pde" />
22 <!-- Temporary folder used by Eclipse build -->
23 <property name=
"buildTempFolder" location=
"${argeo-pde.dir}/temp" />
24 <!-- Eclipse Builder -->
25 <!--<property name="pdeBuilder" location="${argeo-pde.dir}/pdeBuilder" />-->
27 <!-- Eclipse Target -->
28 <property name=
"eclipseTarget" location=
"${argeo-pde.dir}/eclipseTarget" />
29 <property name=
"pdeBuilder" location=
"${eclipseTarget}" />
31 <!-- TODO: remove this since we build only features? -->
32 <available file=
"${projectDirectory}/plugin.xml" property=
"elementType" value=
"plugin" />
33 <available file=
"${projectDirectory}/feature.xml" property=
"elementType" value=
"feature" />
35 <!-- Destination dirs -->
36 <property name=
"argeo-pde.destinationDir" location=
"${argeo-pde.dir}/destination" />
37 <property name=
"pluginDestination" location=
"${argeo-pde.destinationDir}/plugins" />
38 <property name=
"featureDestination" location=
"${argeo-pde.destinationDir}/features" />
41 <property name=
"argeo-pde.sourceDir" location=
"${argeo-pde.dir}/source" />
42 <property name=
"buildDirectory" location=
"${argeo-pde.sourceDir}" />
45 <!-- TODO: make it more generic. Site file template -->
46 <property name=
"siteTemplate" location=
"${projectDirectory}/site.template" />
48 <!-- TODO: put it under argeo-pde. Product build properties -->
49 <property name=
"buildConfiguration" value=
"buildConfiguration" />
50 <property name=
"buildConfiguration.dir" location=
"${projectDirectory}/${buildConfiguration}" />
55 Element build properties
61 <target name=
"buildElement" depends=
"init" description=
"Builds an element (plugin or feature)">
62 <fail message=
"Property buildScriptTargets has to be set" unless=
"buildScriptTargets" />
64 <mkdir dir=
"${pluginDestination}" />
65 <mkdir dir=
"${featureDestination}" />
67 <!-- Copy to source -->
68 <property name=
"sourceBaseDir" location=
"${projectDirectory}/../.." />
69 <copy todir=
"${argeo-pde.sourceDir}">
70 <fileset dir=
"${sourceBaseDir}">
71 <include name=
"plugins/**" />
72 <include name=
"features/**" />
73 <exclude name=
"**/target/**" />
74 <exclude name=
"**/.svn/**" />
78 <property name=
"elementBuildScript" location=
"${buildDirectory}/${elementType}s/${elementId}/build.xml" />
80 <eclipseAnt antfile=
"${ant.file}" antargs=
"eclipse.generateScripts -DpdeBuilder=${pdeBuilder} -DpluginPath=${dependencyDir} -DprojectDirectory=${projectDirectory} -DeclipseBuildDir=${eclipseBuildDir} -DelementId=${elementId} -DbuildDirectory=${buildDirectory}" />
81 <eclipseAnt antfile=
"${elementBuildScript}" antargs=
"${buildScriptTargets} -Dplugin.destination=${pluginDestination} -Dfeature.destination=${featureDestination} -DelementId=${elementId} -DbuildTempFolder=${buildTempFolder} -Dtemp.folder=${buildTempFolder}/temp.folder -Dfeature.temp.folder=${buildTempFolder}/feature.temp.folder -DjavacFailOnError=true ${buildScriptProperties}" />
83 <copy todir=
"${project.build.directory}">
84 <fileset dir=
"${featureDestination}">
85 <include name=
"*.zip" />
87 <mergemapper to=
"${elementId}.zip" />
91 <copy tofile="${project.build.directory}/site.xml" file="${siteTemplate}">
92 <filterset begintoken="$${" endtoken="}">
93 <filtersfile file="${buildDirectory}/finalFeaturesVersions.properties" />
96 <zip destfile="${project.build.directory}/${elementId}-updatesite.zip">
97 <fileset dir="${project.build.directory}">
98 <include name="plugins/*.jar" />
99 <include name="features/*.jar" />
100 <include name="site.xml" />
109 <target name=
"buildProduct" depends=
"init" description=
"Builds a product">
110 <!-- Load provided build.properties to leave a chance to override -->
111 <property file=
"${buildConfiguration.dir}/build.properties" />
112 <!-- Set default properties -->
113 <property name=
"archivePrefix" value=
"${elementId}" />
114 <property name=
"buildId" value=
"${archivePrefix}" />
115 <property name=
"buildLabel" value=
"${archivePrefix}" />
116 <property name=
"collectingFolder" value=
"${archivePrefix}" />
117 <property name=
"skipFetch" value=
"true" />
118 <property name=
"skipMaps" value=
"true" />
119 <property name=
"runPackager" value=
"true" />
121 <!-- Find PDE build file -->
122 <pathconvert pathsep=
"" property=
"productBuildFile">
124 <fileset dir=
"${pdeBuilder}/plugins">
125 <include name=
"org.eclipse.pde.build_*/scripts/productBuild/productBuild.xml" />
129 <echo message=
"productBuildFile=${productBuildFile}" />
131 <!-- Copy sources -->
132 <property name=
"buildDirectory" location=
"${project.build.directory}/productBuild" />
133 <mkdir dir=
"${buildDirectory}" />
134 <copy todir=
"${buildDirectory}" includeemptydirs=
"true" verbose=
"true">
135 <fileset dir=
"${projectDirectory}/../..">
136 <include name=
"plugins/**" />
137 <include name=
"features/**" />
138 <exclude name=
"**/.svn/**" />
139 <exclude name=
"**/target/**" />
144 <eclipseAnt antfile=
"${productBuildFile}" antargs=
"-Dbuilder=${buildConfiguration.dir} -DbuildDirectory=${buildDirectory} -DskipBase=true -DbaseLocation=${eclipseTarget} -DpluginPath=${dependencyDir} -DarchivePrefix=${archivePrefix} -DbuildLabel=${buildLabel} -DbuildId=${buildId} -DcollectingFolder=${collectingFolder} -DskipFetch=${skipFetch} -DskipMaps=${skipMaps} -DrunPackager=${runPackager}" />
146 <!-- Copy to target dir -->
147 <copy todir=
"${project.build.directory}">
148 <fileset dir=
"${buildDirectory}/${collectingFolder}">
149 <include name=
"*.zip" />
151 <globmapper from=
"${archivePrefix}-*" to=
"${elementId}-*" />
156 TARGET eclipseTarget-collect
158 <target name=
"eclipseTarget-collect" description=
"Creates an Eclipse target location based on the dependencies">
159 <taskdef resource=
"net/sf/antcontrib/antlib.xml" />
161 <dirset dir=
"${project.build.directory}/dependency">
165 <copy todir=
"${eclipseTarget}" failonerror=
"false">
166 <fileset dir=
"@{dir}">
167 <include name=
"plugins/**" />
168 <include name=
"features/**" />
171 <copy todir=
"${eclipseTarget}" failonerror=
"false">
172 <fileset dir=
"@{dir}/eclipse">
173 <include name=
"plugins/**" />
174 <include name=
"features/**" />
180 <!-- Copy configuration from SDK -->
182 <dirset dir=
"${project.build.directory}/dependency">
183 <include name=
"eclipse-sdk-*" />
186 <copy todir=
"${eclipseTarget}" failonerror=
"false">
187 <fileset dir=
"@{dir}/eclipse">
188 <include name=
"configuration/**" />
199 <path id=
"pdeBuilder.launcher.classpath">
200 <fileset dir=
"${pdeBuilder}/plugins">
201 <include name=
"org.eclipse.equinox.launcher_*.jar" />
205 <!-- Log properties -->
206 <echo message=
"basedir=${basedir}" />
207 <echo message=
"ant.file=${ant.file}" />
208 <echo message=
"projectDirectory=${projectDirectory}" />
210 <echo message=
"pdeBuilder=${pdeBuilder}" />
211 <echo message=
"eclipseTarget=${eclipseTarget}" />
213 <echo message=
"elementType=${elementType}" />
214 <echo message=
"elementId=${elementId}" />
215 <echo message=
"elementBuildScript=${elementBuildScript}" />
216 <echo message=
"buildScriptTargets=${buildScriptTargets}" />
217 <echo message=
"buildScriptProperties=${buildScriptProperties}" />
219 <echo message=
"eclipseAntArgs=${eclipseAntArgs}" />
221 <echo message=
"buildConfiguration.dir=${buildConfiguration.dir}" />
224 <target name="setPluginPath">
225 <mkdir dir="${dependencyDir}" />
226 <pathconvert property="pluginPath">
228 <pathelement location="${dependencyDir}" />
229 <dirset dir="${pluginPathBase}">
234 <echo message="pluginPath=${pluginPath}" />
237 <!-- TARGETS TO BE CALLED WITH ANT ECLIPSE -->
238 <target name=
"eclipse.generateScripts" depends=
"init">
239 <fail message=
"Property elementType has to be set" unless=
"elementType" />
240 <eclipse.buildScript
elements=
"${elementType}@${elementId}" buildDirectory=
"${buildDirectory}" baseLocation=
"${eclipseTarget}" outputUpdateJars=
"true" generateVersionsLists=
"true" pluginPath=
"${dependencyDir}" />
244 <macrodef name=
"eclipseAnt">
245 <attribute name=
"antfile" />
246 <attribute name=
"antargs" />
248 <echo message=
"Call Eclipse Ant for file @{antfile} with args ${eclipseAntArgs} @{antargs}" />
249 <java fork=
"true" classname=
"org.eclipse.core.launcher.Main" failonerror=
"true">
250 <classpath refid=
"pdeBuilder.launcher.classpath" />
251 <arg line=
"-data ${argeo-pde.dir}/workspace" />
252 <arg line=
"-application org.eclipse.ant.core.antRunner" />
253 <arg line=
"-buildfile @{antfile}" />
254 <arg line=
"${eclipseAntArgs}" />
255 <arg line=
"@{antargs}" />