Skip to content

Commit 3481084

Browse files
committed
add build target to generate bundle for distribution via maven central
1 parent ab965c0 commit 3481084

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

build.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<manifest>
3434
<attribute name="Implementation-Title" value="${ant.project.name}"/>
3535
<attribute name="Implementation-Vendor" value="YouDevise"/>
36-
<attribute name="Implementation-Version" value="@{moduleversion}"/>
36+
<attribute name="Implementation-Version" value="${version.label}"/>
3737
<attribute name="Built-By" value="${user.name}"/>
3838
<attribute name="Built-Date" value="${build.timestamp}"/>
3939
</manifest>
@@ -54,6 +54,16 @@
5454
</jar>
5555
</target>
5656

57+
<target name="-jar-javadoc">
58+
<mkdir dir="${build.dir}/javadoc"/>
59+
<javadoc packagenames="*" sourcepath="${basedir}/src/main/java" defaultexcludes="yes"
60+
destdir="${build.dir}/javadoc" author="true" version="true" use="true" windowtitle="${ant.project.name}"/>
61+
<jar destfile="${build.dir}/${ant.project.name}-${version.label}-javadoc.jar">
62+
<fileset dir="${build.dir}/javadoc"/>
63+
<fileset dir="${basedir}" includes="LICENSE README.md"/>
64+
</jar>
65+
</target>
66+
5767
<target name="test" description="Test this project" depends="jar">
5868
<mkdir dir="${build.dir}/testreport"/>
5969
<mkdir dir="${build.dir}/test.tmp"/>
@@ -73,4 +83,16 @@
7383

7484
<target name="snapshot" description="Create a tested snapshot jar file" depends="test"/>
7585
<target name="release" description="Create a tested release jar file" depends="-version-for-release,snapshot"/>
86+
<target name="bundle" description="Create a release bundle for deployment to maven central" depends="release,-jar-javadoc">
87+
<copy file="${ant.project.name}.pom" tofile="${build.dir}/${ant.project.name}-${version.label}.pom">
88+
<filterset><filter token="VERSION" value="${version.label}"/></filterset>
89+
</copy>
90+
<exec executable="gpg" dir="${build.dir}"><arg value="-ab"/><arg value="${ant.project.name}-${version.label}.pom"/></exec>
91+
<exec executable="gpg" dir="${build.dir}"><arg value="-ab"/><arg value="${ant.project.name}-${version.label}.jar"/></exec>
92+
<exec executable="gpg" dir="${build.dir}"><arg value="-ab"/><arg value="${ant.project.name}-${version.label}-javadoc.jar"/></exec>
93+
<exec executable="gpg" dir="${build.dir}"><arg value="-ab"/><arg value="${ant.project.name}-${version.label}-sources.jar"/></exec>
94+
<jar destfile="${build.dir}/bundle.jar">
95+
<fileset dir="${build.dir}" includes="${ant.project.name}-${version.label}*"/>
96+
</jar>
97+
</target>
7698
</project>

java-statsd-client.pom

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>com.timgroup</groupId>
4+
<artifactId>tatin</artifactId>
5+
<packaging>jar</packaging>
6+
<name>java-statsd-client</name>
7+
<version>@VERSION@</version>
8+
<description>A tiny library allowing Java applications to communicate with statsd instances easily.</description>
9+
<url>http://github.com/youdevise/java-statsd-client</url>
10+
<licenses>
11+
<license>
12+
<name>The MIT License (MIT)</name>
13+
<url>http://opensource.org/licenses/MIT</url>
14+
<distribution>repo</distribution>
15+
</license>
16+
</licenses>
17+
<scm>
18+
<url>http://github.com/youdevise/java-statsd-client</url>
19+
<connection>scm:git:git://github.com/youdevise/java-statsd-client.git</connection>
20+
<developerConnection>scm:git:[email protected]:youdevise/java-statsd-client.git</developerConnection>
21+
</scm>
22+
<developers>
23+
<developer>
24+
<id>scarytom</id>
25+
<name>Tom Denley</name>
26+
<email>[email protected]</email>
27+
</developer>
28+
</developers>
29+
</project>

0 commit comments

Comments
 (0)