-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
185 lines (166 loc) · 7.18 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
<!--
Copyright © 2009 Ray Vanderborght
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project name="morbok" default="dist">
<property file="build.properties" />
<path id="morbok.deps.path">
<fileset dir="deps">
<include name="*.jar" />
</fileset>
<fileset dir="deps/lombok">
<include name="**/*.jar" />
</fileset>
</path>
<path id="morbok.libs.path">
<fileset dir="lib/lombok">
<include name="**/*.jar" />
</fileset>
</path>
<target name="clean" description="Removes all generated files">
<delete dir="build" quiet="true" />
<delete dir="dist" quiet="true" />
</target>
<target name="compile" description="Compiles the code">
<mkdir dir="build/morbok" />
<!-- This version trickery is so that an eclipse running in a JVM 1.5 will run
properly (It'll never touch the javac files and hence never trigger a
Bad Class Version Number error, but for javac we definitely cannot support
javac 1.5, partly because they completely rewrote large swaths of javac,
and partly because our injection mechanism (annotations) doesn't work very
well on javac 1.5, hence, when using javac, we do demand you're on 1.6. -->
<javac srcdir="src" debug="on" destdir="build/morbok" target="1.5" excludes="lombok/javac/**">
<classpath refid="morbok.deps.path" />
<classpath refid="morbok.libs.path" />
</javac>
<javac srcdir="src" debug="on" destdir="build/morbok" target="1.6" includes="lombok/javac/**">
<classpath refid="morbok.deps.path" />
<classpath refid="morbok.libs.path" />
</javac>
<copy todir="build/morbok">
<fileset dir="src">
<exclude name="**/*.java" />
<exclude name="**/*.class" />
<exclude name="**/*.svg" />
</fileset>
</copy>
<mkdir dir="build/morbok/META-INF" />
<mkdir dir="build/morbok/META-INF/services" />
<echo file="build/morbok/META-INF/services/javax.annotation.processing.Processor">lombok.javac.apt.Processor</echo>
</target>
<target name="version" description="Shows the version number">
<mkdir dir="build/morbok" />
<javac srcdir="src" debug="on" destdir="build/morbok" target="1.5" includes="morbok/core/Version.java" />
<java
classname="morbok.core.Version"
classpath="build/morbok"
failonerror="true"
output="build/version.txt" />
<loadresource property="morbok.version">
<file file="build/version.txt" />
<filterchain>
<striplinebreaks />
</filterchain>
</loadresource>
<echo level="info">Morbok version: ${morbok.version}</echo>
</target>
<target name="javadoc" description="Generates the javadoc" depends="version">
<delete dir="build/api" quiet="true" />
<delete dir="doc/api" quiet="true" />
<mkdir dir="build/api" />
<javadoc sourcepath="src" defaultexcludes="yes" destdir="build/api" windowtitle="Morbok">
<classpath refid="morbok.deps.path" />
<classpath refid="morbok.libs.path" />
<link href="http://java.sun.com/javase/6/docs/api/" offline="true" packagelistLoc="./deps/javadoc/java6"/>
<header><![CDATA[<a href='http://code.google.com/p/morbok/'>Morbok</a> - ]]>v${morbok.version}</header>
<bottom><![CDATA[<i>Copyright © 2009 Ray Vanderborght, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php'>MIT licence</a>.]]></bottom>
</javadoc>
<mkdir dir="doc/api" />
<copy todir="doc/api">
<fileset dir="build/api" includes="**/*.html" />
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="(Generated by javadoc)|(.META NAME=.date.)" />
</linecontainsregexp>
</filterchain>
</copy>
<copy todir="doc/api">
<fileset dir="build/api" excludes="**/*.html" />
</copy>
</target>
<target name="-unpackLibs">
<unjar dest="build/morbok">
<patternset>
<include name="lombok/installer**/*.*"/>
</patternset>
<path refid="morbok.libs.path" />
</unjar>
</target>
<target name="dist" description="Builds THE morbok.jar file which contains everything " depends="-unpackLibs, compile, version">
<mkdir dir="dist" />
<copy file="doc/changelog.markdown" tofile="build/changelog.txt" />
<jar destfile="dist/morbok-${morbok.version}.jar">
<fileset dir="build/morbok" />
<fileset dir="dist" includes="lombok.eclipse.agent.jar" />
<fileset dir="build" includes="changelog.txt" />
<manifest>
<attribute name="Main-Class" value="lombok.installer.MorbokInstaller" />
<attribute name="Morbok-Version" value="${morbok.version}" />
</manifest>
</jar>
<copy file="dist/morbok-${morbok.version}.jar" tofile="dist/morbok.jar" />
<antcall target="copyToEclipse" />
<antcall target="copyToTestApp" />
</target>
<target name="copyToEclipse" if="eclipse.dir">
<copy file="dist/morbok.jar" todir="${eclipse.dir}" />
</target>
<target name="copyToTestApp" if="testapp.dir">
<copy file="dist/morbok.jar" todir="${testapp.dir}" />
</target>
<property name="credentialsFile" value="google.properties" />
<target name="-credentials">
<available property="hasCredentialsFile" file="${credentialsFile}"/>
</target>
<target name="-checkCredentialsFile" depends="-credentials" unless="hasCredentialsFile">
<echo file="${credentialsFile}">#username=[your google account name without @gmail.com]
#password=[your googlecode password, is NOT your gmail password]</echo>
<fail message="fill in ${credentialsFile} to provide your credentials"/>
</target>
<target name="publish" description="Publishes the latest build to googlecode" depends="-checkCredentialsFile, clean, dist">
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpath="deps/website/ant-googlecode-0.0.2.jar" name="gcupload"/>
<property file="${credentialsFile}" prefix="google" />
<gcupload
username="${google.username}"
password="${google.password}"
projectname="morbok"
filename="dist/morbok.jar"
targetfilename="morbok-${morbok.version}.jar"
summary="Version ${morbok.version}"
labels=""
verbose="true" />
<gcupload
username="${google.username}"
password="${google.password}"
projectname="morbok"
filename="dist/morbok.jar"
targetfilename="morbok.jar"
summary="Version ${morbok.version} - The morbok jar."
labels="Featured"
verbose="true" />
</target>
</project>