forked from rafaelsteil/jforum2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
166 lines (149 loc) · 5.42 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
<?xml version="1.0"?>
<!-- ********************************************************************* -->
<!-- Ant build script for JForum -->
<!-- Version: $Id: build.xml,v 1.27 2007/10/11 05:04:13 rafaelsteil Exp $ -->
<!-- ********************************************************************* -->
<project name="JForum" default="compile" basedir=".">
<description>JForum</description>
<!-- Enable access to build.properties variables -->
<property file="build.properties" />
<!-- Set to use JDK 1.4 -->
<property name="build.compiler" value="javac1.4" />
<property name="project.name" value="JForum" />
<property name="project.title" value="JForum API" />
<property name="author" value="JForum Team - http://www.jforum.net/team.jsp" />
<property name="copyright" value="(c) JForum Team" />
<property name="version" value="2.1.8" />
<property name="filename" value="jforum-${version}" />
<property name="warfile" value="${filename}.war" />
<property name="srcfile" value="${filename}-src.zip"/>
<property name="javadoc.packages" value="net.jforum.*" />
<property name="build.dir" location="build" />
<property name="dist.dir" location="dist" />
<property name="docs.dir" location="docs" />
<property name="api.dir" location="${docs.dir}/api" />
<property name="project.libs" location="WEB-INF/lib" />
<property name="custom.libs" location="lib" />
<property name="src.dir" value="src" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="tomcat.home" value="/java/Tomcat5.5.9" />
<property name="deploy.dir" value="${tomcat.home}/webapps" />
<property name="deploy.dev.dir" value="${dist.dir}/jforum-test" />
<property name="web.dir" value="." />
<path id="base.path">
<fileset dir="${project.libs}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${custom.libs}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Init -->
<target name="init">
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<mkdir dir="${dist.dir}" />
<mkdir dir="${classes.dir}" />
</target>
<!-- Clean -->
<target name="clean" description="clean-up">
<delete dir="${dist.dir}" />
<delete dir="${build.dir}" />
<delete dir="${api.dir}" />
</target>
<!-- Java Docs -->
<target name="javadocs" description="Generates the API documentation">
<javadoc bottom="${project.name} by ${author} - ${copyright}"
packagenames="${javadoc.packages}"
sourcepath="${src.dir}"
defaultexcludes="yes"
destdir="${api.dir}"
doctitle="Javadocs: ${project.name} ${version}"
use="true"
private="false"
version="false"
windowtitle="Javadocs: ${project.name} ${version}"
classpathref="base.path">
<link href="http://java.sun.com/j2se/1.4/docs/api/" />
<link href="http://java.sun.com/products/servlet/2.3/javadoc/" />
</javadoc>
</target>
<!-- Compile -->
<target name="compile" depends="init" description="Compiles the source code">
<javac fork="true"
debug="true"
optimize="false"
deprecation="false"
source="1.4"
target="1.4"
srcdir="${src.dir}"
destdir="${classes.dir}">
<classpath>
<path refid="base.path" />
</classpath>
</javac>
</target>
<!-- Dist -->
<target name="dist" depends="compile" description="Generates the distribution file">
<delete file="${dist.dir}/${warfile}"/>
<delete file="${dist.dir}/${srcfile}"/>
<!-- war -->
<war destfile="${dist.dir}/${warfile}" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}">
<include name="images/**/*" />
<include name="templates/**/*" />
<include name="tmp/**/*" />
<include name="upgrade/**/*" />
<include name="upload/**/*" />
<include name="*.htm" />
<include name="*.txt" />
<include name="*.jsp" />
<include name="tools/bin/**/*"/>
<exclude name="upload/**/*"/>
<exclude name="WEB-INF/jforumLuceneIndex/**/*"/>
</fileset>
<webinf dir="${web.dir}/WEB-INF">
<include name="*.xml" />
<include name="config/**/*" />
<exclude name="web.xml" />
<exclude name="config/jforum-custom.conf" />
<exclude name="config/jboss-*.xml" />
</webinf>
<lib dir="${project.libs}">
<exclude name="jboss*.jar" />
<exclude name="jgroups*.jar" />
</lib>
<classes dir="${classes.dir}" />
<manifest>
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Built-Date" value="${TODAY}" />
</manifest>
</war>
<!-- src -->
<zip destfile="${dist.dir}/${srcfile}" update="false">
<fileset dir="${web.dir}">
<include name="**/*"/>
<exclude name="upload/**/*"/>
<exclude name="www/"/>
<exclude name="build/"/>
<exclude name="dist/"/>
<exclude name="WEB-INF/jforumLuceneIndex/**/*"/>
<exclude name="WEB-INF/config/jforum-custom.conf"/>
</fileset>
</zip>
</target>
<!-- Deploy -->
<target name="deploy" depends="dist" description="Copies WAR File into your Container">
<copy file="${dist.dir}/${warfile}" todir="${deploy.dir}" />
</target>
<!-- Deploy Dev -->
<target name="deploy-dev" depends="dist" description="Deploys JForum to a development dir">
<unwar dest="${deploy.dev.dir}" src="${dist.dir}/${warfile}" />
</target>
<!-- Undeploy -->
<target name="undeploy" description="Undeploy WAR Module from Tomcat">
<delete file="${deploy.dir}/${warfile}" />
<delete dir="${deploy.dir}/${warfile}" />
</target>
</project>