mwenz | a3bacde | 2010-07-07 14:11:25 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <!-- |
| 3 | Copyright (c) 2005, 2010 SAP AG. |
| 4 | All rights reserved. This program and the accompanying materials |
| 5 | are made available under the terms of the Eclipse Public License v1.0 |
| 6 | which accompanies this distribution, and is available at |
| 7 | http://www.eclipse.org/legal/epl-v10.html |
| 8 | |
| 9 | Contributors: |
| 10 | Cloudsmith Inc - build.xml for Buckminster project |
| 11 | Martin Taal - changes for Teneo |
| 12 | Michael Wenz - changes for Graphiti |
| 13 | |
| 14 | The Teneo teneo_build.xml was used as a template for creating this file: |
| 15 | http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.teneo/releng/org.eclipse.emf.teneo.releng.buckminster/test/teneo_build.xml?root=Modeling_Project&view=log |
| 16 | |
| 17 | Some important parts have been copied from Buckminster's own build setup: |
| 18 | http://dev.eclipse.org/viewsvn/index.cgi/trunk/org.eclipse.buckminster.releng/build.xml?root=Tools_BUCKMINSTER&view=markup |
| 19 | --> |
| 20 | |
| 21 | <project default="run" name="Graphiti Tests"> |
| 22 | <!-- load properties and set timestamp for the build --> |
| 23 | <property environment="env"/> |
| 24 | |
| 25 | <!-- |
| 26 | Inherited properties: |
| 27 | buildRoot: the root of this build |
| 28 | toolsPath: path containing buckminster |
| 29 | buildSitePath: the path to which the p2 site should be copied |
| 30 | buildZipsPath: the path to the directory with zip files |
| 31 | |
| 32 | buckminster.output.root |
| 33 | buckminster.temp.root |
| 34 | --> |
| 35 | |
| 36 | <property name="targetPlatformPath" location="${testRoot}/tp"/> |
| 37 | <property name="workspacePath" location="${testRoot}/workspace"/> |
| 38 | |
| 39 | <import file="../ant_common.xml" /> |
| 40 | |
| 41 | <target name="run" depends="init,init.build.properties"> |
| 42 | <echo message="Using workspace ${workspacePath}" /> |
| 43 | |
| 44 | <echo message="Setting jre to ${env.JAVA_HOME}"/> |
| 45 | <buckminster command="installJRE" workspace="${workspacePath}"> |
| 46 | <cmdargs> |
| 47 | <arg value="--location" /> |
| 48 | <arg value="${env.JAVA_HOME}" /> |
| 49 | </cmdargs> |
| 50 | </buckminster> |
| 51 | |
| 52 | <echo message="Setting targetPlatformPath to ${targetPlatformPath}" /> |
| 53 | <buckminster command="setpref" workspace="${workspacePath}"> |
| 54 | <cmdargs> |
| 55 | <arg value="targetPlatformPath=${targetPlatformPath}" /> |
| 56 | </cmdargs> |
| 57 | </buckminster> |
| 58 | |
| 59 | <echo message="Importing projects into workspace ${workspacePath} and"/> |
| 60 | <echo message="importing binaries into target platform ${targetPlatformPath}" /> |
| 61 | <buckminster command="import" workspace="${workspacePath}"> |
| 62 | <cmdargs> |
| 63 | <arg value="${basedir}/graphiti.mspec" /> |
| 64 | </cmdargs> |
| 65 | </buckminster> |
| 66 | |
| 67 | <echo message="Building tests" /> |
| 68 | <buckminster command="build" workspace="${workspacePath}"> |
| 69 | <cmdargs> |
| 70 | <arg value="--thorough" /> |
| 71 | </cmdargs> |
| 72 | </buckminster> |
| 73 | |
| 74 | <echo message="Running JUnit tests for Graphiti" /> |
| 75 | <buckminster command="emma" workspace="${workspacePath}"> |
| 76 | <cmdargs> |
| 77 | <arg value="-l" /> |
| 78 | <arg value="org.eclipse.graphiti.tests/AllJunitTests.launch" /> |
| 79 | <arg value="-o" /> |
| 80 | <arg value="${testResultsPath}/output/JUnit-graphiti-results.xml" /> |
| 81 | <arg value="--stdout" /> |
| 82 | <arg value="${testResultsPath}/output/JUnit-graphiti-stdout.txt" /> |
| 83 | <arg value="--stderr" /> |
| 84 | <arg value="${testResultsPath}/output/JUnit-graphiti-stderr.txt" /> |
| 85 | <arg value="--xml" /> |
| 86 | <arg value="${testResultsPath}/output/JUnit-graphiti-coverageReport.xml" /> |
| 87 | <arg value="--flatXML"/> |
| 88 | </cmdargs> |
| 89 | </buckminster> |
| 90 | |
| 91 | <echo message="Running JUnit tests for Graphiti UI" /> |
| 92 | <buckminster command="emma" workspace="${workspacePath}"> |
| 93 | <cmdargs> |
| 94 | <arg value="-l" /> |
| 95 | <arg value="org.eclipse.graphiti.ui.tests/AllJunitUiTests.launch" /> |
| 96 | <arg value="-o" /> |
| 97 | <arg value="${testResultsPath}/output/JUnit-graphitiUI-results.xml" /> |
| 98 | <arg value="--stdout" /> |
| 99 | <arg value="${testResultsPath}/output/JUnit-graphitiUI-stdout.txt" /> |
| 100 | <arg value="--stderr" /> |
| 101 | <arg value="${testResultsPath}/output/JUnit-graphitiUI-stderr.txt" /> |
| 102 | <arg value="--xml" /> |
| 103 | <arg value="${testResultsPath}/output/JUnit-graphitiUI-coverageReport.xml" /> |
| 104 | <arg value="--flatXML"/> |
| 105 | </cmdargs> |
| 106 | </buckminster> |
| 107 | |
| 108 | <!-- convert the xml to a format which can be read by junit report> |
| 109 | NOTE: not used anymore, the flatXML argument now takes care of this |
| 110 | <xslt in="${testResultsPath}/output/test-results-graphiti.xml" out="${testResultsPath}/xml/TESTS-graphiti.xml" style="convert-test-results.xsl"> |
| 111 | <param name="timeStamp" expression="${buildTimeStamp}" /> |
| 112 | <param name="testName" expression="Graphiti Tests" /> |
| 113 | <param name="testPackage" expression="org.eclipse.graphiti.tests" /> |
| 114 | </xslt--> |
| 115 | </target> |
| 116 | |
| 117 | <target name="init"> |
| 118 | <mkdir dir="${targetPlatformPath}"/> |
| 119 | <mkdir dir="${workspacePath}"/> |
| 120 | </target> |
| 121 | |
| 122 | <target name="init.build.properties"> |
| 123 | <!-- Echo relevant properties to a temporary file so that Buckminster can read them |
| 124 | --> |
| 125 | <tempfile destdir="${java.io.tmpdir}" prefix="build-" suffix=".properties" deleteonexit="true" property="properties.tmp" /> |
| 126 | <echoproperties destfile="${properties.tmp}"> |
| 127 | <!-- We don't want these. basedir in particular will cause problems if passed explicitly --> |
| 128 | <propertyset negate="true"> |
| 129 | <propertyref name="basedir" /> |
| 130 | <propertyref name="eclipse.home" /> |
| 131 | <propertyref name="properties.tmp" /> |
| 132 | <propertyref name="line.separator" /> |
| 133 | <propertyref name="path.separator" /> |
| 134 | <propertyref prefix="ant." /> |
| 135 | <propertyref prefix="file." /> |
| 136 | <propertyref prefix="java." /> |
| 137 | <propertyref prefix="sun." /> |
| 138 | <propertyref prefix="user." /> |
| 139 | </propertyset> |
| 140 | </echoproperties> |
| 141 | </target> |
| 142 | </project> |