-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
155 lines (124 loc) · 6.5 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="javapns" default="dist" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
A Java implementation of the Apple Push Notification Service.
</description>
<property name="java.target" value="1.5" />
<!-- javapns version id (no spaces allowed!) -->
<property name="javapns.name" value="JavaPNS" />
<property name="javapns.level" value="2.3" />
<!-- status examples: _Beta_1 _Alpha_1 -->
<property name="javapns.status" value="_Beta_3" />
<property name="javapns.revision" value=" r000" />
<property name="javapns.version" value="${javapns.level}${javapns.status}" />
<!-- Maven stage is either SNAPSHOT or RELEASE -->
<property name="javapns.stage" value="SNAPSHOT" />
<property name="src" location="src" />
<property name="build" location="build" />
<property name="doc" location="doc" />
<property name="javadoc" location="${doc}/javadoc" />
<property name="dist.jar" location="${javapns.name}_${javapns.version}.jar" />
<property name="javadoc.jar" location="${javapns.name}_${javapns.version}_javadoc.jar" />
<property name="doc.zip" location="${javapns.name}_${javapns.version}_doc.zip" />
<property name="sources.jar" location="${javapns.name}_${javapns.version}_sources.jar" />
<property name="combined.zip" location="${javapns.name}_${javapns.version}_complete.zip" />
<path id="libpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<!-- define Maven coordinates -->
<property name="groupId" value="com.google.code" />
<property name="artifactId" value="javapns" />
<property name="version" value="${javapns.level}-${javapns.stage}" />
<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" />
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="sonatype-nexus-staging" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<target name="clean" description="Remove all generated files">
<delete dir="${build}" />
</target>
<target name="build" description="Build the javapns project">
<mkdir dir="${build}" />
<delete dir="${build}" />
<mkdir dir="${build}" />
<javac srcdir="${src}" destdir="${build}" classpathref="libpath" source="${java.target}" target="${java.target}" debug="true" debuglevel="lines,vars,source" />
</target>
<target name="jar" depends="build" description="Generate the jar file">
<delete file="${dist.jar}" />
<jar jarfile="${dist.jar}" basedir="${build}">
<manifest>
<attribute name="Implementation-Title" value="${javapns.name}" />
<attribute name="Implementation-Version" value="${javapns.version}${javapns.revision}" />
<attribute name="Implementation-Reference" value="http://code.google.com/p/javapns/" />
</manifest>
</jar>
</target>
<target name="doc" description="Generate the javadocs">
<javadoc sourcepath="${src}" destdir="${javadoc}" classpathref="libpath" overview="src/javapns/overview.html" access="public" link="http://download.oracle.com/javase/1.5.0/docs/api" />
<zip destfile="${doc.zip}" basedir="${doc}" comment="${javapns.name} ${javapns.version}${javapns.revision}" />
</target>
<target name="javadocpack" depends="doc" description="Package the javadoc for Maven">
<!-- build the sources artifact -->
<!-- build the javadoc artifact -->
<jar jarfile="${javadoc.jar}">
<fileset dir="${javadoc}" />
</jar>
</target>
<target name="source" depends="build" description="generate the source">
<!-- build the sources artifact -->
<jar jarfile="${sources.jar}">
<fileset dir="${src}" />
</jar>
</target>
<target name="combine" description="Generate the combined distribution">
<zip destfile="${combined.zip}" comment="${javapns.name} ${javapns.version}${javapns.revision}">
<fileset dir="./" includes="doc/**,src/**,lib/**"/>
<fileset file="${dist.jar}"/>
</zip>
</target>
<target name="dist" depends="jar,doc,combine" />
<target name="dist_maven" depends="dist,source,javadocpack" />
<target name="deploy" depends="dist_maven" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${maven-snapshots-repository-url}" />
<arg value="-DrepositoryId=${maven-snapshots-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${dist.jar}" />
</artifact:mvn>
</target>
<!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE -->
<target name="stage" depends="dist_maven" description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${dist.jar}" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${sources.jar}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${javadoc.jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>