forked from okjsp/okjsp-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
259 lines (235 loc) · 8.25 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?xml version="1.0" encoding="euc-kr"?>
<project name="okjsp-site" default="publish">
<property file="build.properties"/>
<property name="src.home" value="src"/>
<property name="catalina.home" value="/web/local/java/jakarta-tomcat-5.0.27"/>
<property name="publish.home" value="${catalina.home}/webapps/ROOT"/>
<path id="compile.classpath">
<!-- Include all elements that Tomcat exposes to applications -->
<fileset dir="${catalina.home}/lib">
<include name="*.jar"/>
</fileset>
<!-- Include all elements for this application only -->
<fileset dir="web/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<!-- Include all elements that Tomcat exposes to applications -->
<fileset dir="${catalina.home}/lib">
<include name="*.jar"/>
</fileset>
<!-- Include all elements for this application only -->
<fileset dir="web/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<path location="${publish.home}/WEB-INF/classes"></path>
<path location="dst_test"></path>
</path>
<!-- 디렉토리의 생성 -->
<target name="prepare">
<mkdir dir="${publish.home}/WEB-INF/classes"/>
<mkdir dir="${publish.home}/WEB-INF/lib"/>
</target>
<!-- publish directory -->
<target name="publish" depends="prepare">
<echo message="publish to ${publish.home}"/>
<copy todir="${publish.home}">
<fileset dir="web">
<include name="**/*.jsp" />
<include name="**/*.htm*" />
<include name="**/equals.txt" />
<include name="favicon.ico" />
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="**/*.png" />
<include name="**/*.swf" />
<include name="**/*.js" />
<include name="**/*.xml" />
<include name="**/*.xsl" />
<include name="**/*.tld" />
<include name="**/*.jar" />
<include name="**/*.css" />
<exclude name="**/*.bak" />
</fileset>
</copy>
<copy todir="${publish.home}/WEB-INF/classes">
<fileset dir="src">
<include name="**/*.properties" />
<include name="**/*.xml" />
</fileset>
</copy>
<javac srcdir="src"
debug="on"
destdir="${publish.home}/WEB-INF/classes" encoding="EUC-KR">
<!-- 위에서 설정한 classpath를 참조한다 -->
<include name="**/*.java" />
<classpath refid="compile.classpath"/>
</javac>
<mkdir dir="dst_test"/>
<javac srcdir="test"
debug="on"
destdir="dst_test" encoding="EUC-KR">
<include name="**/*.java" />
<classpath refid="test.classpath"/>
</javac>
</target>
<!-- 작성한 디렉토리, 파일의 삭제 -->
<target name="distclean">
<!--
<delete dir="build" />
-->
</target>
<!-- 소스 배포판 -->
<target name="package-zip">
<mkdir dir="dist"/>
<zip zipfile="dist/okjspsrc.zip" basedir="./">
<exclude name=".*"/>
<exclude name="web/doc/**/*.*"/>
</zip>
</target>
<!-- ==================== Javadoc Target ================================== -->
<!--
The "javadoc" target creates Javadoc API documentation for the Java
classes included in your application. Normally, this is only required
when preparing a distribution release, but is available as a separate
target in case the developer wants to create Javadocs independently.
-->
<target name="javadoc" depends="publish"
description="Create Javadoc API documentation">
<mkdir dir="${publish.home}/docs/api/okjsp-site"/>
<javadoc sourcepath="${src.home}"
destdir="${publish.home}/docs/api/okjsp-site"
splitindex="true"
packagenames="kr.pe.okjsp.*,test*"
encoding="euc-kr">
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<!-- ==================== db Target ================================== -->
<!--
create table according to DB.properties file
-->
<property file="src/kr/pe/okjsp/DB.properties"/>
<target name="db" description="execute sql statements">
<echo message="Database Table Creating"/>
<sql driver="${DRIVER}"
url="${DBURL}"
userid="root" password="okpass"
classpath="${basedir}/web/WEB-INF/lib/cubrid_jdbc.jar">
<fileset dir="${basedir}/web/WEB-INF/sql" includes="okjsp2007.sql"/>
</sql>
</target>
<!-- ==================== test Target ================================== -->
<target name="test" depends="publish">
<mkdir dir="report"/>
<junit printsummary="on" haltonfailure="off">
<classpath refid="test.classpath">
</classpath>
<formatter type="xml"/>
<batchtest todir="report">
<fileset dir="dst_test">
<include name="**/*Test*"/>
</fileset>
</batchtest>
</junit>
<mkdir dir="${publish.home}/docs/report"/>
<junitreport todir="report">
<fileset dir="report">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${publish.home}/docs/report"/>
</junitreport>
</target>
<!-- ==================== ftp upload Target ================================== -->
<target name="upload" depends="publish" description="ftp upload text files">
<ftp server="${ftp.server}" port="21" remotedir="${ftp.remotedir}" userid="${ftp.userid}" password="${ftp.password}" depends="yes" binary="yes">
<fileset dir="${publish.home}">
<!-- jsp 파일 업로드 -->
<include name="*.jsp"/>
<include name="jsp/**/*.jsp"/>
<!-- class 파일과 resources 업로드 -->
<include name="WEB-INF/classes/kr/**/*.class"/>
<include name="WEB-INF/classes/*.properties"/>
<!-- 정적인 파일 업로드 -->
<include name="**/*.htm*"/>
<include name="**/*.txt"/>
<include name="js/*.js"/>
<!-- 제외된 정적인 파일 -->
<exclude name="lecture/**/*.html"/>
<exclude name="doc/**/*.html"/>
</fileset>
</ftp>
</target>
<!-- ==================== ftp binary Target ================================== -->
<target name="uploadBinary" depends="publish">
<ftp server="${ftp.server}"
port="21"
remotedir="${ftp.remotedir}"
userid="${ftp.userid}"
password="${ftp.password}"
depends="yes"
binary="yes"
>
<fileset dir="${publish.home}">
<include name="images/**/*.gif"/>
<include name="images/**/*.jpg"/>
<include name="WEB-INF/lib/*.jar"/>
<include name="WEB-INF/classes/*.class"/>
</fileset>
</ftp>
</target>
<!-- ==================== ftp lecture Target ================================== -->
<target name="uploadlecture" depends="publish">
<ftp server="${ftp.server}"
port="21"
remotedir="${ftp.remotedir}"
userid="${ftp.userid}"
password="${ftp.password}"
depends="yes"
binary="yes"
>
<fileset dir="${publish.home}">
<include name="lecture/**/*.htm*"/>
<include name="lecture/**/*.gif"/>
<include name="lecture/**/*.jpg"/>
</fileset>
</ftp>
</target>
<!-- ==================== javadoc upload Target ================================== -->
<target name="uploadjavadoc" depends="javadoc">
<ftp server="${ftp.server}"
port="21"
remotedir="${ftp.remotedir}"
userid="${ftp.userid}"
password="${ftp.password}"
depends="yes"
binary="yes"
>
<fileset dir="${basedir}">
<include name="docs/api/**/*.html"/>
<include name="docs/api/**/*.css"/>
</fileset>
</ftp>
</target>
<!-- ==================== check java version Target ================================== -->
<target name="check">
<echo message="${java.version}">
</echo>
</target>
<!-- ==================== check java version Target ================================== -->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
<target name="findbugs">
<findbugs home="${findbugs.home}"
output="xml:withMessages"
outputFile="findbugs.xml" >
<auxClasspath path="${catalina.home}/lib/servlet-api.jar" />
<auxClasspath path="${catalina.home}/lib/jsp-api.jar" />
<auxClasspath path="${basedir}/web/WEB-INF/lib/cos.jar" />
<auxClasspath path="${basedir}/web/WEB-INF/lib/AcmeGif.jar" />
<auxClasspath path="${basedir}/web/WEB-INF/lib/mail.jar" />
<sourcePath path="${basedir}/src" />
<class location="${publish.home}/WEB-INF/classes" />
</findbugs>
</target>
</project>