-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
138 lines (121 loc) · 3.56 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="kony" basedir="." default="main">
<target name="main">
<property name="antjar.file" value="${basedir}/ant-contrib-0.6.jar"/>
<echo message="Looking for JAR antcontrib.jar at : ${antjar.file}"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${antjar.file}"/>
</classpath>
</taskdef>
<osfamily property="os.family"/>
<echo message="Started script..."/>
<property name="input.file" location="${basedir}/HeadlessBuild.properties"/>
<if>
<available file="../HeadlessBuild-Global.properties"/>
<then>
<property name="global.available" value="true"/>
</then>
<else>
<property name="global.available" value="false"/>
</else>
</if>
<if>
<equals arg1="${global.available}" arg2="true"/>
<then>
<property name="global.file" location="../HeadlessBuild-Global.properties"/>
</then>
<else>
<property name="global.file" location="${basedir}/HeadlessBuild-Global.properties"/>
</else>
</if>
<property name="globalprop.file" location="../HeadlessBuild-Global.properties"/>
<echo message="Global properties file LOCATION: ${global.file}"/>
<echo message="Build properties file LOCATION: ${input.file}"/>
<if>
<or>
<not>
<available file="${input.file}"/>
</not>
<not>
<available file="${global.file}"/>
</not>
</or>
<then>
<fail message="Either ${input.file}
or
${globalprop.file}
doesn't exist"/>
</then>
</if>
<property file="${input.file}"/>
<property file="${global.file}"/>
<if>
<equals arg1="${workspace.location}" arg2=""/>
<then>
<property name = "ws.location" value ="../" />
</then>
<else>
<property name = "ws.location" value ="${workspace.location}"/>
</else>
</if>
<echo message="WORKSPACE LOCATION: ${ws.location}"/>
<if>
<equals arg1="${project.name}" arg2=""/>
<then>
<fail message="Project name is not given.
Please set 'project.name' property in ${input.file}"/>
</then>
<else>
<if>
<not>
<available file="${ws.location}/${project.name}" type="dir"/>
</not>
<then>
<fail message="Project '${project.name}' doesn't exist in ${ws.location}"/>
</then>
</if>
</else>
</if>
<if>
<equals arg1="${eclipse.equinox.path}" arg2=""/>
<then>
<fail message="Please set 'eclipse.equinox.path' property in ${global.file}"/>
</then>
<else>
<if>
<not>
<available file="${eclipse.equinox.path}"/>
</not>
<then>
<fail message="The path provided for 'eclipse.equinox.path' property in ${global.file} is not present.."/>
</then>
</if>
</else>
</if>
<property name="gradle.file" location="${eclipse.equinox.path}/../../../gradle/bin"/>
<echo message="Gradle path is ${gradle.file}"/>
<if>
<equals arg1="${os.family}" arg2="windows"/>
<then>
<exec dir="." executable="cmd" failonerror="true">
<arg value="/c"/>
<arg value="run.bat"/>
<arg value="${input.file}"/>
<arg value="${ws.location}"/>
<arg value="${eclipse.equinox.path}"/>
<arg value="${global.file}"/>
</exec>
</then>
<else>
<exec dir="." executable="/bin/bash" failonerror="true">
<arg line='-c "chmod 777 run.sh"'/>
</exec>
<exec dir="." executable="/bin/bash" failonerror="true">
<arg line='-c "sh run.sh ${input.file} ${ws.location} ${eclipse.equinox.path} ${global.file} ${gradle.file}"'/>
</exec>
</else>
</if>
<echo message="Ending script..."/>
</target>
</project>