This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
130 lines (108 loc) · 4.07 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
<?xml version="1.0"?>
<!--
~ Copyright (c) 2005 - 2013, Clark & Parsia, LLC. <http://www.clarkparsia.com>
-->
<project name="sparql-proxy" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Clark & Parsia Sparql-Proxy Servlet
</description>
<!-- Global Properties -->
<property environment="env"/>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="lib" value="lib"/>
<property name="project.name" value="sparql-proxy" />
<property name="project.version" value="0.0.1" />
<property name="web" value="web"/>
<property name="war" value="${dist}/${project.name}.war"/>
<property name="jar.prefix" value="sparql-proxy" />
<path id="project.class.path">
<pathelement location="${lib}" />
<pathelement location="${build}" />
<fileset dir="${lib}">
<include name="**/*.jar"/>
<exclude name="**/${jar.prefix}*.jar"/>
</fileset>
</path>
<!-- ************** PROJECT CLEANING ************** -->
<target name="clean" description="Clean up build files">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="clean-libs" unless="cleaned">
<property name="cleaned" value="true"/>
<delete dir="${lib}" />
</target>
<!-- ************** PROJECT INIT ************** -->
<target name="init" depends="clean">
<pathconvert targetos="unix" property="classpath" refid="project.class.path" />
<echo>CLASSPATH=${classpath}</echo>
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init"
description="Compile source files." >
<javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}" debug="yes" deprecation="yes">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="build" depends="compile"
description="Compile sources and copy data files into build directory.">
<copy todir="${build}">
<fileset dir="${src}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="distfiles">
<!-- Copy in lib files -->
<mkdir dir="${dist}/lib" />
<copy todir="${dist}/lib">
<fileset dir="${lib}">
<include name="**/*.jar" />
<exclude name="**/${jar.prefix}*.jar"/>
</fileset>
</copy>
<copy todir="${dist}/src">
<fileset dir="${src}">
<include name="**/*.java" />
</fileset>
</copy>
</target>
<target name="dist" depends="build,distfiles"
description="Generate a distribution" >
<echo>${Class-Path}</echo>
<!-- Make Jar file. -->
<jar jarfile="${dist}/lib/${jar.prefix}-${project.version}.jar"
basedir="${build}">
<manifest>
<attribute name="Class-Path" value="${Class-Path}" />
</manifest>
</jar>
</target>
<target name="web-dist" depends="build,distfiles"
description="Builds war file for web deployment.">
<copy todir="./temp/WEB-INF/lib" flatten="true">
<fileset dir="${lib}">
<include name="**/*.jar"/>
<exclude name="**/javaee*.jar"/>
</fileset>
</copy>
<war destfile="${war}" webxml="${web}/web.xml">
<classes dir="${build}"/>
<lib dir="./temp/WEB-INF/lib">
<include name="*.jar"/>
</lib>
</war>
<delete dir="./temp"/>
</target>
<target name="web-deploy" depends="web-dist">
<delete file="${web.container}/${project.name}.war"/>
<delete dir="${web.container}/${project.name}"/>
<copy tofile="${web.container}/${project.name}.war" file="${war}"/>
</target>
</project>