-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
109 lines (93 loc) · 3.88 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
@author Transmogrify, LLC.
-->
<project name="RestFB" default="dist">
<!-- Directories -->
<property name="sourceDir" value="source" />
<property name="librarySourceDir" value="${sourceDir}/library" />
<property name="antBuildDir" value="build/ant" />
<property name="antClassesDir" value="${antBuildDir}/classes" />
<property name="antJavadocDir" value="${antBuildDir}/javadoc" />
<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" />
<!-- Other -->
<property name="libraryVersion" value="1.6" />
<target name="compile" description="Compiles library code">
<mkdir dir="${antClassesDir}" />
<echo message="Compiling..." />
<javac srcdir="${librarySourceDir}" destdir="${antClassesDir}"
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..." />
<jar destfile="${antBuildDir}/restfb-${libraryVersion}.jar">
<fileset dir="${librarySourceDir}" />
<fileset dir="${antClassesDir}" />
</jar>
<zip destfile="${antBuildDir}/restfb-${libraryVersion}.zip">
<fileset dir=".">
<include name="${sourceDir}/**" />
<include name="${licensingDir}/**" />
<include name="${miscDir}/**" />
<include name="build.xml" />
</fileset>
<fileset dir="${antBuildDir}">
<include name="restfb-*.jar" />
<include name="javadoc/**" />
</fileset>
</zip>
</target>
<target name="doc" description="Builds Javadoc">
<echo message="Building Javadoc..." />
<mkdir dir="${antJavadocDir}" />
<copy todir="${antJavadocDir}">
<fileset dir="${websiteDir}" includes="*.ttf" />
</copy>
<javadoc destdir="${antJavadocDir}" author="true" version="true"
use="true" windowtitle="RestFB" access="public" stylesheetfile="${miscDir}/javadoc.css">
<packageset dir="${librarySourceDir}" defaultexcludes="yes" />
<doctitle><![CDATA[<h1>RestFB</h1>]]></doctitle>
<bottom><![CDATA[<i>RestFB version ${libraryVersion}. Copyright © 2010 Mark Allen. All Rights Reserved.</i>]]></bottom>
<link href="http://java.sun.com/javase/6/docs/api/" />
<link href="http://java.sun.com/javaee/5/docs/api/" />
<link href="http://logging.apache.org/log4j/1.2/apidocs/" />
</javadoc>
</target>
<target name="website" description="Creates the restfb.com website"
depends="doc">
<zip destfile="${antBuildDir}/website.zip">
<fileset dir="${antBuildDir}" includes="javadoc/**" />
<fileset dir="${websiteDir}" />
</zip>
</target>
<!--
Branches and tags the RestFB code in SVN. You must provide a version
parameter, like so: ant -Dversion=1.99 branch-and-tag NOTE: THIS
ASSUMES YOU'RE BRANCHING FROM THE TRUNK!
-->
<target name="branch-and-tag" description="Branches and tags the RestFB code">
<echo
message="Branching and tagging version ${version}, this may take a few seconds..." />
<!-- Branch -->
<exec executable="svn">
<arg
line='--username mark.a.allen copy -m "Creating ${version} release branch" https://restfb.googlecode.com/svn/trunk https://restfb.googlecode.com/svn/branches/RB-${version}' />
</exec>
<!-- Tag -->
<exec executable="svn">
<arg
line='--username mark.a.allen copy -m "Tagging ${version} release" https://restfb.googlecode.com/svn/branches/RB-${version} https://restfb.googlecode.com/svn/tags/REL-${version}' />
</exec>
</target>
<target name="clean" description="Gets rid of build artifacts">
<echo message="Cleaning build artifacts..." />
<delete dir="${antBuildDir}" includeEmptyDirs="true" />
</target>
</project>