blob: fa5161f977eff8c1523f1d2bd2e74c9588ae9bc4 [file] [log] [blame]
nickboldt03a6f082019-02-12 15:17:11 -05001<!--
2 Copyright (c) 2009, 2019 IBM Corporation and others.
3 This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License 2.0
5 which accompanies this distribution, and is available at
6 https://www.eclipse.org/legal/epl-2.0/
7
8 SPDX-License-Identifier: EPL-2.0
9
10 Contributors:
11 IBM Corporation - initial API and implementation
12 -->
david_williams0ecd8ec2009-11-09 04:16:21 +000013<project
14 name="Build specific targets and properties"
15 default="build"
16 basedir=".">
17 <!--
18 Note to be cross-platform, "environment variables" are only
19 appropriate for some variables, e.g. ones we set, since
20 properties are case sensitive, even if the environment variables
21 on your operating system are not, e.g. it will be ${env.Path}
22 not ${env.PATH} on Windows
23 -->
david_williams2398e362011-03-05 02:45:39 +000024 <property environment="env"/>
david_williams0ecd8ec2009-11-09 04:16:21 +000025 <!--
26 Let users override standard properties, if desired. If
27 directory, file, or some properties do not exist, then standard
28 properties will be used.
29 -->
david_williams2398e362011-03-05 02:45:39 +000030 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
david_williams0ecd8ec2009-11-09 04:16:21 +000031
32 <!-- = = = end standard properties pattern = = = -->
david_williams14cadd12011-03-23 06:43:39 +000033 <echo level="debug" message="ant.file: ${ant.file}"/>
david_williams2398e362011-03-05 02:45:39 +000034 <target name="build">
david_williams9e7f5842011-03-06 03:32:03 +000035
36 <!-- make sure there is a base builder, since we need the launcher -->
david_williams2398e362011-03-05 02:45:39 +000037 <ant
38 antfile="${wtp.builder.home}/scripts/build/runbuild.xml"
39 target="getBaseBuilder"/>
david_williamsba00a342011-03-12 05:11:19 +000040 <condition
41 property="antQuietValue"
42 value="-quiet"
43 else="">
44 <istrue value="${env.USE_QUIET}"/>
45 </condition>
david_williams7802d892011-03-06 08:13:58 +000046 <!-- TODO: should set 'failonerror' to false, and follow up with error
47 check and appropriate cleanup/finishup actions before failing -->
david_williams2398e362011-03-05 02:45:39 +000048
david_williams0ecd8ec2009-11-09 04:16:21 +000049 <java
david_williams0ecd8ec2009-11-09 04:16:21 +000050 fork="true"
david_williamsef62fc42011-03-18 02:33:39 +000051 failonerror="true"
52 classname="org.eclipse.equinox.launcher.Main">
53 <classpath>
54 <fileset dir="${pde.builder.path}/plugins">
55 <include name="org.eclipse.equinox.launcher_*.jar"/>
56 </fileset>
57 </classpath>
david_williams2398e362011-03-05 02:45:39 +000058 <jvmarg value="-Dosgi.ws=${env.BASEWS}"/>
59 <jvmarg value="-Dosgi.os=${env.BASEOS}"/>
60 <jvmarg value="-Dosgi.arch=${env.BASEARCH}"/>
61 <jvmarg value="-Dbuild.donottagmaps=${build.donottagmaps}"/>
62 <jvmarg value="-DbuildBranch=${buildBranch}"/>
63 <jvmarg value="-DbuildType=${buildType}"/>
64 <jvmarg value="-DdependencyFileLocation=${dependencyFileLocation}"/>
david_williamsbf62a202010-09-27 05:03:32 +000065
david_williams2398e362011-03-05 02:45:39 +000066 <jvmarg value="-DbuildId=${buildId}"/>
67 <jvmarg value="-DmapVersionTag=${mapVersionTag}"/>
68 <jvmarg value="-Dbuild.distribution=${build.distribution}"/>
69 <jvmarg value="-DbuildDirectory=${buildDirectory}"/>
70 <jvmarg value="-Dwtp.builder.home=${wtp.builder.home}"/>
71 <jvmarg value="-Dprojectname=${projectname}"/>
72 <jvmarg value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
david_williams204cb1e2011-09-25 04:34:37 +000073 <jvmarg value="-Djava.protocol.handler.pkgs=org.eclipse.wtp.releng.www.protocol"/>
david_williams2398e362011-03-05 02:45:39 +000074 <jvmarg value="-DurlLogLocation=${buildDirectory}/${buildLabel}/outgoinghttplogfromsitebuild.log"/>
75 <arg value="-data"/>
76 <arg value="${basedir}/workspace"/>
77 <arg value="-application"/>
78 <arg value="org.eclipse.ant.core.antRunner"/>
david_williamsba00a342011-03-12 05:11:19 +000079 <arg value="${antQuietValue}"/>
david_williams2398e362011-03-05 02:45:39 +000080 <arg value="-buildfile"/>
81 <arg value="${ant.file}"/>
82 <arg value="publish"/>
david_williams0ecd8ec2009-11-09 04:16:21 +000083 </java>
84 </target>
85 <!--
86 =====================================================================
87 -->
88 <!-- Steps to do to publish the build results -->
89 <!--
90 =====================================================================
91 -->
david_williams2398e362011-03-05 02:45:39 +000092 <target name="publish">
david_williams0ecd8ec2009-11-09 04:16:21 +000093 <dirname
94 file="${ant.file}"
95 property="component.dir"/>
david_williams2398e362011-03-05 02:45:39 +000096 <ant antfile="${wtp.builder.home}/scripts/build/label.xml"/>
97 <property file="${buildDirectory}/label.properties"/>
david_williamsc9750b22011-03-06 06:36:01 +000098
99 <!-- buildLabel is defined in label.properties -->
100 <mkdir dir="${buildDirectory}/${buildLabel}"/>
101
david_williams0ecd8ec2009-11-09 04:16:21 +0000102 <property
103 name="publish.xml"
104 value="${component.dir}/publish.xml"/>
105 <property
106 name="indexFileName"
107 value="index.php"/>
108 <property
109 name="result"
110 value="${buildDirectory}/${buildLabel}"/>
111 <property
112 name="indexTemplateFilename"
113 value="index.html.template.php"/>
david_williams5de0a3e2010-08-23 00:54:53 +0000114
david_williams0ecd8ec2009-11-09 04:16:21 +0000115 <condition
116 property="isBuildTested"
117 value="true">
david_williams2398e362011-03-05 02:45:39 +0000118 <available file="${buildDirectory}/${buildLabel}/testResults/html"/>
david_williams0ecd8ec2009-11-09 04:16:21 +0000119 </condition>
120 <ant
121 antfile="${publish.xml}"
122 dir="${component.dir}">
123 <property
124 name="dropTokenList"
125 value="%wtpruntime%,%wtpsdk%,%wtptest%,%wst%,%wst-sdk%,%wst-tests%,%jst-tests%,%wst-perf-tests%,%jst-perf-tests%,%jpt-runtime%,%jpt-sdk%,%jpt-tests%"/>
126 <property
127 name="webtoolsDownloadURL"
128 value="http://www.eclipse.org/downloads/download.php?file=/webtools/committers/drops"/>
129 <property
130 name="buildBranch"
131 value="${buildBranch}"/>
132 <property
133 name="isBuildTested"
134 value="${isBuildTested}"/>
135 <property
136 name="indexTemplateFilename"
137 value="${indexTemplateFilename}"/>
138 </ant>
139
140 <!-- Get the build map over for the results to point to. -->
141 <copy
david_williamsc9750b22011-03-06 06:36:01 +0000142 failonerror="false"
david_williams0ecd8ec2009-11-09 04:16:21 +0000143 file="${buildDirectory}/directory.txt"
144 tofile="${result}/directory.txt"/>
145
146 <!-- Copy info for build identification -->
147 <copy
david_williamsc9750b22011-03-06 06:36:01 +0000148 failonerror="false"
david_williams1ae20302010-09-11 01:34:56 +0000149 file="${buildDirectory}/label.properties"
150 tofile="${result}/label.properties"/>
david_williams0ecd8ec2009-11-09 04:16:21 +0000151
152 <!-- http access logs -->
153 <copy
154 todir="${result}/"
155 failonerror="false">
156 <fileset
157 dir="${buildDirectory}"
158 includes="*.log"/>
159 </copy>
160
161 <!-- ant build log, from control directory -->
162 <copy
163 todir="${result}/"
164 failonerror="false">
165 <fileset
166 dir="${env.ANT_WORKING}/${projectname}"
167 includes="antBuilderOutput.log"/>
168 </copy>
david_williams5e5f04f2011-03-07 20:07:42 +0000169
david_williams0ecd8ec2009-11-09 04:16:21 +0000170 <!-- final count files -->
171 <countBuildFiles
172 sourceDirectory="${buildDirectory}/${buildLabel}"
173 filterString=".zip,.tar.gz"
174 outputFile="${buildDirectory}/${buildLabel}/files.count"/>
175 </target>
176</project>