-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
107 lines (89 loc) · 3.37 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project >
<project name="Hamtag" default="usage" basedir="." xmlns:sonar="antlib:org.sonar.ant">
<property name="project.name" value="${ant.project.name}" />
<property environment="env" />
<property file="build.xml.properties" />
<property name="sonar.projectKey" value="net.hamtag:server" />
<property name="sonar.projectName" value="Hamtag: SonarQube" />
<property name="sonar.projectVersion" value="1.0" />
<property name="sonar.language" value="java" />
<property name="sonar.sources" value="src" />
<property name="sonar.binaries" value="build" />
<property name="sonar.java.libraries" value="lib/*.jar" />
<property name="sonar.sourceEncoding" value="UTF-8" />
<path id="compile.classpath">
<pathelement location="${catalina.home}/common/classes" />
<fileset dir="${catalina.home}/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${sourcelibdir}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="sonar">
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="lib/sonarqube-ant-task-2.4.1.jar" />
</taskdef>
<!-- Execute Sonar -->
<sonar:sonar />
</target>
<target name="usage">
<echo message=""/>
<echo message="${webapp.name} build file"/>
<echo message="-----------------------------------"/>
</target>
<target name="clean" description="Clean">
<delete dir="${build.home}" />
<delete dir="${deploy.home}" />
<delete failonerror="false" dir="${deploy.work}" />
</target>
<target name="cleanJars" description="Delete the jar files">
<delete dir="${build.home}/WEB-INF/lib" />
<delete dir="${deploy.home}/WEB-INF/lib" />
<delete failonerror="false" dir="${deploy.work}" />
<delete>
<fileset dir="${weblibdir}">
<include name="*.jar" />
</fileset>
</delete>
</target>
<target name="prepare" >
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/WEB-INF" />
<mkdir dir="${build.home}/WEB-INF/classes" />
</target>
<target name="makeJars" description="Build the jar files" >
<copy todir="${weblibdir}" flatten="true">
<fileset dir="${sourcelibdir}" casesensitive="yes">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
</copy>
</target>
<target name="compile" depends="prepare,makeJars" description="Compile Java sources">
<!-- Compile Java classes as necessary -->
<javac srcdir="${sourcedir}"
destdir="${build.home}/WEB-INF/classes"
debug="${compile.debug}"
optimize="${compile.optimize}">
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="build" depends="compile" description="Build the project" >
<copy todir="${build.home}/WEB-INF/classes">
<fileset dir="${sourcedir}" excludes="**/i18n/**/*.properties, **/*.java, **/*.class, **/*.utf8" casesensitive="yes" />
</copy>
<copy todir="${build.home}">
<fileset dir="${webroot}" casesensitive="yes">
<exclude name="WEB-INF/classes/**" />
</fileset>
</copy>
</target>
<target name="deploy" depends="build" description="Deploy to tomcat dir" >
<mkdir dir="${deploy.home}" />
<copy todir="${deploy.home}">
<fileset dir="${build.home}" />
</copy>
</target>
</project>