| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <project name="Build specific targets and properties" default="noDefault"> |
| <condition property="isNightlyBuild"> |
| <equals arg1="${buildType}" arg2="N" /> |
| </condition> |
| <condition property="isNightlyOrIntegrationBuild"> |
| <or> |
| <equals arg1="${buildType}" arg2="N" /> |
| <equals arg1="${buildType}" arg2="I" /> |
| </or> |
| </condition> |
| |
| <property file="${buildHome}/pluginbuilder.config" /> |
| |
| <property file="${buildDirectory}/version.properties" /> |
| <property name="buildLabel" value="${buildType}-${version.full}" /> |
| <property name="buildId" value="${version.full}" /> |
| |
| <condition property="isCVSOrCopy" value="true"> |
| <or> |
| <equals arg1="${pluginbuilder.is.cvs}" arg2="true"/> |
| <equals arg1="${pluginbuilder.is.copy}" arg2="true"/> |
| </or> |
| </condition> |
| <condition property="isSVN" value="true"> |
| <equals arg1="${pluginbuilder.is.svn}" arg2="true"/> |
| </condition> |
| <condition property="isRunTests" value="true"> |
| <equals arg1="${pluginbuilder.is.runtests}" arg2="true"/> |
| </condition> |
| |
| |
| <target name="allElements"> |
| <condition property="isFetch" value="true"> |
| <equals arg1="${target}" arg2="fetchElement"/> |
| </condition> |
| <condition property="is.svn.fetch" value="true"> |
| <and> |
| <equals arg1="${target}" arg2="fetchElement"/> |
| <equals arg1="${pluginbuilder.is.svn}" arg2="true"/> |
| </and> |
| </condition> |
| |
| <antcall target="allElementsExceptSvnFetch"/> |
| <antcall target="fetchSubversion"/> |
| </target> |
| |
| <import file="allElements.xml"/> |
| <import file="subversionSupport.xml"/> |
| |
| |
| <!-- ===================================================================== --> |
| <!-- Check out map files from correct repository --> |
| <!-- Replace values for cvsRoot, package and mapVersionTag as desired. --> |
| <!-- ===================================================================== --> |
| <target name="getMapFiles" if="isCVSOrCopy"> |
| <echo message="Copying map files."/> |
| <copy todir="${buildDirectory}/maps"> |
| <fileset dir="${buildHome}/maps" includes="*.map"></fileset> |
| </copy> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do before setup --> |
| <!-- ===================================================================== --> |
| <target name="preSetup"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do after setup but before starting the build proper --> |
| <!-- ===================================================================== --> |
| <target name="postSetup"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do before fetching the build elements --> |
| <!-- ===================================================================== --> |
| <target name="preFetch"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do after fetching the build elements --> |
| <!-- ===================================================================== --> |
| <target name="postFetch"> |
| <condition property="is.fetch" value="true"> |
| <available file="${buildDirectory}/plugins"/> |
| </condition> |
| <fail unless="is.fetch" message="There was no plug-in fetched. Was the configuration generated? Is the repository correct?"/> |
| <antcall target="replaceVersions"/> |
| </target> |
| |
| <target name="replaceVersions"> |
| <fail unless="version.full" message="Property version.full must be set" /> |
| <fail unless="version.qualifier" message="Property version.qualifier must be set" /> |
| |
| <echo message="Updating versions in feature and plugin manifests. Full version: ${version.full}, qualifier: ${version.qualifier}"/> |
| <replaceregexp |
| match="(<feature[^>]*version=)"0.0.0"" |
| replace="\1"${version.full}"" |
| byline="false" |
| flags="s"> |
| <fileset dir="${buildDirectory}/features" includes="**/feature.xml"/> |
| </replaceregexp> |
| <replaceregexp |
| match="(<feature[^>]*version=".*)qualifier"" |
| replace="\1${version.qualifier}"" |
| byline="false" |
| flags="s"> |
| <fileset dir="${buildDirectory}/features" includes="**/feature.xml"/> |
| </replaceregexp> |
| <!-- in a manual build started with export from the feature.xml, there is no |
| need to replace the versions in the plugin.xml files if they are set to 0.0.0, |
| but here it needs to be --> |
| <replace dir="${buildDirectory}/plugins"> |
| <include name="**/plugin.xml"/> |
| <replacefilter token="0.0.0" value="${version.full}" /> |
| </replace> |
| <replace dir="${buildDirectory}/plugins"> |
| <include name="**/META-INF/MANIFEST.MF"/> |
| <replacefilter token="Bundle-Version: 0.0.0" value="Bundle-Version: ${version.full}" /> |
| <replacefilter token="qualifier" value="${version.qualifier}" /> |
| </replace> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do before generating the build scripts. --> |
| <!-- ===================================================================== --> |
| <target name="preGenerate"> |
| <!-- fail unless="featureVersion" message="Property featureVersion must be set. |
| Either directly or in case of a nightly build with nightlyBuildFeatureVersionPrefix." /> |
| --> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do after generating the build scripts. --> |
| <!-- ===================================================================== --> |
| <target name="postGenerate"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do before running the build.xmls for the elements being built. --> |
| <!-- ===================================================================== --> |
| <target name="preProcess"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do after running the build.xmls for the elements being built. --> |
| <!-- ===================================================================== --> |
| <target name="postProcess"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do before running assemble. --> |
| <!-- ===================================================================== --> |
| <target name="preAssemble"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do after running assemble. --> |
| <!-- ===================================================================== --> |
| <target name="postAssemble"> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Steps to do before/after packaging RCP. --> |
| <!-- ===================================================================== --> |
| <target name="prePackage"> |
| </target> |
| |
| <target name="postPackage"> |
| <!-- copy build results for rcp build --> |
| <copy todir="${buildResultsDirectory}" flatten="true"> |
| <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" /> |
| </copy> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after the build is done. --> |
| <!-- ===================================================================== --> |
| <property name="buildResultsDirectory" value="${buildDirectory}/results" /> |
| <target name="postBuild" depends="-prepareBuildResultsDirectory" unless="no.postBuild"> |
| <antcall target="runTests"/> |
| <copy todir="${buildResultsDirectory}" flatten="true"> |
| <fileset dir="${buildDirectory}" includes="${buildType}-**/*.zip" /> |
| </copy> |
| <condition property="is.External.Postbuild"> |
| <available file="${buildHome}/build-files/postBuild.xml"/> |
| </condition> |
| <antcall target="callExternalPostBuild"/> |
| </target> |
| <!-- ===================================================================== --> |
| <!-- Run tests. --> |
| <!-- ===================================================================== --> |
| <target name="runTests" if="isRunTests"> |
| <property name="automatedTestsHome" location="${buildHome}/build-files/automatedTests"/> |
| |
| <ant antfile="${automatedTestsHome}/run-tests.xml" target="run" dir="${automatedTestsHome}"> |
| <property name="test.result.dir" value="${buildResultsDirectory}/testresults"/> |
| </ant> |
| </target> |
| <!--======================================================--> |
| <!-- Gather build results --> |
| <!-- ==================================================== --> |
| <target name="-prepareBuildResultsDirectory"> |
| <echo message="Creating ${buildResultsDirectory}" /> |
| <mkdir dir="${buildResultsDirectory}" /> |
| </target> |
| |
| <!--======================================================--> |
| <!-- Call External post build file if available --> |
| <!-- ==================================================== --> |
| <target name="callExternalPostBuild" if="is.External.Postbuild"> |
| <ant antfile="${buildHome}/build-files/postBuild.xml"/> |
| </target> |
| |
| <target name="noDefault"> |
| <echo message="You must specify a target when invoking this file" /> |
| </target> |
| </project> |