-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
159 lines (134 loc) · 4.71 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
<project name="LaBicla" default="web" basedir=".">
<!-- ClassPath-->
<property name="classpath" value="%CLASSPATH%"/>
<!-- root directory of project -->
<property name="root" value="."/>
<!-- root location of the build output -->
<property name="build" value="build"/>
<!-- location of the JSP files -->
<property name="jspfiles" value="${root}/jsp"/>
<!-- location of the XML files -->
<property name="xmlfiles" value="${root}/xml"/>
<!-- location of the Resource files -->
<property name="resourcefiles" value="${root}/resource"/>
<!-- root location of the distribution director-->
<property name="dist" value="dist"/>
<!-- application name -->
<property name="applicationname" value="que-chistosito"/>
<property name="lib" value="${root}/lib" />
<property name="deploydir" value="/opt/tomcat/webapps"/>
<!--
<property name="ant.build.javac.source" value="1.8"/>
<property name="ant.build.javac.target" value="1.8"/>
-->
<property name="build.sysclasspath" value="last"/>
<path id="compile.classpath">
<pathelement location="${root}/lib/servlet-api.jar"/>
<pathelement location="${root}/lib/javax.mail.jar"/>
<pathelement location="${root}/lib/activation.jar"/>
<pathelement location="${root}/lib/mysql-connector-java-8.0.22.jar"/>
</path>
<target name="web" depends="clean,prepare,compile,war,deploy" description="Ejecuta deploy de aplicacion.">
<tstamp>
<format property="ENDTIME" pattern="MM/dd/yyyy hh:mm aa" />
</tstamp>
<echo>Ensamble de aplicacion terminado: ${ENDTIME}</echo>
</target>
<target name="war" depends="clean,prepare,compile" description="Ensambla archivo war.">
<!-- Copia las clases que se necesitan en el archivo WAR -->
<copy todir="${build}/WEB-INF/classes">
<fileset dir="${build}/classes">
<include name="**/dao/*" />
<include name="**/servlet/*" />
<include name="**/util/*" />
<include name="**/valueobject/*" />
<include name="**/exception/*" />
</fileset>
</copy>
<!-- Copia las librerias que se necesitan en el archivo WAR -->
<copy todir="${build}/WEB-INF/lib">
<fileset dir="${root}/lib">
<include name="mysql-connector-java-8.0.22.jar"/>
<include name="javax.mail.jar"/>
<include name="activation.jar"/>
</fileset>
</copy>
<!-- Crea el archivo WAR -->
<war warfile="${dist}/${applicationname}.war" webxml="${root}/WEB-INF/web.xml">
<!--fileset dir="${applicationname}"/-->
<fileset dir="${build}">
<include name="WEB-INF/**"/>
<include name="*.html" />
<include name="*.jsp" />
<include name="css/**" />
<include name="js/**" />
<include name="fonts/**" />
<include name="ico/**" />
<include name="images/**" />
</fileset>
</war>
</target>
<!-- Crea la estructura de directorio y copia archivos requeridos -->
<target name="prepare" depends="clean">
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${build}/META-INF"/>
<mkdir dir="${build}/WEB-INF"/>
<mkdir dir="${build}/WEB-INF/classes"/>
<mkdir dir="${build}/WEB-INF/lib"/>
<mkdir dir="${build}/WEB-INF/properties"/>
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/lib"/>
<copy todir="${build}">
<fileset dir="${root}">
<include name="*.html" />
<include name="*.jsp" />
</fileset>
</copy>
<copy todir="${build}/css">
<fileset dir="${root}/css">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build}/js">
<fileset dir="${root}/js">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build}/fonts">
<fileset dir="${root}/fonts">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build}/ico">
<fileset dir="${root}/ico">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${build}/images">
<fileset dir="${root}/images">
<include name="*.*" />
</fileset>
</copy>
</target>
<!-- Compila los archivos java y los copia en el directorio destino de archido class -->
<target name="compile" depends="clean,prepare">
<javac srcdir="src" destdir="${build}/classes" debug="${javac.debug}" release="8">
<classpath refid = "compile.classpath"/>
<!-- <compilerarg value="-Xlint:unchecked" /> -->
</javac>
</target>
<!-- Borra carpetas temporales -->
<target name="clean" description="Elimina las carpetas generadas en el proceso de ensamble de aplicacion">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<!-- Copia el archivo war a la carpeta de deploy -->
<target name="deploy" depends="war">
<copy todir="${deploydir}">
<fileset dir="${dist}">
<include name="*.war*"/>
</fileset>
</copy>
</target>
</project>