forked from madskonradsen/douglas-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·100 lines (72 loc) · 3.12 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
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="douglas" default="compile">
<!-- CONFIG PARAMETERS -->
<property environment="env"/>
<property name="buildscript.home" value="${basedir}/buildscripts" />
<property name="app.name" value="douglas"/>
<property name="app.path" value="/douglas"/>
<property name="site.name" value="douglas"/>
<property name="app.version" value="1.0.0"/>
<property name="build.home" value="${basedir}/build_ant"/>
<property name="dist.home" value="${basedir}/dist" />
<property name="src.home" value="${basedir}/src/douglas" />
<property name="web.home" value="${basedir}/WebContent" />
<property name="build.lib" value="${build.home}/lib"/>
<property name="compile.debug" value="on"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<path id="compile.classpath">
<fileset dir="${build.home}/lib" includes="**/*.jar"/>
<fileset dir="${build.home}/lib" includes="**/*.js"/>
</path>
<!-- TARGETS -->
<target name="prepare" depends="clean">
<!-- Create build directories as needed -->
<mkdir dir="${build.home}"/>
<!-- Retrieve dependencies -->
<mkdir dir="${build.home}/lib"/>
<ivy:configure file="ivysettings.xml" />
<ivy:resolve file="ivy.xml" conf="default, test" />
<ivy:retrieve pattern="${build.home}/lib/[artifact]-[revision].[ext]" conf="default" />
<!-- Copy static content of this web application -->
<copy todir="${build.home}">
<fileset dir="${web.home}"/>
</copy>
<mkdir dir="${build.home}/META-INF"/>
<copy file="${basedir}/src/log4j.properties" tofile="${build.home}/log4j.properties"/>
<copy file="${basedir}/src/persistence.properties" tofile="${build.home}/persistence.properties"/>
<copy file="${basedir}/WebContent/css-selector-generator.min.js" tofile="${build.home}/douglas/util/css-selector-generator.min.js"/>
</target>
<target name="compile" depends="prepare"
description="Compile Java sources">
<!-- Compile Java classes as necessary -->
<javac srcdir="${src.home}"
destdir="${build.home}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="compile.classpath" />
<compilerarg line="-encoding utf-8" />
</javac>
<!-- Copy application resources -->
<copy todir="${build.home}">
<fileset dir="${web.home}" excludes="**/*.java"/>
</copy>
</target>
<target name="dist" depends="compile"
description="Create binary distribution">
<mkdir dir="${dist.home}"/>
<!-- Create application JAR file -->
<jar jarfile="${dist.home}/${app.name}.jar" basedir="${build.home}">
<manifest>
<attribute name="Main-Class" value="douglas.Douglas"/>
</manifest>
<zipgroupfileset dir="${build.lib}" includes="**/*.jar"/>
</jar>
</target>
<target name="clean"
description="Delete old build and dist directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
</project>