blob: 2c2d4df338f3ed89b19fc85967aa14cc30bc71e5 [file] [log] [blame]
david_williams58d71292009-11-02 01:22:42 +00001<?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 A utility ant script to invoke AntRunner application with
4 Eclipse. This is handy since some ant scripts are running in
5 plain ant, but we'd like to use Eclipse's ant tasks for things
6 like p2 operations.
7 -->
8<project
9 name="runAntRunner"
10 default="runAntRunner"
11 basedir=".">
12
13 <!-- = = = standard properties pattern = = = -->
14 <!--
15 Note to be cross-platform, "environment variables" are only
16 appropriate for some variables, e.g. ones we set, since
17 properties are case sensitive, even if the environment variables
18 on your operating system are not, e.g. it will be ${env.Path}
19 not ${env.PATH} on Windows
20 -->
21 <property
22 environment="env"/>
23 <!--
24 Let users override standard properties, if desired. If
25 directory, file, or some properties do not exist, then standard
26 properties will be used.
27 -->
28 <property
29 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
30
31 <!-- = = = end standard properties pattern = = = -->
32 <fail
33 unless="env.BUILD_HOME"
34 message="all scripts need a BUILD_HOME"/>
35 <echo
36 level="info"
37 message="buildDirectory: ${buildDirectory}"/>
38 <property
39 name="keyCfgFile"
40 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
41 <echo
42 level="debug"
43 message="keyCfgFile: ${keyCfgFile}"/>
44 <property
45 file="${keyCfgFile}"/>
46 <fail
47 unless="builderVersion"
48 message="Could not get builderVersion. Probably could not checkout build.cfg?"/>
49 <fail
50 unless="eclipse.builder.version"
51 message="Could not get eclipse.builder.version. Perhaps an old format build.cfg?"/>
52 <property
53 name="basebuilder.path"
54 value="${env.BASE_BUILDERS}/${eclipse.builder.version}"/>
55 <property
56 name="failOnError"
57 value="true"/>
58
59 <!-- if not set by caller, be sure it is empty string -->
60 <property
61 name="antrunnertarget"
62 value="build"/>
63 <fail
64 unless="antrunnerfile"
65 message="Must provide ant file to run"/>
66 <target
67 name="runAntRunner">
68
69 <!-- long term we should make this sensitive to if already running in eclipse, and if so,
70 just invoke the script? check if="eclipse.running" -->
david_williamse567fd42009-11-19 05:14:40 +000071 <mkdir dir="${buildDirectory}/${buildLabel}"/>
david_williams58d71292009-11-02 01:22:42 +000072 <java
73 taskname="AntRunner"
74 jar="${eclipse.launcher}"
75 fork="true"
76 failonerror="${failOnError}">
77 <jvmarg
78 value="-Djava.protocol.handler.pkgs=com.ibm.etools.www.protocol"/>
79 <jvmarg
david_williams07b96ab2009-11-18 16:28:38 +000080 value="-DurlLogLocation=${buildDirectory}/${buildLabel}/outgoinghttplog-antrunner.log"/>
david_williams58d71292009-11-02 01:22:42 +000081 <jvmarg
82 value="-Dosgi.ws=${env.BASEWS}"/>
83 <jvmarg
84 value="-Dosgi.os=${env.BASEOS}"/>
85 <jvmarg
86 value="-Dosgi.arch=${env.BASEARCH}"/>
87 <jvmarg
88 value="-Dbuild.home=${env.BUILD_HOME}"/>
89 <jvmarg
90 value="-DJAVA_6_HOME=${env.JAVA_6_HOME}"/>
91 <jvmarg
92 value="-DJAVA_5_HOME=${env.JAVA_5_HOME}"/>
93 <jvmarg
94 value="-DJAVA_4_HOME=${env.JAVA_4_HOME}"/>
95 <jvmarg
96 value="-Declipse.builder.version=${eclipse.builder.version}"/>
97 <jvmarg
98 value="-Declipse.builder=${eclipse.builder}"/>
99 <jvmarg
100 value="-Dprojectname=${projectname}"/>
101 <jvmarg
102 value="-DbuildDirectory=${buildDirectory}"/>
103 <jvmarg
104 value="-DbuildLabel=${buildLabel}"/>
105 <jvmarg
106 value="-Dwtp.builder.home=${wtp.builder.home}"/>
107 <jvmarg
108 value="-Dbuild.distribution=${build.distribution}"/>
109 <jvmarg
110 value="-Dcomponent=${component}"/>
111 <jvmarg
112 value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/>
david_williams07b96ab2009-11-18 16:28:38 +0000113 <jvmarg
114 value="-Dosgi.instance.area=${buildDirectory}/${buildLabel}/antrunnerworkspace" />
david_williams58d71292009-11-02 01:22:42 +0000115 <arg
116 value="-application"/>
117 <arg
118 value="org.eclipse.ant.core.antRunner"/>
119 <arg
120 value="-buildfile"/>
121 <arg
122 value="${antrunnerfile}"/>
123 <arg
124 value="${antrunnertarget}"/>
125 </java>
126 </target>
127</project>