forked from bbossgroups/bboss-gencode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
170 lines (136 loc) · 6.07 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
<project name="bboss util" default="default" basedir=".">
<description>
bboss gencode build file
</description>
<tstamp prefix="start" />
<tstamp>
<format property="compile.timestamp" pattern="yyyy-MM-dd HH.mm.ss" />
</tstamp>
<!-- set global properties for this build -->
<property file="build.properties" />
<target name="init" description="create timestamp and directories">
<echo>Init...</echo>
<tstamp />
<delete dir="classes-gencode" />
<delete dir="distrib" />
<mkdir dir="classes-gencode" />
<mkdir dir="distrib" />
<mkdir dir="distrib/run" />
</target>
<target name="default" depends="complete" description="default = build distribution package" />
<!--
==========================
Distribution jar package
==========================
-->
<target name="distrib" depends="init,jar-gencode-web,copy-resource,copy-depends-liberary" description="copy jar file to distribution directory">
<echo>Construct the distribution package...</echo>
</target>
<target name="compile-gencode" description="compile the gencode source ">
<echo>compile the gencode source ...</echo>
<javac encoding="UTF-8" destdir="classes-gencode" target="1.5" source="1.5" deprecation="true" debug="${debug}" optimize="${optimize}" memorymaximumsize="256M" fork="true" verbose="yes">
<src path="src" />
<classpath id="cp-classes-gencode">
<fileset dir="${webroot}/WEB-INF/lib" includes="*.jar *.zip" />
<fileset dir="lib" includes="**/*.jar" />
<fileset dir="build" includes="*.jar" />
</classpath>
</javac>
<copy todir="classes-gencode">
<fileset dir="src" includes="**/*.xml" />
</copy>
</target>
<target name="compile-gencode-web" depends="jar-gencode" description="compile the gencode source ">
<echo>compile the gencode source ...</echo>
<mkdir dir="classes-gencode" />
<javac encoding="UTF-8" destdir="classes-gencode" target="1.5" source="1.5" deprecation="true" debug="${debug}" optimize="${optimize}" memorymaximumsize="256M" fork="true" verbose="yes">
<src path="src-web" />
<classpath id="cp-classes-gencode">
<fileset dir="${webroot}/WEB-INF/lib" includes="*.jar *.zip" />
<fileset dir="lib" includes="**/*.jar" />
<fileset dir="distrib" includes="**/*.jar" />
<fileset dir="build" includes="*.jar" />
</classpath>
</javac>
<copy todir="classes-gencode">
<fileset dir="src-web" includes="**/*.xml" />
</copy>
</target>
<target name="jar-gencode" depends="compile-gencode" description="generate the bboss-taglib library gencode.jar">
<echo>Generate the gencode library gencode.jar ...</echo>
<jar jarfile="distrib/gencode.jar" basedir="classes-gencode" includes="**/*">
<manifest>
<attribute name="Implementation-Version" value="${impl.version}" />
<attribute name="Specification-Version" value="${revision}" />
<attribute name="Implementation-Vendor" value="${impl.vendor}" />
<attribute name="Implementation-ProductID" value="${impl.productID}" />
<attribute name="Compile-Timestamp" value="${compile.timestamp}" />
<attribute name="Compile-User" value="${username}" />
</manifest>
</jar>
<delete dir="classes-gencode" />
</target>
<target name="jar-gencode-web" depends="compile-gencode-web" description="generate the bboss-taglib library gencode-web.jar">
<echo>Generate the gencode library gencode-web.jar ...</echo>
<jar jarfile="distrib/gencode-web.jar" basedir="classes-gencode" includes="**/*">
<manifest>
<attribute name="Implementation-Version" value="${impl.version}" />
<attribute name="Specification-Version" value="${revision}" />
<attribute name="Implementation-Vendor" value="${impl.vendor}" />
<attribute name="Implementation-ProductID" value="${impl.productID}" />
<attribute name="Compile-Timestamp" value="${compile.timestamp}" />
<attribute name="Compile-User" value="${username}" />
</manifest>
</jar>
</target>
<target name="copy-resource" description="copy resource files">
<echo>copy resource files ...</echo>
<copy todir="${distrib}/WebRoot/" overwrite="true">
<fileset dir="${webroot}/" />
</copy>
<delete dir="${distrib}/WebRoot/WEB-INF/classes" />
<mkdir dir="${distrib}/WebRoot/WEB-INF/classes" />
<copy todir="${distrib}/WebRoot/WEB-INF/classes">
<fileset dir="${source}/resources" includes="**/*" />
</copy>
<copy todir="${distrib}/WebRoot/WEB-INF/lib">
<fileset dir="${source}/lib/eclipse" includes="**/*" />
<fileset dir="${source}/build" includes="bboss-rt.jar" />
</copy>
</target>
<target name="copy-depends-liberary" description="copy depends liberarys">
<echo>copy depends liberarys ...</echo>
<copy todir="${distrib}/WebRoot/WEB-INF/lib" overwrite="true">
<fileset dir="${distrib}" includes="*.jar" />
</copy>
</target>
<target name="war" depends="distrib" description="copy depends liberarys">
<war destfile="${distrib}/gencode.war" webxml="${distrib}/WebRoot/WEB-INF/web.xml">
<fileset dir="${distrib}/WebRoot/" />
</war>
<delete dir="${distrib}/WebRoot" />
</target>
<target name="run" depends="jar-gencode-web" description="copy depends liberarys">
<echo>copy depends liberarys ...</echo>
<copy todir="distrib/run/lib">
<fileset dir="lib" includes="**/*.jar" />
</copy>
<copy todir="distrib/run/WebRoot/WEB-INF/lib">
<fileset dir="${distrib}" includes="*.jar" />
</copy>
<copy todir="distrib/run/resources">
<fileset dir="resources" includes="**/*" />
</copy>
<copy todir="distrib/run/">
<fileset dir="build" includes="config.properties *.sh *.bat,*.jar" />
</copy>
<copy todir="${distrib}/run/WebRoot/" overwrite="true">
<fileset dir="${webroot}/" />
</copy>
<delete dir="${distrib}/run/WebRoot/WEB-INF/classes" />
<mkdir dir="${distrib}/run/WebRoot/WEB-INF/classes" />
</target>
<target name="complete" depends="war,run" description="copy depends liberarys">
<delete dir="classes-gencode" />
</target>
</project>