| <project name="Build specific targets and properties" default="noDefault" basedir="."> |
| |
| <!-- ===================================================================== --> |
| <!-- Run a given ${target} on all elements being built --> |
| <!-- ===================================================================== --> |
| <target name="allElements"> |
| |
| <ant antfile="${genericTargets}" target="${target}" > |
| <property name="type" value="feature" /> |
| <property name="id" value="org.eclipse.ve.tests" /> |
| </ant> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Targets to assemble the built elements for particular configurations --> |
| <!-- These generally call the generated assemble scripts (named in --> |
| <!-- ${assembleScriptName}) but may also add pre and post processing --> |
| <!-- Add one target for each root element and each configuration --> |
| <!-- ===================================================================== --> |
| |
| <target name="assemble.org.eclipse.ve.tests"> |
| <property name="archiveName" value="VE-junit-tests-${buildId}.zip"/> |
| <ant antfile="${assembleScriptName}"/> |
| <!-- ADD POST STEPS --> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Check out map files from correct repository --> |
| <!-- Replace values for cvsRoot, package and mapVersionTag as desired. --> |
| <!-- ===================================================================== --> |
| <target name="checkLocal"> |
| <available property="mapsLocal" file="${buildDirectory}/maps/org.eclipse.ve.releng" /> |
| </target> |
| |
| <target name="getMapFiles" depends="checkLocal" unless="mapsLocal"> |
| |
| <!-- *** change the repo info --> |
| <property name="mapCvsRoot" value=":pserver:anonymous@dev.eclipse.org:/home/tools" /> |
| |
| <property name="mapVersionTag" value="HEAD" /> |
| <cvs cvsRoot="${mapCvsRoot}" |
| package="org.eclipse.ve.releng" |
| dest="${buildDirectory}/maps" |
| tag="${mapVersionTag}" |
| /> |
| <!--tag the map files project--> |
| <antcall target="tagMapFiles" /> |
| </target> |
| |
| <target name="tagMapFiles" if="tagMaps"> |
| <cvs dest="${buildDirectory}/maps/org.eclipse.ve.releng" command="tag v${timestamp}" /> |
| </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 the fetch --> |
| <!-- ===================================================================== --> |
| <target name="postFetch"> |
| <replace dir="${buildDirectory}/plugins" value="${buildId}" token="@buildid@"> |
| <include name="**/about.mappings" /> |
| </replace> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do before generating build scripts --> |
| <!-- ===================================================================== --> |
| <target name="preGenerate"> |
| |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after generating the build scripts --> |
| <!-- ===================================================================== --> |
| <target name="postGenerate"> |
| <antcall target="clean" /> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do before assembling --> |
| <!-- ===================================================================== --> |
| <target name="preAssemble"> |
| |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after assembling--> |
| <!-- ===================================================================== --> |
| <target name="postAssemble"> |
| </target> |
| |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do before running the build.xmls for the elements being built. --> |
| <!-- ===================================================================== --> |
| <target name="preProcess"> |
| <replace dir="${buildDirectory}/plugins" value="${buildId}" token="@build@"> |
| <include name="**/about.mappings" /> |
| </replace> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after running the build.xmls for the elements being built. --> |
| <!-- ===================================================================== --> |
| <target name="postProcess"> |
| <condition property="logsAvailable"> |
| <istrue value="${javacVerbose}"/> |
| </condition> |
| <antcall target="gatherLogs" /> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Steps to do after everything is built and assembled --> |
| <!-- (e.g., testing, posting, emailing, ...) --> |
| <!-- ===================================================================== --> |
| <target name="postBuild"> |
| <antcall target="packageTestFramework" /> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Helper targets --> |
| <!-- ===================================================================== --> |
| <target name="gatherLogs" if="logsAvailable"> |
| <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" /> |
| <antcall target="allElements"> |
| <param name="target" value="gatherLogs" /> |
| </antcall> |
| |
| <unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true"> |
| <fileset dir="${buildDirectory}/features/org.eclipse.ve.tests"> |
| <include name="*.log.zip" /> |
| </fileset> |
| </unzip> |
| </target> |
| <target name="clean" unless="noclean"> |
| <antcall target="allElements"> |
| <param name="target" value="cleanElement" /> |
| </antcall> |
| </target> |
| |
| <target name="packageTestFramework"> |
| <!--package automated test framework used in GEF builds--> |
| |
| <property name="workingDirectory" value="${buildDirectory}/test.assembly" /> |
| |
| <!--unzip the junit tests--> |
| <exec dir="${buildDirectory}/${buildLabel}" executable="unzip"> |
| <arg line="-o -qq VE*junit*.zip -d ${workingDirectory}" /> |
| </exec> |
| |
| <!-- create top level testing directory--> |
| <delete dir="${workingDirectory}/ve-testing"/> |
| <mkdir dir="${workingDirectory}/ve-testing" /> |
| |
| <!--compile the tool used to generate the test.properties file, then run it.--> |
| <!--test.properties maps test plugin id's to the name of the plugin directory--> |
| |
| <!--eclipse.home is relative to the scripts directory in the org.eclipse.pde.build plugin. Assume the plugins used in the classpath are in the same directory as org.eclipse.pde.build--> |
| <property name="eclipse.home" value="../../.." /> |
| |
| <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> |
| <javac verbose="true" failonerror="true" srcdir="${builderDirectory}/tools" destdir="${builderDirectory}/tools" classpath="${eclipse.home}/plugins/org.apache.xerces_4.0.13/xercesImpl.jar:${eclipse.home}/plugins/org.apache.xerces_4.0.13/xmlParserAPIs.jar"/> |
| |
| <java classname="TestVersionTracker" > |
| <arg line="${workingDirectory}/eclipse/features/org.eclipse.ve.tests_0.5.0/feature.xml ${buildDirectory} ${workingDirectory}/ve-testing/test.properties" /> |
| <classpath> |
| <pathelement path="${eclipse.home}/plugins/org.apache.xerces_4.0.13/xercesImpl.jar:${eclipse.home}/plugins/org.apache.xerces_4.0.13/xmlParserAPIs.jar:${builderDirectory}/tools" /> |
| </classpath> |
| </java> |
| |
| <!--load the property file created with the directory names for all test plugins--> |
| <property file="${workingDirectory}/ve-testing/test.properties" /> |
| |
| <!-- Remove the plugin version number appended to the org.eclipse.test plugin directory. |
| This is so that contributors of test.xml's do not have to update their paths to |
| library.xml in org.eclipse.test whenever its version is updated. |
| --> |
| <move todir="${workingDirectory}/eclipse/plugins/org.eclipse.test"> |
| <fileset dir="${workingDirectory}/eclipse/plugins/${org.eclipse.test}" /> |
| </move> |
| |
| <!--the Ant move task leaves behind an empty directory--> |
| <delete dir="${workingDirectory}/eclipse/plugins/${org.eclipse.test}" includeEmptyDirs="true" /> |
| |
| <!-- rezip the JUnit plugin tests --> |
| <exec dir="${workingDirectory}" executable="zip"> |
| <arg line="-r -q VE-junit-tests-${buildId}.zip eclipse"/> |
| </exec> |
| |
| <delete dir="${workingDirectory}/eclipse" includeEmptyDirs="true" /> |
| |
| <!--Copy scripts and doc used in the automated testing to the testing directory--> |
| <copy todir="${workingDirectory}/ve-testing"> |
| <fileset dir="${buildDirectory}/plugins/org.eclipse.test" includes="testframework.html,JUNIT.XSL" /> |
| </copy> |
| <copy todir="${workingDirectory}/ve-testing"> |
| <fileset dir="${builderDirectory}/testScripts" /> |
| </copy> |
| <move file="${workingDirectory}/VE-junit-tests-${buildId}.zip" todir="${workingDirectory}/ve-testing"/> |
| |
| <!--copy in the file containing the URL of the Eclipse build used for testing--> |
| <copy todir="${workingDirectory}/ve-testing" file="${buildDirectory}/maps/org.eclipse.ve.releng/maps/build.cfg" /> |
| |
| <!--set execute permission on *nix shell script--> |
| <chmod file="${workingDirectory}/ve-testing/runtests" perm="755"/> |
| |
| <!--create zip file of the automated testing framework--> |
| <exec dir="${workingDirectory}" executable="zip"> |
| <arg line="-r -q ${buildDirectory}/${buildLabel}/VE-Automated-Tests-${buildId}.zip ve-testing"/> |
| </exec> |
| |
| <delete file="${buildDirectory}/${buildLabel}/VE-junit-tests-${buildId}.zip" /> |
| </target> |
| |
| <!-- ===================================================================== --> |
| <!-- Default target --> |
| <!-- ===================================================================== --> |
| <target name="noDefault"> |
| <echo message="You must specify a target when invoking this file" /> |
| </target> |
| |
| </project> |