forked from restfb/restfb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
157 lines (136 loc) · 6.53 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- @author Mark Allen @author Scott Hernandez -->
<project name="RestFB" default="dist" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="libraryVersion" value="1.6.13-DEVELOPMENT" />
<!-- Directories -->
<property name="sourceDir" value="source" />
<property name="librarySourceDir" value="${sourceDir}/library" />
<property name="testSourceDir" value="${sourceDir}/test" />
<property name="buildDir" value="build" />
<property name="classesDir" value="${buildDir}/classes" />
<property name="javadocDir" value="${buildDir}/javadoc" />
<property name="mavenDir" value="${buildDir}/maven" />
<property name="licensingDir" value="licensing" />
<property name="miscDir" value="misc" />
<property name="websiteDir" value="website" />
<!-- Java switches -->
<property name="javaVersion" value="1.5" />
<property name="javaDebug" value="true" />
<property name="javaDebugLevel" value="lines,source" />
<!-- Maven settings - see https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide -->
<property name="mavenGroupId" value="com.restfb" />
<property name="mavenArtifactId" value="restfb" />
<property name="mavenJar" value="${mavenDir}/${mavenArtifactId}-${libraryVersion}.jar" />
<property name="mavenJavadocJar" value="${mavenDir}/${mavenArtifactId}-${libraryVersion}-javadoc.jar" />
<property name="mavenSourcesJar" value="${mavenDir}/${mavenArtifactId}-${libraryVersion}-sources.jar" />
<property name="mavenSnapshotsRepositoryId" value="sonatype-nexus-snapshots" />
<property name="mavenSnapshotsRepositoryUrl" value="https://oss.sonatype.org/content/repositories/snapshots" />
<property name="mavenStagingRepositoryId" value="sonatype-nexus-staging" />
<property name="mavenStagingRepositoryUrl" value="https://oss.sonatype.org/service/local/staging/deploy/maven2" />
<target name="compile" description="Compiles library code">
<mkdir dir="${classesDir}" />
<echo message="Compiling..." />
<javac srcdir="${librarySourceDir}" destdir="${classesDir}" source="${javaVersion}" target="${javaVersion}"
debug="${javaDebug}" debuglevel="${javaDebugLevel}" />
</target>
<target name="dist" depends="clean, compile, doc" description="Builds the RestFB distribution">
<echo message="Building distribution..." />
<mkdir dir="${buildDir}" />
<jar destfile="${buildDir}/restfb-${libraryVersion}.jar">
<fileset dir="${librarySourceDir}" />
<fileset dir="${classesDir}" />
</jar>
<zip destfile="${buildDir}/restfb-${libraryVersion}.zip">
<zipfileset dir="." prefix="restfb-${libraryVersion}">
<include name="${sourceDir}/**" />
<include name="${licensingDir}/**" />
<include name="${miscDir}/**" />
<include name="build.xml" />
</zipfileset>
<zipfileset dir="${buildDir}" prefix="restfb-${libraryVersion}">
<include name="restfb-*.jar" />
<include name="javadoc/**" />
</zipfileset>
</zip>
</target>
<target name="doc" description="Builds Javadoc">
<echo message="Building Javadoc..." />
<mkdir dir="${javadocDir}" />
<!-- TODO: make a stylesheet that looks good with Java 7's new javadoc -->
<!-- stylesheetfile="${miscDir}/javadoc/javadoc.css" -->
<javadoc destdir="${javadocDir}" author="true" version="true" use="true" windowtitle="RestFB" access="public"
overview="${miscDir}/javadoc/overview.html" linksource="yes">
<packageset dir="${librarySourceDir}" defaultexcludes="yes" />
<doctitle><![CDATA[<h1>RestFB ${libraryVersion}</h1>]]></doctitle>
<bottom><![CDATA[<i>RestFB ${libraryVersion}. Copyright © 2010-2013 Mark Allen. All Rights Reserved.</i>]]></bottom>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
</javadoc>
</target>
<target name="website" description="Creates the restfb.com website" depends="doc">
<zip destfile="${buildDir}/website.zip">
<fileset dir="${buildDir}" includes="javadoc/**" />
<fileset dir="${websiteDir}" />
</zip>
</target>
<target name="clean" description="Gets rid of build artifacts">
<echo message="Cleaning build artifacts..." />
<mkdir dir="${buildDir}" />
<delete includeEmptyDirs="true">
<fileset dir="${buildDir}" includes="**/*" />
</delete>
</target>
<target name="mavenBuild" depends="clean, compile, doc" description="Builds the RestFB distribution for Maven central deployment">
<echo message="Building Maven distribution..." />
<mkdir dir="${mavenDir}" />
<jar destfile="${mavenJar}">
<fileset dir="${classesDir}" />
</jar>
<jar destfile="${mavenSourcesJar}">
<fileset dir="${librarySourceDir}" />
</jar>
<jar destfile="${mavenJavadocJar}">
<fileset dir="${javadocDir}" />
</jar>
</target>
<target name="mavenDeploySnapshot" depends="mavenBuild" description="Deploy a snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${mavenSnapshotsRepositoryUrl}" />
<arg value="-DrepositoryId=${mavenSnapshotsRepositoryId}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${mavenJar}" />
</artifact:mvn>
</target>
<!-- Before this, remove SNAPSHOT from project version in both build.xml and pom.xml -->
<target name="mavenDeployRelease" depends="mavenBuild" description="Deploy a 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=${mavenStagingRepositoryUrl}" />
<arg value="-DrepositoryId=${mavenStagingRepositoryId}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${mavenJar}" />
<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=${mavenStagingRepositoryUrl}" />
<arg value="-DrepositoryId=${mavenStagingRepositoryId}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${mavenSourcesJar}" />
<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=${mavenStagingRepositoryUrl}" />
<arg value="-DrepositoryId=${mavenStagingRepositoryId}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${mavenJavadocJar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
</project>