-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
134 lines (114 loc) · 5.87 KB
/
build.xml
File metadata and controls
134 lines (114 loc) · 5.87 KB
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
<!--
/**
* © Copyright IBM Corporation 2016.
* This is licensed under the following license.
* The Eclipse Public 1.0 License (http://www.eclipse.org/legal/epl-v10.html)
* U.S. Government Users Restricted Rights: Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
-->
<project name="plugin-mobilefirst-MaaS360" default="main" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="src.dir" value="${basedir}/src" />
<property name="build.dir" value="${basedir}/build" />
<property name="plugin.dir" value="${basedir}/plugin" />
<property name="license.dir" value="${basedir}/license" />
<property name="doc.dir" value="${basedir}/doc" />
<property name="bin.dir" value="${basedir}/bin" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="lib.build.dir" value="${lib.dir}/build" />
<property name="lib.build.classes.dir" value="${lib.build.dir}/classes" />
<property name="lib.test.dir" value="${lib.dir}/test" />
<property name="scripts.dir" value="${basedir}/scripts" />
<property name="imports.dir" value="${basedir}/imports" />
<property name="version" value="dev" />
<property name="deployPluginArchiveName" value="releases/IBM-MaaS360-UCD-v${version}.zip" />
<!-- ================================================================== -->
<!-- PATHS -->
<!-- ================================================================== -->
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classpath.build">
<fileset dir="${lib.build.dir}">
<include name="*.jar"/>
</fileset>
<path refid="classpath"/>
</path>
<!-- =================================================== -->
<!-- MAIN TARGET -->
<!-- =================================================== -->
<target name="main" depends="clean, resolve, build, dist" />
<!-- Copy in the dependencies -->
<target name="build" depends="resolve, compile-classes">
<!-- Copy inputs (info, upgrade, plugin) -->
<copy todir="${build.dir}">
<fileset dir="${plugin.dir}">
</fileset>
</copy>
<!-- Copy Scripts -->
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<exclude name="**/java/" />
<exclude name="**/groovy/" />
</fileset>
</copy>
<!-- Copy License -->
<mkdir dir="${build.dir}/license"/>
<copy todir="${build.dir}/license">
<fileset dir="${license.dir}">
<include name="EPL.txt" />
</fileset>
</copy>
<!-- Copy Groovy Classes -->
<mkdir dir="${build.dir}/classes"/>
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}/groovy">
<include name="**/*.groovy" />
</fileset>
</copy>
<mkdir dir="${build.dir}/lib"/>
<!-- Copy Libraries -->
<copy todir="${build.dir}/lib">
<fileset dir="${lib.dir}">
<exclude name="**/build/" />
<exclude name="**javadoc.jar" />
<exclude name="**sources.jar" />
</fileset>
</copy>
</target>
<!-- Build the actual zip file that gets uploaded to uDeploy -->
<target name="dist" depends="resolve">
<zip destfile="${deployPluginArchiveName}" basedir="${build.dir}" update="false"/>
</target>
<!-- Clean up the build directory -->
<target name="clean">
<delete dir="build" />
<mkdir dir="build" />
<delete file="${deployPluginArchiveName}" />
<delete dir="${lib.build.classes.dir}" />
</target>
<!-- =================================================== -->
<!-- COMPILE TARGETS -->
<!-- =================================================== -->
<target name="compile-classes" description="Compile Java classes." depends="resolve">
<mkdir dir="${lib.build.classes.dir}"/>
<javac srcdir="${src.dir}/java" destdir="${lib.build.classes.dir}" includeantruntime="false">
<include name="**/*.java"/>
<classpath refid="classpath.build"/>
</javac>
<jar destfile="${build.dir}/lib/mobilefirst-fiberlink.jar" basedir="${lib.build.classes.dir}" />
</target>
<target name="resolve" depends="install-ivy" unless="resolve.no" description="Resolve all dependencies">
<mkdir dir="${lib.dir}"/>
<ivy:retrieve conf="default" pattern="${lib.dir}/[artifact]-[revision](-[classifier]).[ext]"/>
</target>
<!-- Install Ivy -->
<available classname="org.apache.ivy.Main" property="ivy.installed"/>
<target name="install-ivy" description="Install ivy" unless="ivy.installed">
<property name="antHome" value="${user.home}${file.separator}.ant"/>
<mkdir dir="${antHome}"/>
<get dest="${antHome}${file.separator}lib${file.separator}ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.3.0/ivy-2.3.0.jar"/>
<fail message="SUCCESS! Ivy has been installed in ${antHome}. Run the build again.${line.separator}Note: If you get this message more than once, trying specify your Ant's home directory with the flag: ant -DantHome='ant/home/directory/here'" />
</target>
</project>