-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
109 lines (96 loc) · 3.54 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="help" name="gestorUD">
<property environment="env" />
<property name="tomcat.home" value="${env.TOMCAT_HOME}" />
<property name="project.file" value="gestorUD" />
<property name="source.dir" value="src" />
<property name="build.dir" value="bin" />
<property name="conf.dir" value="conf" />
<property name="lib.dir" value="lib" />
<property name="dist.dir" value="dist" />
<!--<property name="hibernate.dir" value="C:\hibernate-distribution-3.6.10.Final"/>-->
<path id="classpath">
<pathelement path="${build.dir}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<!--<fileset dir="${hibernate.dir}">
<include name="**/*.jar"/>
</fileset>-->
</path>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="build" depends="prepare">
<javac srcdir="${source.dir}" destdir="${build.dir}" deprecation="true" includeantruntime="false" fork="true">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
<copy todir="${build.dir}">
<fileset dir="${source.dir}">
<include name="**/*.xml"/>
<include name="**/*.properties"/>
</fileset>
<fileset dir="${source.dir}">
<include name="**/*.xml"/>
<include name="**/*.properties"/>
</fileset>
<fileset dir="${conf.dir}">
<include name="**/*.xml"/>
<include name="**/*.properties"/>
<exclude name="**/web.xml"/>
</fileset>
</copy>
</target>
<target name="test.model" depends="build">
<java classname="iso3.pt.model.Test" fork="true">
<classpath>
<path refid="classpath"/>
</classpath>
</java>
</target>
<target name="test.dao" depends="build">
<java classname="iso3.pt.dao.Test" fork="true">
<classpath>
<path refid="classpath"/>
</classpath>
</java>
</target>
<target name="jar" depends="build">
<jar destfile="${dist.dir}/${project.file}.jar">
<fileset dir="${build.dir}" excludes="**/Test.class"/>
<manifest>
<attribute name="Built-By" value="University of Deusto"/>
</manifest>
</jar>
</target>
<target name="war" depends="jar">
<copy file="${dist.dir}/${project.file}.jar" todir="${lib.dir}"/>
<war
warfile="${dist.dir}/${project.file}.war"
webxml="${conf.dir}/web.xml">
<exclude name="${dist.dir}/${project.distname}.war"/>
<lib dir="${lib.dir}"/>
<zipfileset dir="css" prefix="css"/>
<zipfileset dir="jsp" prefix="jsp"/>
<zipfileset dir="html" />
</war>
<delete file="${lib.dir}/${project.file}.jar"/>
</target>
<target name="deploy" depends="war">
<copy file="${dist.dir}/${project.file}.war" todir="${tomcat.home}/webapps"/>
</target>
<target name="undeploy">
<delete file="${tomcat.home}/webapps/${project.file}.war"/>
<delete dir="${tomcat.home}/webapps/${project.file}"/>
</target>
<target name="help">
<echo>Usage: ant [prepare | build | jar | war | deploy | undeploy | test.model | test.dao | clean]</echo>
</target>
</project>