forked from mhgrove/4Store-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
151 lines (128 loc) · 4.88 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
<?xml version="1.0"?>
<!--
~ Copyright (c) 2005-2010 Clark & Parsia, LLC. <http://www.clarkparsia.com>
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project name="4Store-API" default="dist" basedir=".">
<description>
Clark & Parsia 4Store API
</description>
<!-- Global Properties -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="project.name" value="cp-common-fourstore" />
<property name="mainclass" value="com.clarkparsia.fourstore.cli.Console" />
<property name="project.version" value="0.4" />
<path id="project.class.path">
<pathelement location="lib/" />
<pathelement location="${build}" />
<fileset dir="lib">
<include name="**/*.jar"/>
<exclude name="**/${project.name}*.jar"/>
</fileset>
</path>
<target name="init">
<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}"/>
</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}/src">
<fileset dir="${src}">
<include name="**/*.java" />
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir=".">
<include name="4store.sh" />
</fileset>
</copy>
<copy todir="${dist}/lib">
<fileset dir="lib">
<include name="**/*.jar" />
<exclude name="**/${project.name}*.jar"/>
</fileset>
</copy>
</target>
<target name="dist" depends="build,distfiles"
description="Generate a distribution" >
<!-- Generate relative classpath for jar file -->
<property name="rlib" location="${basedir}/lib/"/>
<pathconvert dirsep="/" pathsep=" " property="Class-Path">
<map from="${rlib}/" to=""/>
<map from="${rlib}\" to=""/>
<path>
<fileset dir="${rlib}">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<echo>${Class-Path}</echo>
<!-- Make Jar file. -->
<jar jarfile="${dist}/lib/${project.name}-${project.version}.jar"
basedir="${build}">
<manifest>
<attribute name="Main-Class" value="${mainclass}"/>
<attribute name="Class-Path" value="${Class-Path}" />
</manifest>
</jar>
</target>
<target name="clean" description="Clean up build files">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="zip" depends="dist">
<zip destfile="${dist}/${project.name}-${project.version}-${DSTAMP}.zip">
<zipfileset dir="${dist}" prefix="${project.name}-${project.version}">
<include name="**/*"/>
<exclude name="**/src/**"/>
<exclude name="**/*.zip"/>
</zipfileset>
</zip>
</target>
<target name="test" depends="dist">
<mkdir dir="dist/test-reports"/>
<junit fork="yes" printsummary="no" haltonfailure="no">
<jvmarg value="-Xmx1024m"/>
<test name="com.clarkparsia.fourstore.test.FourStoreAPITestSuite" outfile="dist/test-reports/report"/>
<formatter type="xml" />
<classpath refid="project.class.path"/>
</junit>
<junitreport todir="dist/test-reports">
<fileset dir="dist/test-reports">
<include name="TEST-*.xml" />
</fileset>
<report todir="dist/test-reports" />
</junitreport>
</target>
</project>