forked from restfb/restfb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
187 lines (162 loc) · 8.1 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
<?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">
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath"/>
<artifact:pom id="restfbpom" file="pom.xml"/>
<property name="libraryVersion" value="${restfbpom.version}"/>
<!-- Directories -->
<property name="sourceDir" value="src"/>
<property name="librarySourceDir" value="${sourceDir}/main/java"/>
<property name="testSourceDir" value="${sourceDir}/test/java"/>
<property name="buildDir" value="build"/>
<property name="classesDir" value="${buildDir}/classes"/>
<property name="javadocDir" value="${buildDir}/javadoc"/>
<property name="delombokDir" value="${buildDir}/src-delomboked"/>
<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.7"/>
<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="delombokSourcesJar" value="${buildDir}/${mavenArtifactId}-${libraryVersion}-delombok-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"/>
<artifact:dependencies pathId="dependency.classpath">
<dependency groupId="org.projectlombok" artifactId="lombok" version="1.16.6" scope="provided"/>
<dependency groupId="org.slf4j" artifactId="slf4j-api" version="1.7.21" scope="provided"/>
</artifact:dependencies>
<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}" classpathref="dependency.classpath"/>
</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="delombok">
<taskdef classname="lombok.delombok.ant.Tasks$Delombok" classpathref="dependency.classpath" name="delombok"/>
<mkdir dir="${delombokDir}"/>
<delombok verbose="true" encoding="UTF-8" to="${delombokDir}">
<fileset dir="${librarySourceDir}">
<include name="**/*.java"/>
</fileset>
<format value="suppressWarnings:skip"/>
</delombok>
</target>
<target name="delombokJar" depends="delombok" description="Builds the RestFB sources jar with delomboked sources">
<echo message="Building delomboked source jar"/>
<jar destfile="${delombokSourcesJar}">
<fileset dir="${delombokDir}"/>
</jar>
</target>
<target name="doc" description="Builds Javadoc" depends="delombok">
<echo message="Building Javadoc..."/>
<mkdir dir="${javadocDir}"/>
<javadoc destdir="${javadocDir}" author="true" version="true" use="true"
windowtitle="RestFB ${libraryVersion}" access="public"
overview="${miscDir}/javadoc/overview.html" linksource="yes"
stylesheetfile="${miscDir}/javadoc/stylesheet.css">
<packageset dir="${delombokDir}" defaultexcludes="yes"/>
<doctitle><![CDATA[<h1>RestFB ${libraryVersion}</h1>]]></doctitle>
<bottom>
<![CDATA[<i>RestFB ${libraryVersion}. Copyright © 2010-2015 Mark Allen. All Rights Reserved.</i>]]></bottom>
<link href="http://docs.oracle.com/javase/7/docs/api/"/>
<taglet name="com.restfb.taglets.GraphApiSince" path="lib/restfb-taglets-1.0.jar"/>
<taglet name="com.restfb.taglets.GraphApiUntil" path="lib/restfb-taglets-1.0.jar"/>
</javadoc>
</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>