-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
190 lines (170 loc) · 9.19 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!--
/*
* hashshmash - An aspectj project to evaluate hashCode() distribution effectiveness
* Copyright 2013-2024 MeBigFatGuy.com
* Copyright 2013-2024 Dave Brosius
*
* 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="hashshmash" default="info">
<property file="build.properties"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="aj.dir" value="${basedir}/aj"/>
<property name="samples.dir" value="${basedir}/samples"/>
<property name="target.dir" value="${basedir}/target"/>
<property name="classes.dir" value="${target.dir}/classes"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="javadoc.dir" value="${target.dir}/javadoc"/>
<property name="javac.source" value="1.7"/>
<property name="javac.target" value="1.7"/>
<property name="javac.deprecation" value="on"/>
<property name="javac.debug" value="on"/>
<property name="hashshmash.version" value="0.3.0"/>
<property name="sonatype.dir" value="${user.home}/.hashshmash-${hashshmash.version}-sonatype" />
<path id="hashshmash.classpath">
<pathelement location="${lib.dir}/xml-apis.jar"/>
<pathelement location="${lib.dir}/xalan.jar"/>
<pathelement location="${lib.dir}/serializer.jar"/>
<pathelement location="${lib.dir}/ant.jar"/>
<pathelement location="${lib.dir}/aspectjrt.jar"/>
<pathelement location="${target.dir}/hashshmash-${hashshmash.version}.jar"/>
</path>
<target name="info">
<echo message="hashshmash - a collections statistics library applied through aspects"/>
<echo message=""/>
<echo message=" this project uses yank (https://github.com/mebigfatguy/yank) for dependency management"/>
<echo message=" download yank.jar and place in ant/lib directory"/>
<echo message=" http://search.maven.org/#artifactdetails%7Ccom.mebigfatguy.yank%7Cyank%7C0.4.2%7Cjar"/>
</target>
<target name="clean" description="removes all generated collateral">
<delete dir="${target.dir}"/>
</target>
<target name="-init" description="prepares repository for a build">
<mkdir dir="${target.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${javadoc.dir}"/>
</target>
<target name="yank" unless="no.yank" depends="-init" xmlns:yank="antlib:com.mebigfatguy.yank" description="pull 3rdparty jars to the lib directory">
<yank:yank yankFile="${basedir}/yank.xls" destination="${lib.dir}" stripVersions="true" source="true" separateClassifierTypes="true">
<server url="https://repo1.maven.org/maven2"/>
</yank:yank>
</target>
<target name="resources" depends="-init" description="copies resources to classes">
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.xml"/>
<include name="**/*.xslt"/>
<include name="**/*.css"/>
</fileset>
</copy>
</target>
<target name="compile" depends="-init, yank, resources" description="compiles java files">
<javac srcdir="${src.dir}" destdir="${classes.dir}" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" debug="${javac.debug}" includeantruntime="false">
<classpath refid="hashshmash.classpath" />
</javac>
<taskdef name="iajc" classname="org.aspectj.tools.ant.taskdefs.AjcTask" classpath="${lib.dir}/aspectjtools.jar"/>
<iajc source="1.6" sourceroots="${aj.dir}" destDir="${classes.dir}" classpath="${lib.dir}/aspectjrt.jar;${classes.dir}">
</iajc>
</target>
<target name="jar" depends="-init, yank, compile" description="produces the hashshmash jar file">
<jar destfile="${target.dir}/hashshmash-${hashshmash.version}.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<include name="**/*.xml"/>
<include name="**/*.xslt"/>
<include name="**/*.css"/>
</fileset>
<fileset dir="${basedir}">
<include name="**/license.txt"/>
</fileset>
<manifest>
<attribute name="hashshmash-version" value="${hashshmash.version}"/>
<attribute name="Application-Name" value="HashShmash" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="*" />
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="hashshmash ant task"/>
<attribute name="Bundle-SymbolicName" value="hashshmash; singleton:=true"/>
<attribute name="Bundle-Version" value="${hashshmash.version}"/>
<attribute name="Bundle-ClassPath" value="."/>
<attribute name="Bundle-Vendor" value="hashshmash Project"/>
<attribute name="Bundle-ActivationPolicy" value="lazy"/>
</manifest>
</jar>
</target>
<target name="srczip" description="builds the source distribution zip file">
<zip destfile="${target.dir}/hashshmash-${hashshmash.version}-sources.jar">
<fileset dir="${basedir}">
<include name="**/*.aj"/>
<include name="**/*.java"/>
<include name="**/*.xml"/>
<include name="**/*.xslt"/>
<include name="**/*.css"/>
<include name="**/build.*"/>
<include name="**/yank.xls"/>
<include name="**/license.txt"/>
</fileset>
</zip>
</target>
<target name="javadoc" depends="-init" description="build the javadoc for the project">
<javadoc packagenames="com.mebigfatguy.*"
sourcepath="${src.dir}"
classpathref="hashshmash.classpath"
destdir="${javadoc.dir}"
windowtitle="hashshmash api">
<doctitle><![CDATA[<h1>hashshmash javadoc</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2013-2015 MeBigFatGuy.com. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<target name="build" depends="clean, -init, jar" description="builds the hashshmash jar">
</target>
<target name="report" depends="jar" description="generates html reports based on hashshmash aspect statistics generation">
<java classname="com.mebigfatguy.hashshmash.Report" classpathref="hashshmash.classpath"/>
</target>
<target name="release" depends="build, srczip, javadoc" description="prepares everything for a release"/>
<target name="sonatype" depends="release" description="prepare an artifact bundle for sonatype">
<mkdir dir="${sonatype.dir}"/>
<copy todir="${sonatype.dir}" file="${target.dir}/hashshmash-${hashshmash.version}.jar"/>
<copy tofile="${sonatype.dir}/hashshmash-${hashshmash.version}-sources.jar" file="${target.dir}/hashshmash-${hashshmash.version}-sources.jar"/>
<jar destfile="${sonatype.dir}/hashshmash-${hashshmash.version}-javadoc.jar" basedir="${target.dir}" includes="javadoc/**"/>
<copy tofile="${sonatype.dir}/hashshmash-${hashshmash.version}.pom" file="${basedir}/pom.xml"/>
<exec executable="gpg">
<arg value="-abi" />
<arg value="${sonatype.dir}/hashshmash-${hashshmash.version}.jar" />
</exec>
<exec executable="gpg">
<arg value="-abi" />
<arg value="${sonatype.dir}/hashshmash-${hashshmash.version}.pom" />
</exec>
<exec executable="gpg">
<arg value="-abi" />
<arg value="${sonatype.dir}/hashshmash-${hashshmash.version}-sources.jar" />
</exec>
<exec executable="gpg">
<arg value="-abi" />
<arg value="${sonatype.dir}/hashshmash-${hashshmash.version}-javadoc.jar" />
</exec>
<jar destfile="${sonatype.dir}/bundle.jar" basedir="${sonatype.dir}" includes="hashshmash*">
</jar>
<echo message="" />
<echo message="" />
<echo message="====================================================================================================================================" />
<echo message="sonatype update bundle produced at ${sonatype.dir}/bundle.jar" />
<echo message="upload this jar at https://oss.sonatype.org" />
<echo message="" />
<echo message="see link for details-> https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository" />
<echo message="====================================================================================================================================" />
</target>
</project>