forked from mint-ntua/Mint2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instrumentBuild.xml
162 lines (140 loc) · 4.89 KB
/
instrumentBuild.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
<project name="mint" default="instrument" basedir=".">
<description>
Athena build file
</description>
<!-- set global properties for this build -->
<property name="src" location="WEB-INF/src/java"/>
<property name="build" location="WEB-INF/classes"/>
<property name="lib" location="WEB-INF/lib"/>
<property name="dist" location="work/dist"/>
<property environment="env"/>
<property name="tomcat.home" location="${env.ATHENA_HOME}" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="instrument" depends="compile">
<taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
<classpath >
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classpath path="${build}"/>
</taskdef>
<instrument verbose="true">
<fileset dir="${build}/gr/ntua/ivml/mint/persistent">
<include name="*.class"/>
</fileset>
</instrument>
</target>
<target name="compile" depends="init"
description="compile the source " >
<echo message="Compiling source code..." />
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" source="1.6" debug="true" listfiles="true">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<copy todir="${build}">
<fileset dir="${src}" excludes="**/*.java"/>
</copy>
<echo message="Source code compile completed!" />
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<echo message="Generating distribution..." />
<mkdir dir="${dist}/mint"/>
<echo message="Copying css..." />
<copy todir="${dist}/mint/css">
<fileset dir="css" />
</copy>
<echo message="Copying template..." />
<copy todir="${dist}/mint/template" >
<fileset dir="template" />
</copy>
<echo message="Copying example..." />
<copy todir="${dist}/mint/example" >
<fileset dir="example" />
</copy>
<echo message="Copying images..." />
<copy todir="${dist}/mint/images" >
<fileset dir="images" />
</copy>
<echo message="Copying js..." />
<copy todir="${dist}/mint/js">
<fileset dir="js" />
</copy>
<echo message="Copying WEB-INF..." />
<copy todir="${dist}/mint/WEB-INF">
<fileset dir="WEB-INF" />
</copy>
<copy todir="${dist}/mint/WEB-INF/classes">
<fileset dir="WEB-INF/src/java" />
</copy>
<copy todir="${dist}/mint/WEB-INF/classes">
<fileset dir="${build}" />
</copy>
<echo message="Copying index.html..." />
<copy tofile="${dist}/mint/index.html" file="index.html"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="deploy" depends="dist" description="deploy web app">
<copy todir="${tomcat.home}/webapps/mint" overwrite="true">
<fileset dir="${dist}/mint">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="deploy-dev" depends="dist" description="deploy web app">
<delete failonerror="false">
<fileset dir="${tomcat.home}/webapps/mint" includes="**/*"/>
</delete>
<copy todir="${tomcat.home}/webapps/mint" overwrite="true">
<fileset dir="${dist}/mint">
<include name="**/*"/>
<exclude name="**/WEB-INF/src/**" />
</fileset>
</copy>
<!-- change db and log properties to dev environment-->
<copy overwrite="true" tofile="${tomcat.home}/webapps/mint/WEB-INF/classes/hibernate.properties"
file="WEB-INF/src/java/hibernate.properties.dev" />
<copy overwrite="true" tofile="${tomcat.home}/webapps/mint/WEB-INF/classes/log4j.properties"
file="WEB-INF/src/java/log4j.properties.dev" />
</target>
<!--target name="tomcat-stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
<arg line="stop"/>
</java>
</target-->
<!--target name="tomcat-start">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
</java>
</target-->
<target name="tomcat-stop">
<exec executable="${tomcat.home}/bin/shutdown.bat" spawn="true">
<env key="CATALINA_HOME" value="${tomcat.home}"/>
</exec>
</target>
<target name="tomcat-start">
<exec executable="${tomcat.home}/bin/startup.bat" spawn="true">
<env key="CATALINA_HOME" value="${tomcat.home}"/>
</exec>
</target>
</project>