forked from Activiti/Activiti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
199 lines (175 loc) · 7.82 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0" encoding="UTF-8"?>
<project name="activiti.qa">
<property file="${user.home}/.activiti/build.properties" />
<property file="../distro/src/setup/build.properties" />
<property name="activiti.version" value="5.16-SNAPSHOT" />
<property name="activiti.home" value="../distro/target/activiti-${activiti.version}" />
<property name="macos.browser" value="/usr/bin/open" />
<property name="windows.browser" value="C:/Program Files/Mozilla Firefox/firefox.exe" />
<property name="linux.browser" value="firefox" />
<property name="tomcat.home" value="${activiti.home}/apps/apache-tomcat-${tomcat.version}" />
<property name="downloads.dir" value="${user.home}/.activiti/downloads" />
<condition property="mvn.executable" value="mvn.bat" else="mvn">
<os family="windows"/>
</condition>
<target name="pre.commit.check">
<exec executable="${mvn.executable}" dir="..">
<arg line="-Pcheck clean install" />
</exec>
</target>
<target name="test.demo.start" depends="build.clean.distro">
<ant antfile="../distro/target/activiti-${activiti.version}/setup/build.xml"
target="demo.start"
inheritall="false">
<property name="nodocs" value="true" />
</ant>
</target>
<target name="test.demo.stop">
<ant antfile="../distro/target/activiti-${activiti.version}/setup/build.xml"
target="demo.stop"
inheritall="false" />
</target>
<target name="test.upgrade" depends="build.clean.distro">
<copy file="../distro/target/activiti-${activiti.version}.zip" todir="${downloads.dir}" />
<ant antfile="upgrade/build.xml" target="upgrade" inheritall="false" />
</target>
<target name="build.userguide">
<ant antfile="../userguide/build.xml"
target="build.userguide"
inheritall="false">
</ant>
<sleep seconds="1"/>
<property name="url" value="file://${basedir}/../userguide/target/html/en/index.html" />
<antcall target="open.html.page"/>
</target>
<target name="test.demo.setup.refresh">
<ant antfile="../distro/target/activiti-${activiti.version}/setup/build.xml"
target="demo.teardown"
inheritall="false" />
<antcall target="test.demo.setup" />
</target>
<target name="build.clean.distro">
<ant antfile="../distro/build.xml" inheritall="false">
<target name="clean" />
<target name="distro" />
<property name="nodocs" value="true" />
</ant>
</target>
<target name="build.javadocs">
<exec executable="${mvn.executable}" dir="../modules/activiti-engine">
<arg line="javadoc:javadoc" />
</exec>
<property name="url" value="file://${basedir}/../modules/activiti-engine/target/site/apidocs/index.html" />
<antcall target="open.html.page"/>
</target>
<target name="webapp.rest.redeploy">
<property name="webapp.redeploy.module" value="rest"/>
<antcall target="webapp.redeploy"/>
</target>
<target name="webapp.probe.redeploy">
<property name="webapp.redeploy.module" value="probe"/>
<antcall target="webapp.redeploy"/>
</target>
<target name="webapp.explorer.redeploy">
<property name="webapp.redeploy.module" value="explorer"/>
<antcall target="webapp.redeploy"/>
</target>
<target name="webapp.redeploy">
<fail message="To use this target, set property webapp.redeploy.module to the chosen module" unless="webapp.redeploy.module"/>
<available file="${user.home}/.activiti/tomcat-users.xml" property="tomcat.users.available" />
<fail message="To use this target, a tomcat-users.xml must be in your user home ${user.home}/.activiti with following content:
<?xml version="1.0" encoding="utf-8"?>
<tomcat-users>
<role rolename="manager"/>
<user username="activiti" password="activiti" roles="manager"/>
</tomcat-users>
Then run test.demo.setup to make it get placed inside your tomcat server." unless="tomcat.users.available"/>
<exec executable="${mvn.executable}" dir="../modules/activiti-webapp">
<arg line="clean install" />
</exec>
<exec executable="${mvn.executable}" dir="../modules/activiti-webapp-${webapp.redeploy.module}">
<arg line="clean package" />
</exec>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask">
<classpath>
<fileset dir="${tomcat.home}/lib">
<include name="catalina-ant.jar"/>
</fileset>
</classpath>
</taskdef>
<undeploy url="http://localhost:8080/manager"
username="activiti"
password="activiti"
path="/activiti-${webapp.redeploy.module}"
failonerror="false"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask">
<classpath>
<fileset dir="${tomcat.home}/lib">
<include name="catalina-ant.jar"/>
</fileset>
</classpath>
</taskdef>
<deploy url="http://localhost:8080/manager"
username="activiti"
password="activiti"
path="/activiti-${webapp.redeploy.module}"
war="${basedir}/../modules/activiti-webapp-${webapp.redeploy.module}/target/activiti-webapp-${webapp.redeploy.module}-${activiti.version}.war"/>
</target>
<target name="webapp.rest.redeploy.resources">
<copy todir="${tomcat.home}/webapps/activiti-webapp-rest/WEB-INF/classes/webscripts" verbose="true">
<fileset dir="../modules/activiti-webapp-rest/src/main/resources/webscripts" />
</copy>
<copy todir="${tomcat.home}/webapps/activiti-webapp-rest" verbose="true">
<fileset dir="../modules/activiti-webapp-rest/src/main/webapp/" excludes="WEB-INF/web.xml" />
</copy>
</target>
<target name="webapp.probe.redeploy.resources">
<property name="webapp.redeploy.module" value="probe"/>
<antcall target="webapp.redeploy.resources"/>
</target>
<target name="webapp.explorer.redeploy.resources">
<property name="webapp.redeploy.module" value="explorer"/>
<antcall target="webapp.redeploy.resources"/>
</target>
<target name="webapp.redeploy.resources">
<copy todir="${tomcat.home}/webapps/activiti-${webapp.redeploy.module}" verbose="true">
<fileset dir="../modules/activiti-webapp/src/main/webapp/" excludes="WEB-INF/web.xml" />
</copy>
<copy todir="${tomcat.home}/webapps/activiti-${webapp.redeploy.module}" verbose="true">
<fileset dir="../modules/activiti-webapp-${webapp.redeploy.module}/src/main/webapp/" excludes="WEB-INF/web.xml" />
</copy>
</target>
<target name="open.html.page">
<fail message="property url has to be specified to use this target" unless="url" />
<exec executable="${macos.browser}" os="Mac OS X">
<arg value="${url}" />
</exec>
<exec executable="cmd" os="Windows Vista, Windows XP,Windows 2000,Windows 98">
<arg value="/C start "${windows.browser}" "${url}"" />
</exec>
<exec executable="${linux.browser}" os="Linux">
<arg value="${url}" />
</exec>
</target>
<!-- Assumes that a demo setup is successfully running (in /distro/target/etc) -->
<target name="deploy.ui.qa.processes">
<delete dir="ui/build" />
<mkdir dir="ui/build"/>
<zip destfile="ui/build/ui-qa-processes.bar">
<fileset dir="ui/processes">
<include name="verifyJobExceptionStacktrace.bpmn20.xml"/>
</fileset>
</zip>
<taskdef name="deploy-bar" classname="org.activiti.engine.impl.ant.DeployBarTask">
<classpath>
<fileset dir="${activiti.home}/setup/build/">
<include name="activiti-cfg.jar"/>
</fileset>
<fileset dir="${activiti.home}/examples/activiti-engine-examples/libs-runtime/" />
<fileset dir="${activiti.home}/examples/activiti-engine-examples/libs-test/" />
</classpath>
</taskdef>
<deploy-bar file="ui/build/ui-qa-processes.bar" />
<delete dir="ui/build" />
</target>
</project>