forked from moqui/moqui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
102 lines (90 loc) · 4.65 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any
warranty.
You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
-->
<!--
README: These are just tools for using the Moqui WAR file.
The actual build is done with Gradle.
-->
<project name="Moqui WAR Tools" default="run" basedir=".">
<property environment="env"/>
<property name="version" value="1.6.0"/>
<property name="tomcat.home" value="../apache-tomcat-8.0.21"/>
<property name="moqui.runtime" value="runtime"/>
<property name="moqui.conf.dev" value="conf/MoquiDevConf.xml"/>
<property name="moqui.conf.production" value="conf/MoquiProductionConf.xml"/>
<target name="add-runtime">
<!-- unzip the "moqui-${version}.war" file to the wartemp directory -->
<mkdir dir="wartemp"/>
<unzip src="moqui-${version}.war" dest="wartemp"/>
<copy todir="wartemp">
<fileset dir="." includes="${moqui.runtime}/**" excludes="**/*.jar,${moqui.runtime}/lib/**,${moqui.runtime}/classes/**,${moqui.runtime}/log/**"/>
</copy>
<copy todir="wartemp/WEB-INF/lib"><fileset dir="${moqui.runtime}/lib" includes="*.jar"/></copy>
<copy todir="wartemp/WEB-INF/classes"><fileset dir="${moqui.runtime}/classes" includes="**/*"/></copy>
<copy todir="wartemp/WEB-INF/lib" flatten="true"><fileset dir="${moqui.runtime}/component-lib" includes="**/*.jar"/></copy>
<copy todir="wartemp/WEB-INF/lib" flatten="true"><fileset dir="${moqui.runtime}/component" includes="**/*.jar"/></copy>
<copy file="MoquiInit.properties" todir="wartemp/WEB-INF/classes" overwrite="true"/>
<!-- zip it up again -->
<zip destfile="moqui-plus-runtime.war" basedir="wartemp"/>
<delete verbose="off" failonerror="false" dir="wartemp"/>
</target>
<target name="deploy-tomcat">
<delete verbose="on" failonerror="false" dir="${tomcat.home}/runtime"/>
<delete verbose="on" failonerror="false" dir="${tomcat.home}/webapps/ROOT"/>
<delete verbose="on" failonerror="false" file="${tomcat.home}/webapps/ROOT.war"/>
<delete verbose="on" failonerror="false">
<fileset dir="${tomcat.home}/logs" includes="*"/>
</delete>
<copy file="moqui-${version}.war" tofile="${tomcat.home}/webapps/ROOT.war"/>
</target>
<target name="run" description="Run Moqui Web server in dev/default mode with Embedded Winstone (run the executable war file)">
<delete verbose="off" failonerror="false" dir="execwartmp"/>
<java jar="moqui-${version}.war" fork="true">
<jvmarg value="-server"/>
<jvmarg value="-Xmx256M"/>
<jvmarg value="-XX:MaxPermSize=192m"/>
<jvmarg value="-Dmoqui.conf=${moqui.conf.dev}"/>
<jvmarg value="-Dmoqui.runtime=${moqui.runtime}"/>
</java>
</target>
<target name="run-production" description="Run Moqui Web server in production mode">
<delete verbose="off" failonerror="false" dir="execwartmp"/>
<java jar="moqui-${version}.war" fork="true">
<jvmarg value="-server"/>
<jvmarg value="-Xms512M"/>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-XX:MaxPermSize=192m"/>
<jvmarg value="-Dmoqui.conf=${moqui.conf.production}"/>
<jvmarg value="-Dmoqui.runtime=${moqui.runtime}"/>
</java>
</target>
<target name="load" description="Run Moqui data loader (run the executable war file with -load)">
<java jar="moqui-${version}.war" fork="true">
<jvmarg value="-server"/>
<jvmarg value="-Xmx256M"/>
<jvmarg value="-XX:MaxPermSize=192m"/>
<jvmarg value="-Dmoqui.conf=${moqui.conf.dev}"/>
<jvmarg value="-Dmoqui.runtime=${moqui.runtime}"/>
<arg value="-load"/>
</java>
</target>
<target name="load-production" description="Run Moqui data loader in production mode">
<java jar="moqui-${version}.war" fork="true">
<jvmarg value="-server"/>
<jvmarg value="-Xmx256M"/>
<jvmarg value="-XX:MaxPermSize=192m"/>
<jvmarg value="-Dmoqui.conf=${moqui.conf.production}"/>
<jvmarg value="-Dmoqui.runtime=${moqui.runtime}"/>
<arg value="-load"/>
</java>
</target>
</project>