-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-stampy-all.xml
138 lines (122 loc) · 5.82 KB
/
build-stampy-all.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
<project name="stampy-all" basedir="." default="release.stampy.all" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- define Maven coordinates -->
<property name="artifactId" value="stampy-all" />
<!-- define artifacts' name, which follows the convention of Maven -->
<property name="maven-jar" value="${basedir}/build/${artifactId}/${artifactId}-${version}.jar" />
<property name="maven-javadoc-jar" value="${basedir}/build/${artifactId}/${artifactId}-${version}-javadoc.jar" />
<property name="maven-sources-jar" value="${basedir}/build/${artifactId}/${artifactId}-${version}-sources.jar" />
<target name="deploy" depends="release.stampy.all, create.pom" 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=${maven-jar}" />
</artifact:mvn>
</target>
<target name="create.pom">
<delete file="${basedir}/pom.xml" />
<copyfile dest="${basedir}/pom.xml" src="${basedir}/maven/pom.txt"/>
<loadfile property="deps" srcfile="${basedir}/maven/dep-all.txt" />
<replace file="${basedir}/pom.xml" token="$dependencies" value="${deps}" />
<replace file="${basedir}/pom.xml" token="$groupId" value="${groupId}" />
<replace file="${basedir}/pom.xml" token="$artifactId" value="${artifactId}" />
<replace file="${basedir}/pom.xml" token="$version" value="${version}" />
<replace file="${basedir}/pom.xml" token="$name" value="Stampy All" />
</target>
<target name="stage" depends="release.stampy.all, create.pom" 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=${maven-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=${maven-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=${maven-javadoc-jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
<path id="stampy.classpath">
<fileset dir="${basedir}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<path id="stampy.src">
<fileset dir="${basedir}/src" />
<fileset dir="${basedir}/client-server" />
<fileset dir="${basedir}/mina" />
<fileset dir="${basedir}/netty" />
<fileset dir="${basedir}/examples" />
</path>
<target name="release.stampy.all" depends="jar.stampy.all.src, jar.stampy.all.javadoc, jar.stampy.all" />
<target name="compile.stampy.all">
<javac target="1.5" source="1.5" debug="true" destdir="${basedir}/build/bin">
<src path="${basedir}/src" />
<src path="${basedir}/client-server" />
<src path="${basedir}/mina" />
<src path="${basedir}/netty" />
<src path="${basedir}/examples" />
<classpath refid="stampy.classpath" />
</javac>
</target>
<target name="jar.stampy.all" depends="compile.stampy.all">
<jar destfile="${basedir}/build/stampy-all/stampy-all-${version}.jar" basedir="${basedir}/build/bin">
<manifest id="stampy.all.manifest">
<attribute name="Built-By" value="${jar.built.by}" />
<attribute name="Email-Address" value="${jar.email.address}" />
<attribute name="Project-Website" value="${jar.project.website}" />
<attribute name="Release-Number" value="${version}" />
<attribute name="Release-Description" value="${releaseDescription}" />
</manifest>
</jar>
</target>
<target name="jar.stampy.all.javadoc">
<jar destfile="${basedir}/build/stampy-all/stampy-all-${version}-javadoc.jar" basedir="${basedir}/build/javadoc">
<fileset dir="${basedir}/build/javadoc">
<include name="stampy-core" />
<include name="stampy-client-server" />
<include name="stampy-NETTY-client-server-RI" />
<include name="stampy-MINA-client-server-RI" />
<include name="stampy-examples" />
</fileset>
<manifest id="stampy.all.manifest">
<attribute name="Built-By" value="${jar.built.by}" />
<attribute name="Email-Address" value="${jar.email.address}" />
<attribute name="Project-Website" value="${jar.project.website}" />
<attribute name="Release-Number" value="${version}" />
<attribute name="Release-Description" value="${releaseDescription}" />
</manifest>
</jar>
</target>
<target name="jar.stampy.all.src">
<jar destfile="${basedir}/build/stampy-all/stampy-all-${version}-sources.jar">
<path refid="stampy.src" />
<manifest id="stampy.all.manifest">
<attribute name="Built-By" value="${jar.built.by}" />
<attribute name="Email-Address" value="${jar.email.address}" />
<attribute name="Project-Website" value="${jar.project.website}" />
<attribute name="Release-Number" value="${version}" />
<attribute name="Release-Description" value="${releaseDescription}" />
</manifest>
</jar>
</target>
</project>