forked from helianbobo/Mahout-MongoDB-Recommender
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
155 lines (122 loc) · 5.61 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
<!-- ====================================================================== -->
<project name="Recommender" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties" />
<property name="project.sourceDir" value="src"/>
<property name="project.propertiesDir" value="properties"/>
<property name="project.lib" value="lib"/>
<property name="project.conf" value="conf"/>
<property name="build.finalName" value="${FINAL_NAME}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="logs.dir" value="${build.dir}/${build.finalName}/WEB-INF/log"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<pathelement path="${project.lib}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="1.6"
verbose="false"
fork="false"
source="1.6">
<src>
<pathelement location="${project.sourceDir}"/>
</src>
<exclude name="**/Test*.java"/>
<classpath refid="build.classpath"/>
</javac>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${project.sourceDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
old="false"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false"/>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<!-- Generates needed files with the given properties and generates war package for the indexer service -->
<target name="package" depends="compile" description="Package the application">
<echo message="Se genera el servicio de recomendacion empaquetado ${build.finalName}.war"/>
<!-- Copies files needed to create the war file -->
<mkdir dir="${build.dir}/${build.finalName}/META-INF"/>
<copy todir="${build.dir}/${build.finalName}/WEB-INF" overwrite="true">
<fileset dir="${project.conf}"/>
</copy>
<copy todir="${build.dir}/${build.finalName}/WEB-INF/lib" overwrite="true">
<fileset dir="${project.lib}"/>
</copy>
<copy todir="${build.dir}/${build.finalName}/WEB-INF/classes" overwrite="true">
<fileset dir="${build.outputDir}"/>
</copy>
<copy todir="${build.dir}/${build.finalName}/WEB-INF/conf">
<fileset dir="${project.propertiesDir}"/>
</copy>
<mkdir dir="${logs.dir}"/>
<touch file="${logs.dir}/Recommender.log"/>
<touch file="${logs.dir}/RecommenderError.log"/>
<!-- Replaces properties in configuration files with the proper values -->
<replace file="${build.dir}/${build.finalName}/WEB-INF/conf/log4j.properties">
<replacefilter token="@logs.dir@" value="/webapps/Recommender/WEB-INF/log" />
</replace>
<!-- This files are deleted due to conflicts with Tomcat library -->
<delete file="${build.dir}/${build.finalName}/WEB-INF/lib/servlet-api.jar" />
<delete file="${build.dir}/${build.finalName}/WEB-INF/lib/geronimo-j2ee_1.4_spec-1.1.jar" />
<!-- Creates war -->
<war destfile="${build.dir}/${build.finalName}.war"
compress="true">
<webinf dir="${build.dir}/${build.finalName}/WEB-INF"/>
</war>
</target>
<!-- ====================================================================== -->
<!-- Help target -->
<!-- ====================================================================== -->
<target name="help">
<echo message="Please run: $ant -projecthelp"/>
</target>
</project>