Adding the pluginbuilder files that are used in the nightly build process.
[phpeclipse.git] / utilities / pluginbuilder / build-files / customTargets.xml
diff --git a/utilities/pluginbuilder/build-files/customTargets.xml b/utilities/pluginbuilder/build-files/customTargets.xml
new file mode 100644 (file)
index 0000000..d82370f
--- /dev/null
@@ -0,0 +1,198 @@
+<project name="Build specific targets and properties" default="noDefault">\r
+       <condition property="isNightlyBuild">\r
+               <equals arg1="${buildType}" arg2="N" />\r
+       </condition>\r
+       <condition property="isNightlyOrIntegrationBuild">\r
+               <or>\r
+                       <equals arg1="${buildType}" arg2="N" />\r
+                       <equals arg1="${buildType}" arg2="I" />\r
+               </or>\r
+       </condition>\r
+       \r
+       <property file="${buildHome}/pluginbuilder.config" />\r
+       \r
+       <property file="${buildDirectory}/version.properties" />\r
+       <property name="buildLabel" value="${buildType}-${version.full}" />\r
+       <property name="buildId" value="${version.full}" />\r
+       \r
+       <condition property="isCVSOrCopy" value="true">\r
+               <or>\r
+                       <equals arg1="${pluginbuilder.is.cvs}" arg2="true"/>\r
+                       <equals arg1="${pluginbuilder.is.copy}" arg2="true"/>\r
+               </or>\r
+       </condition>\r
+       <condition property="isSVN" value="true">\r
+               <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>\r
+       </condition>\r
+       <condition property="isRunTests" value="true">\r
+               <equals arg1="${pluginbuilder.is.runtests}" arg2="true"/>\r
+       </condition>\r
+       \r
+       \r
+       <target name="allElements">\r
+               <condition property="isFetch" value="true">\r
+                       <equals arg1="${target}" arg2="fetchElement"/>\r
+               </condition>\r
+           <condition property="is.svn.fetch" value="true">\r
+                       <and>\r
+                               <equals arg1="${target}" arg2="fetchElement"/>\r
+                               <equals arg1="${pluginbuilder.is.svn}" arg2="true"/>\r
+                       </and>\r
+           </condition>\r
+       \r
+               <antcall target="allElementsExceptSvnFetch"/>\r
+               <antcall target="fetchSubversion"/>\r
+       </target>\r
+       \r
+       <import file="allElements.xml"/>\r
+       <import file="subversionSupport.xml"/>\r
+       \r
+       \r
+       <!-- ===================================================================== -->\r
+       <!-- Check out map files from correct repository -->\r
+       <!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="getMapFiles" if="isCVSOrCopy">\r
+               <echo message="Copying map files."/>\r
+               <copy todir="${buildDirectory}/maps">\r
+                       <fileset dir="${buildHome}/maps" includes="*.map"></fileset>\r
+               </copy>\r
+       </target>\r
+       \r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before setup -->\r
+       <!-- ===================================================================== -->\r
+       <target name="preSetup" if="${product}">        \r
+               <copy todir="${buildDirectory}" file="${buildHome}/${product}"/> \r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after setup but before starting the build proper -->\r
+       <!-- ===================================================================== -->\r
+       <target name="postSetup">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before fetching the build elements -->\r
+       <!-- ===================================================================== -->\r
+       <target name="preFetch">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after fetching the build elements -->\r
+       <!-- ===================================================================== -->\r
+       <target name="postFetch">\r
+               <condition property="is.fetch" value="true">\r
+                       <available file="${buildDirectory}/plugins"/>\r
+               </condition>\r
+               <fail unless="is.fetch" message="There was no plug-in fetched. Was the configuration generated? Is the repository correct?"/>\r
+               <antcall target="replaceVersions"/>             \r
+       </target>\r
+       \r
+       <target name="replaceVersions">\r
+               <fail unless="version.full" message="Property version.full must be set" />\r
+               <fail unless="version.qualifier" message="Property version.qualifier must be set" />\r
+       \r
+               <echo message="Updating versions in feature and plugin manifests. Full version: ${version.full}, qualifier: ${version.qualifier}"/>\r
+               <!-- make sure to select the test feature file as well -->\r
+               <replace dir="${buildDirectory}/features">\r
+                       <include name="**/feature.xml"/>\r
+                       <!-- adding the greater than on the right side is only a dirty trick to replace only the feature version -->\r
+                       <replacefilter token="version=&quot;0.0.0&quot;>" value="version=&quot;${version.full}&quot;>" />\r
+                       <replacefilter token="qualifier" value="${version.qualifier}" />\r
+                       <replacefilter token="phpeclipse.release_eclipse.version" value="${phpeclipse_build_target}" />\r
+               </replace>\r
+               <!-- in a manual build started with export from the feature.xml, there is no\r
+                       need to replace the versions in the plugin.xml files if they are set to 0.0.0,\r
+                       but here it needs to be -->\r
+               <replace dir="${buildDirectory}/plugins">\r
+                       <include name="**/plugin.xml"/>\r
+                       <replacefilter token="0.0.0" value="${version.full}" />\r
+               </replace>\r
+               <replace dir="${buildDirectory}/plugins">\r
+                       <include name="**/META-INF/MANIFEST.MF"/>\r
+                       <replacefilter token="Bundle-Version: 0.0.0" value="Bundle-Version: ${version.full}" />\r
+                       <replacefilter token="qualifier" value="${version.qualifier}" />\r
+               </replace>\r
+       </target>       \r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before generating the build scripts. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="preGenerate">\r
+               <!-- fail unless="featureVersion" message="Property featureVersion must be set.\r
+                Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix." />\r
+                -->\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after generating the build scripts. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="postGenerate">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before running the build.xmls for the elements being built. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="preProcess">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after running the build.xmls for the elements being built. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="postProcess">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before running assemble. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="preAssemble">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after  running assemble. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="postAssemble">\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do before/after packaging RCP. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="prePackage">\r
+       </target>\r
+       <target name="postPackage">\r
+       </target>\r
+\r
+       <!-- ===================================================================== -->\r
+       <!-- Steps to do after the build is done. -->\r
+       <!-- ===================================================================== -->\r
+       <property name="buildResultsDirectory" value="${buildDirectory}/results" />\r
+       <target name="postBuild" depends="-prepareBuildResultsDirectory" unless="no.postBuild">\r
+               <antcall target="runTests"/>\r
+               <copy todir="${buildResultsDirectory}" flatten="true">\r
+                       <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" />\r
+               </copy>\r
+               <condition property="is.External.Postbuild">\r
+                       <available file="${buildHome}/build-files/postBuild.xml"/>\r
+               </condition>\r
+               <antcall target="callExternalPostBuild"/>\r
+       </target>\r
+       <!-- ===================================================================== -->\r
+       <!-- Run tests. -->\r
+       <!-- ===================================================================== -->\r
+       <target name="runTests" if="isRunTests">\r
+               <property name="automatedTestsHome" location="${buildHome}/build-files/automatedTests"/>\r
+\r
+               <ant antfile="${automatedTestsHome}/run-tests.xml" target="run" dir="${automatedTestsHome}">\r
+                       <property name="test.result.dir" value="${buildResultsDirectory}/testresults"/>\r
+               </ant>\r
+       </target>       \r
+       <!--======================================================-->\r
+       <!-- Gather build results  -->\r
+       <!-- ==================================================== -->\r
+       <target name="-prepareBuildResultsDirectory">\r
+               <echo message="Creating ${buildResultsDirectory}" />\r
+               <mkdir dir="${buildResultsDirectory}" />        \r
+       </target>\r
+\r
+       <!--======================================================-->\r
+       <!-- Call External post build file if available -->\r
+       <!-- ==================================================== -->\r
+       <target name="callExternalPostBuild" if="is.External.Postbuild">\r
+               <ant antfile="${buildHome}/build-files/postBuild.xml"/>\r
+       </target>\r
+       \r
+       <target name="noDefault">\r
+               <echo message="You must specify a target when invoking this file" />\r
+       </target>\r
+</project>\r