-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
135 lines (116 loc) · 7.36 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
<project name="pandora" default="war" basedir=".">
<!--
NOTE: Remember to set the tomcat_home and my_source properties into eclipse, through the following path:
NOTA: Nao esquecer de ajustar a propriedade tomcat_home e my_source no seu eclipse, atraves de:
eclise -> window -> preference -> ant -> runtime -> (aba) properties
-->
<!-- definition of properties -->
<property name="src" value="${my_source}" />
<property name="dist" value="${my_source}/dist" />
<property name="build" value="${my_source}/build" />
<property name="lib" value="${my_source}/lib" />
<property name="application" value="pandora" />
<property name="web-tree" value="${src}/web" />
<property name="src-tree" value="${src}/java" />
<property name="tomcat_deploy_dir" value="${tomcat_home}/webapps"/>
<!-- create build and dist directories -->
<target name="resetdir">
<delete dir="${dist}" />
<delete dir="${build}" />
<delete file="${tomcat_deploy_dir}/${application}.war"/>
<delete dir="${tomcat_deploy_dir}/${application}"/>
<mkdir dir="${dist}" />
<mkdir dir="${build}"/>
</target>
<!-- compile project -->
<target name="compile" depends="resetdir">
<echo message="Compiling classes..."></echo>
<javac srcdir="${src}/java" destdir="${build}" debug="true" deprecation="true">
<classpath>
<!-- include all jar files -->
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<!-- compilerarg value="-Xlint" -->
</javac>
<copy file="${src}/ApplicationResources_pt_BR.properties" overwrite="true" tofile="${build}/ApplicationResources_pt_BR.properties"/>
<copy file="${src}/ApplicationResources_en_US.properties" overwrite="true" tofile="${build}/ApplicationResources_en_US.properties"/>
<copy file="${src}/ApplicationResources_en_US.properties" overwrite="true" tofile="${build}/ApplicationResources.properties"/>
<copy file="${src}/ApplicationResources_es.properties" overwrite="true" tofile="${build}/ApplicationResources_es.properties"/>
<copy file="${src}/ApplicationResources_ru_RU.properties" overwrite="true" tofile="${build}/ApplicationResources_ru_RU.properties"/>
<copy file="${src}/ApplicationResources_ru_RU.properties" overwrite="true" tofile="${build}/ApplicationResources_ru.properties"/>
<copy file="${src}/log4j.properties" overwrite="true" tofile="${build}/log4j.properties"/>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/*.jasper"/>
</fileset>
</copy>
</target>
<!-- create gantt library JAR -->
<target name="gantt" depends="compile">
<echo message="Create jar archives (gantt, flowchart e intefaces)..."/>
<jar jarfile="${dist}/gantt.jar" basedir="${build}"
excludes="**/lib/**, **/pandora/exception/**, **/delegate/**, **/org/**, **/tests/**, **/bus/**, **/taglib/**, **/dao/**, **/struts/**, **/helper/SessionHelper.class, **/helper/LogHelper.class, **/helper/HtmlHelper.class, **/helper/XmlDomParse.class, **/imp/**, **/acceptanceTest/**, **/pandora/*.class, **/*.jasper, **/flowchart/**, **/gui/client/**" >
</jar>
<copy file="${src}/java/GanttFake.htm" overwrite="true" tofile="${dist}/GanttFake.htm"/>
<copy file="${dist}/gantt.jar" overwrite="true" tofile="${web-tree}/jsp/gantt.jar"/>
<jar jarfile="${dist}/plandoraInterface.jar" basedir="${build}"
excludes="**/lib/**, **/pandora/gui/**, **/org/**, **/tests/**, **/taglib/**, **/dao/*DAO*, **/struts/**, **/helper/SessionHelper.class, **/helper/LogHelper.class, **/helper/HtmlHelper.class, **/helper/XmlDomParse.class, **/*.jasper, **/*.properties , **/bus/GeneralTimer.class, **/bus/A*BUS.class, **/bus/C*BUS.class, **/bus/D*BUS.class, **/bus/E*BUS.class, **/bus/F*BUS.class, **/bus/M*BUS.class, **/bus/P*.class, **/bus/R*BUS.class, **/bus/T*BUS.class, **/bus/U*BUS.class, **/acceptanceTest/**" >
</jar>
<jar jarfile="${dist}/flowchart.jar" basedir="${build}"
excludes="**/lib/**, **/pandora/exception/**, **/delegate/**, **/org/**, **/tests/**, **/bus/**, **/taglib/**, **/dao/**, **/struts/**, **/helper/SessionHelper.class, **/helper/LogHelper.class, **/helper/HtmlHelper.class, **/helper/XmlDomParse.class, **/imp/**, **/acceptanceTest/**, **/pandora/B*.class, **/pandora/E*.class, **/pandora/F*.class, **/pandora/G*.class, **/pandora/L*.class, **/pandora/M*.class, **/pandora/U*.class, **/pandora/R*.class, **/pandora/C*.class, **/pandora/P*.class, **/pandora/O*.class, **/pandora/Q*.class, **/pandora/S*.class, **/pandora/A*.class, **/*.jasper, **/gantt/**, **/gui/client/**" >
</jar>
<copy file="${dist}/flowchart.jar" overwrite="true" tofile="${web-tree}/jsp/flowchart.jar"/>
<copy file="${src}/java/FlowChartFake.htm" overwrite="true" tofile="${dist}/FlowChartFake.htm"/>
<copy file="${web-tree}/images/newTask.gif" overwrite="true" tofile="${build}/newTask.gif"/>
<jar jarfile="${dist}/thinclient.jar" basedir="${build}"
excludes="**/lib/**, **/pandora/exception/**, **/delegate/**, **/org/**, **/tests/**, **/bus/**, **/taglib/**, **/dao/**, **/struts/**, **/helper/SessionHelper.class, **/helper/LogHelper.class, **/helper/HtmlHelper.class, **/helper/XmlDomParse.class, **/imp/**, **/acceptanceTest/**, **/pandora/*TO.class, **/*.jasper, **/gantt/**, **/flowchart/**" >
<manifest>
<attribute name="Main-Class" value="com.pandora.gui.client.ThinClient" />
<attribute name="Class-Path" value="" />
</manifest>
</jar>
<copy file="${dist}/thinclient.jar" overwrite="true" tofile="${web-tree}/jsp/thinclient.jar"/>
</target>
<!-- generate WAR -->
<target name="war" depends="gantt">
<echo message="Create pandora.war..."/>
<copy file="${src}/application.xml" overwrite="true" tofile="${build}/application.xml"/>
<replace file="${build}/application.xml" token="pandora" value="${application}"/>
<war destfile="${dist}/${application}.war" webxml="${src}/web.xml" >
<zipfileset dir="${web-tree}/jsp" prefix="jsp">
<include name="**/*.jsp" />
<include name="**/*.swf" />
<include name="**/*.gif" />
<include name="**/*.jpg" />
<include name="**/*.jar" />
</zipfileset>
<zipfileset dir="${web-tree}/images" prefix="images">
<include name="**/*.*" />
</zipfileset>
<zipfileset dir="${web-tree}/css" prefix="css">
<include name="**/*.*" />
</zipfileset>
<zipfileset dir="${web-tree}/jscript" prefix="jscript">
<include name="**/*.*" />
</zipfileset>
<classes dir="${build}">
<exclude name="**/gui/gantt/**" />
</classes>
<zipfileset dir="${src}" prefix="WEB-INF" excludes="**/build.xml, **/application.xml">
<include name="**/*.xml"/>
</zipfileset>
<zipfileset dir="${build}" prefix="META-INF">
<include name="**/application.xml"/>
</zipfileset>
<lib dir="${lib}">
<exclude name="**/servlet.jar"/>
</lib>
</war>
<echo message="Copy ${dist}/${application}.war ${tomcat_deploy_dir}..."/>
<copy file="${dist}/${application}.war" overwrite="true" tofile="${tomcat_deploy_dir}/${application}.war"/>
<echo message="Copy context.xml ${tomcat_deploy_dir}..."/>
<copy file="context.xml" overwrite="false" tofile="${tomcat_deploy_dir}/${application}/META-INF/context.xml"/>
</target>
</project>