-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
172 lines (157 loc) · 7.77 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2014 RONDHUIT Co.,Ltd.
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="rondhuit.commons" default="commons-jar" basedir=".">
<dirname property="mybase.dir" file="${ant.file.rondhuit.commons}"/>
<property file="${mybase.dir}/version.properties"/>
<property file="${mybase.dir}/build.properties"/>
<path id="common.path.lib">
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="commons-jar" depends="commons-compile" description="make commons jar file">
<jar destfile="${product.jar}" basedir="${cls.dir}"/>
</target>
<target name="commons-compile" description="compile commons">
<mkdir dir="${cls.dir}"/>
<javac srcdir="${src.dir}/java"
destdir="${cls.dir}"
encoding="${compile.encoding}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
debug="${compile.debug}">
<classpath refid="common.path.lib"/>
</javac>
</target>
<target name="commons-javadoc" description="build commons javadoc">
<property name="javadoc.link.java" value="http://docs.oracle.com/javase/jp/6/api/"/>
<delete dir="${javadoc.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<copy todir="${javadoc.dir}/prettify">
<fileset dir="${prettify.dir}"/>
</copy>
<javadoc
overview="src/java/overview.html"
sourcepath="${src.dir}/java"
packagenames="com.rondhuit.commons.*"
failonerror="true"
destdir="${javadoc.dir}"
access="protected"
encoding="${compile.encoding}"
docencoding="${compile.encoding}"
charset="${compile.encoding}"
additionalparam="-J-Dfile.encoding=${compile.encoding}"
author="true"
version="true"
use="true"
locale="ja_JP"
source="${compile.source}"
windowtitle="${PRODUCT_NAME} ${PRODUCT_VERSION} API"
doctitle="${PRODUCT_NAME} ${PRODUCT_VERSION} API"
stylesheetfile="${javadoc.dir}/prettify/stylesheet+prettify.css"
bottom="Copyright &copy; 2012-2014 <a href="http://www.rondhuit.com/">RONDHUIT Co.,Ltd.</a> All Rights Reserved.">
<classpath refid="common.path.lib"/>
<link href="${javadoc.link.java}"/>
<tag name="rh.warning" description="WARNING"/>
<header><![CDATA[
<a href="http://www.rondhuit.com/">RONDHUIT COMMONS Copyright (c) 2012-2014 RONDHUIT Co.,Ltd.</a>
<script src="{@docRoot}/prettify/prettify.js" type="text/javascript"></script>
<script src="{@docRoot}/d3.v2.min.js" type="text/javascript"></script>
<script language="JavaScript">window.onload=function(){windowTitle();prettyPrint();}</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]] } });
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<meta http-equiv="X-UA-Compatible" CONTENT="IE=EmulateIE7" />
]]></header>
</javadoc>
</target>
<!-- ================================================================== -->
<!-- = TEST COMMONS = -->
<!-- ================================================================== -->
<target name="test" depends="commons-compile,test-compile" description="test commons.">
<mkdir dir="${test.result.dir}"/>
<junit printsummary="on"
haltonfailure="no"
errorProperty="tests.failed"
failureProperty="tests.failed"
dir="${src.dir}/test">
<jvmarg line="-Xmx512m -Dfile.encoding=UTF-8"/>
<classpath refid="common.path.lib"/>
<classpath path="${cls.dir}"/>
<classpath path="${test.cls.dir}"/>
<classpath path="${src.dir}/test"/>
<formatter type="brief" usefile="false" if="junit.details"/>
<formatter type="plain"/>
<batchtest fork="yes" todir="${test.result.dir}" unless="testcase">
<fileset dir="${src.dir}/test" includes="**/*Test.java"/>
</batchtest>
<batchtest fork="yes" todir="${test.result.dir}" if="testcase">
<fileset dir="${src.dir}/test" includes="**/${testcase}.java"/>
</batchtest>
</junit>
<fail if="tests.failed">***** Tests failed! *****</fail>
</target>
<target name="test-compile" description="compile commons tests">
<mkdir dir="${test.cls.dir}"/>
<javac srcdir="${src.dir}/test"
destdir="${test.cls.dir}"
encoding="${compile.encoding}"
deprecation="${compile.deprecation}"
source="${compile.source}"
target="${compile.target}"
debug="${compile.debug}">
<classpath refid="common.path.lib"/>
<classpath path="${cls.dir}"/>
</javac>
</target>
<!-- ================================================================== -->
<!-- = PACKAGE = -->
<!-- ================================================================== -->
<target name="package" depends="commons-jar, commons-javadoc" description="make a package for delivery">
<mkdir dir="${dist.dir}"/>
<tar destfile="${dist.dir}/${product.tgz}" compression="gzip" longfile="gnu">
<tarfileset dir="." prefix="${productfull}" includes="CHANGES.txt"/>
<tarfileset dir="." prefix="${productfull}" includes="${product.jar}"/>
<tarfileset dir="." prefix="${productfull}" includes="api/**"/>
<tarfileset dir="${lib.dir}" prefix="${productfull}/lib" includes="**/*.jar, **/*.txt"/>
<tarfileset dir="${tools.dir}" prefix="${productfull}/tools" includes="**/*.js, **/*.css"/>
<tarfileset dir="projects" prefix="${productfull}/projects" includes="**/*.sample, **/*.html.template, **/*.sh, **/*.xml, **/*.txt" followsymlinks="false"/>
</tar>
<tar destfile="${dist.dir}/${productjavadoc.tgz}" compression="gzip" longfile="gnu">
<tarfileset dir="." prefix="${PRODUCT_VERSION}" includes="api/**"/>
</tar>
</target>
<!-- ================================================================== -->
<!-- = CLEANING = -->
<!-- ================================================================== -->
<target name="clean" description="clean all, except downloaded Solr">
<delete dir="${cls.dir}"/>
<delete dir="${test.cls.dir}"/>
<delete dir="${javadoc.dir}"/>
<delete dir="${test.result.dir}"/>
<delete dir="${dist.dir}"/>
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
<fileset dir="." includes="*.jar"/>
</delete>
</target>
<target name="clean-eclipse" description="delete Eclipse files, .project, .classpath and bin/">
<delete dir="bin"/>
<delete>
<fileset dir="." includes=".project,.classpath"/>
</delete>
</target>
</project>