-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
160 lines (146 loc) · 6.48 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="UTF-8"?>
<project name="Thinklab build file" default="help" basedir=".">
<property name="app.name" value="thinklab" />
<property name="app.version" value="0.8.0" />
<property environment="env"/>
<property name="build.home" value="${basedir}/build" />
<property name="thinklab.inst" value="${env.THINKLAB_HOME}"/>
<path id="classpath">
<fileset dir="lib" includes="*.jar" />
</path>
<typedef resource="org/java/plugin/tools/ant/jpf-tasks.properties">
<classpath refid="classpath" />
</typedef>
<target name="help">
<echo>
<![CDATA[
${app.name} build file:
clean - cleans up the project build folder
build - builds entire project
run - runs application
check - checks plug-ins integrity
docs - generates plug-ins documentation
dist - creates binary and source distribution packages
test - runs some tests
]]>
</echo>
</target>
<target name="clean" description="Cleans up the project build folder">
<tstamp>
<format property="dt-stamp" pattern="yyyy-MM-dd-HH-mm" />
<format property="d-stamp" pattern="yyyy-MM-dd" />
</tstamp>
<delete dir="${build.home}" quiet="true" />
</target>
<target name="-init">
<mkdir dir="${build.home}" />
</target>
<target name="-build-plugins">
<mkdir dir="${build.home}/plugins" />
<ant dir="plugins/org.integratedmodelling.thinklab.core" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.opal" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.searchengine" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.agriculture" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.sql" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.authentication" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.idv" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.commandline" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.riskwiz" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.clojure" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.shell" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.corescience" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.mca" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.geospace" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.time" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.currency" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.dolce" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.dynamicmodelling" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.modelling" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.ecology" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.metadata" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.rules" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.thinkscape" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.workflow" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.tclj" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.http" target="${target}" />
<ant dir="plugins/org.integratedmodelling.thinklab.http.geospace" target="${target}" />
</target>
<target name="build" depends="-init" description="Builds entire project">
<antcall target="-build-plugins">
<param name="target" value="build" />
</antcall>
<copy todir="${build.home}/lib">
<fileset dir="lib" includes="*.jar" />
</copy>
<copy todir="${build.home}">
<fileset dir="." includes="bin/*.*,etc/**.*,hooks/*.*,*.*" excludes=".*,todo*" />
</copy>
<jpf-version basedir="${build.home}/plugins"
includes="*/plugin.xml,*/plugin-fragment.xml"
versionsfile="${basedir}/plugins/versions.properties"
timestampversion="true" />
</target>
<target name="run" depends="build" description="Runs application">
<java jar="${build.home}/lib/im-boot.jar"
dir="${build.home}"
fork="true" />
</target>
<target name="check"
depends="build"
description="Checks plug-ins integrity">
<jpf-check basedir="${basedir}/plugins"
includes="*/plugin.xml,*/plugin-fragment.xml"
verbose="true"
usepathresolver="true" />
</target>
<target name="docs"
depends="build"
description="Generates plug-ins documentation">
<delete dir="${build.home}/docs" />
<mkdir dir="${build.home}/docs" />
<antcall target="-build-plugins">
<param name="target" value="docs" />
</antcall>
<jpf-doc basedir="${build.home}/plugins"
includes="*/plugin.xml,*/plugin-fragment.xml"
destdir="${build.home}/docs" />
</target>
<target name="install"
depends="build"
description="Install thinklab in THINKLAB_HOME (must be defined)">
<copy todir="${thinklab.inst}">
<fileset dir="${build.home}" includes="bin,**/*" />
</copy>
<chmod file="${thinklab.inst}/bin/thinklab.sh" perm="755"/>
<chmod file="${thinklab.inst}/bin/tclj.sh" perm="755"/>
</target>
<target name="dist"
depends="clean,build,docs"
description="Prepares distribution packages">
<zip destfile="${build.home}/${app.name}-bin-${app.version}.zip"
duplicate="fail"
update="false">
<fileset dir="${build.home}" includes="bin,**/*" />
</zip>
<zip destfile="${build.home}/${app.name}-src-${app.version}.zip"
duplicate="fail"
update="false">
<fileset dir="${basedir}"
excludes="build,**/classes/**,.check*,.fb*,nbproject/private/**,build/**,logs/**,data/**,temp/**,*.zip,todo.txt,plugins/org.jpf.demo.toolbox.ftpmonitor/**" />
</zip>
<delete includeemptydirs="true">
<fileset dir="${build.home}">
<include name="**/*" />
<exclude name="${app.name}-???-${app.version}.zip" />
</fileset>
</delete>
</target>
<target name="test" depends="build" description="Some tests">
<jpf-pack basedir="${build.home}/plugins"
includes="*/plugin.xml,*/plugin-fragment.xml"
destfile="${build.home}/all-plugins.jpa" />
<mkdir dir="${build.home}/all-plugins-extracted" />
<jpf-unpack srcfile="${build.home}/all-plugins.jpa"
destdir="${build.home}/all-plugins-extracted" />
</target>
</project>