1 <project name="Build specific targets and properties" default="noDefault">
\r
2 <condition property="isNightlyBuild">
\r
3 <equals arg1="${buildType}" arg2="N" />
\r
5 <condition property="isNightlyOrIntegrationBuild">
\r
7 <equals arg1="${buildType}" arg2="N" />
\r
8 <equals arg1="${buildType}" arg2="I" />
\r
12 <property file="${buildHome}/pluginbuilder.config" />
\r
14 <property file="${buildDirectory}/version.properties" />
\r
15 <property name="buildLabel" value="${buildType}-${version.full}" />
\r
16 <property name="buildId" value="${version.full}" />
\r
18 <condition property="isCVSOrCopy" value="true">
\r
20 <equals arg1="${pluginbuilder.is.cvs}" arg2="true"/>
\r
21 <equals arg1="${pluginbuilder.is.copy}" arg2="true"/>
\r
24 <condition property="isSVN" value="true">
\r
25 <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>
\r
27 <condition property="isRunTests" value="true">
\r
28 <equals arg1="${pluginbuilder.is.runtests}" arg2="true"/>
\r
32 <target name="allElements">
\r
33 <condition property="isFetch" value="true">
\r
34 <equals arg1="${target}" arg2="fetchElement"/>
\r
36 <condition property="is.svn.fetch" value="true">
\r
38 <equals arg1="${target}" arg2="fetchElement"/>
\r
39 <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>
\r
43 <antcall target="allElementsExceptSvnFetch"/>
\r
44 <antcall target="fetchSubversion"/>
\r
47 <import file="allElements.xml"/>
\r
48 <import file="subversionSupport.xml"/>
\r
51 <!-- ===================================================================== -->
\r
52 <!-- Check out map files from correct repository -->
\r
53 <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
\r
54 <!-- ===================================================================== -->
\r
55 <target name="getMapFiles" if="isCVSOrCopy">
\r
56 <echo message="Copying map files."/>
\r
57 <copy todir="${buildDirectory}/maps">
\r
58 <fileset dir="${buildHome}/maps" includes="*.map"></fileset>
\r
62 <!-- ===================================================================== -->
\r
63 <!-- Steps to do before setup -->
\r
64 <!-- ===================================================================== -->
\r
65 <target name="preSetup" if="${product}">
\r
66 <copy todir="${buildDirectory}" file="${buildHome}/${product}"/>
\r
68 <!-- ===================================================================== -->
\r
69 <!-- Steps to do after setup but before starting the build proper -->
\r
70 <!-- ===================================================================== -->
\r
71 <target name="postSetup">
\r
73 <!-- ===================================================================== -->
\r
74 <!-- Steps to do before fetching the build elements -->
\r
75 <!-- ===================================================================== -->
\r
76 <target name="preFetch">
\r
78 <!-- ===================================================================== -->
\r
79 <!-- Steps to do after fetching the build elements -->
\r
80 <!-- ===================================================================== -->
\r
81 <target name="postFetch">
\r
82 <condition property="is.fetch" value="true">
\r
83 <available file="${buildDirectory}/plugins"/>
\r
85 <fail unless="is.fetch" message="There was no plug-in fetched. Was the configuration generated? Is the repository correct?"/>
\r
86 <antcall target="replaceVersions"/>
\r
89 <target name="replaceVersions">
\r
90 <fail unless="version.full" message="Property version.full must be set" />
\r
91 <fail unless="version.qualifier" message="Property version.qualifier must be set" />
\r
93 <echo message="Updating versions in feature and plugin manifests. Full version: ${version.full}, qualifier: ${version.qualifier}"/>
\r
94 <!-- make sure to select the test feature file as well -->
\r
95 <replace dir="${buildDirectory}/features">
\r
96 <include name="**/feature.xml"/>
\r
97 <!-- adding the greater than on the right side is only a dirty trick to replace only the feature version -->
\r
98 <replacefilter token="version="0.0.0">" value="version="${version.full}">" />
\r
99 <replacefilter token="qualifier" value="${version.qualifier}" />
\r
100 <replacefilter token="phpeclipse.release_eclipse.version" value="${phpeclipse_build_target}" />
\r
102 <!-- in a manual build started with export from the feature.xml, there is no
\r
103 need to replace the versions in the plugin.xml files if they are set to 0.0.0,
\r
104 but here it needs to be -->
\r
105 <replace dir="${buildDirectory}/plugins">
\r
106 <include name="**/plugin.xml"/>
\r
107 <replacefilter token="0.0.0" value="${version.full}" />
\r
109 <replace dir="${buildDirectory}/plugins">
\r
110 <include name="**/META-INF/MANIFEST.MF"/>
\r
111 <replacefilter token="Bundle-Version: 0.0.0" value="Bundle-Version: ${version.full}" />
\r
112 <replacefilter token="qualifier" value="${version.qualifier}" />
\r
115 <!-- ===================================================================== -->
\r
116 <!-- Steps to do before generating the build scripts. -->
\r
117 <!-- ===================================================================== -->
\r
118 <target name="preGenerate">
\r
119 <!-- fail unless="featureVersion" message="Property featureVersion must be set.
\r
120 Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix." />
\r
123 <!-- ===================================================================== -->
\r
124 <!-- Steps to do after generating the build scripts. -->
\r
125 <!-- ===================================================================== -->
\r
126 <target name="postGenerate">
\r
128 <!-- ===================================================================== -->
\r
129 <!-- Steps to do before running the build.xmls for the elements being built. -->
\r
130 <!-- ===================================================================== -->
\r
131 <target name="preProcess">
\r
133 <!-- ===================================================================== -->
\r
134 <!-- Steps to do after running the build.xmls for the elements being built. -->
\r
135 <!-- ===================================================================== -->
\r
136 <target name="postProcess">
\r
138 <!-- ===================================================================== -->
\r
139 <!-- Steps to do before running assemble. -->
\r
140 <!-- ===================================================================== -->
\r
141 <target name="preAssemble">
\r
143 <!-- ===================================================================== -->
\r
144 <!-- Steps to do after running assemble. -->
\r
145 <!-- ===================================================================== -->
\r
146 <target name="postAssemble">
\r
148 <!-- ===================================================================== -->
\r
149 <!-- Steps to do before/after packaging RCP. -->
\r
150 <!-- ===================================================================== -->
\r
151 <target name="prePackage">
\r
153 <target name="postPackage">
\r
156 <!-- ===================================================================== -->
\r
157 <!-- Steps to do after the build is done. -->
\r
158 <!-- ===================================================================== -->
\r
159 <property name="buildResultsDirectory" value="${buildDirectory}/results" />
\r
160 <target name="postBuild" depends="-prepareBuildResultsDirectory" unless="no.postBuild">
\r
161 <antcall target="runTests"/>
\r
162 <copy todir="${buildResultsDirectory}" flatten="true">
\r
163 <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" />
\r
165 <condition property="is.External.Postbuild">
\r
166 <available file="${buildHome}/build-files/postBuild.xml"/>
\r
168 <antcall target="callExternalPostBuild"/>
\r
170 <!-- ===================================================================== -->
\r
171 <!-- Run tests. -->
\r
172 <!-- ===================================================================== -->
\r
173 <target name="runTests" if="isRunTests">
\r
174 <property name="automatedTestsHome" location="${buildHome}/build-files/automatedTests"/>
\r
176 <ant antfile="${automatedTestsHome}/run-tests.xml" target="run" dir="${automatedTestsHome}">
\r
177 <property name="test.result.dir" value="${buildResultsDirectory}/testresults"/>
\r
180 <!--======================================================-->
\r
181 <!-- Gather build results -->
\r
182 <!-- ==================================================== -->
\r
183 <target name="-prepareBuildResultsDirectory">
\r
184 <echo message="Creating ${buildResultsDirectory}" />
\r
185 <mkdir dir="${buildResultsDirectory}" />
\r
188 <!--======================================================-->
\r
189 <!-- Call External post build file if available -->
\r
190 <!-- ==================================================== -->
\r
191 <target name="callExternalPostBuild" if="is.External.Postbuild">
\r
192 <ant antfile="${buildHome}/build-files/postBuild.xml"/>
\r
195 <target name="noDefault">
\r
196 <echo message="You must specify a target when invoking this file" />
\r