forked from peichhorn/lombok-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
211 lines (181 loc) · 8.35 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="lombok-pg" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
This buildfile is part of lombok-pg. It is the main entry point that contains
the common tasks and can be called on to run the main aspects of all the sub-scripts.
</description>
<property name="build.compiler" value="javac1.6" />
<!-- resolve -->
<property name="ivy.retrieve.pattern" value="lib/[conf]/[artifact].[ext]" />
<available file="lib/ivyplusplus.jar" property="ivyplusplus.available" />
<target name="download-ipp" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="http://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="download-maven-ant-tasks" unless="maven.available">
<mkdir dir="lib" />
<get src="http://apache.lehtivihrea.org//maven/binaries/maven-ant-tasks-2.1.3.jar" dest="lib/maven-ant-tasks.jar" usetimestamp="true" />
</target>
<target name="ensure-ipp" depends="download-ipp">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
</target>
<target name="ensure-maven-ant-tasks" depends="download-maven-ant-tasks">
<taskdef classpath="lib/maven-ant-tasks.jar" resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" />
</target>
<target name="config-ivy" depends="ensure-ipp">
<ivy:configure file="buildScripts/ivysettings.xml" />
</target>
<target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps, ensureContribDeps" description="Downloads all dependencies." />
<target name="ensureBuildDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build" />
<ivy:retrieve />
</target>
<target name="ensureRuntimeDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" />
<ivy:retrieve />
</target>
<target name="ensureTestDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test" />
<ivy:retrieve />
</target>
<target name="ensureContribDeps" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing lombok.ast.">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib" />
<ivy:retrieve />
</target>
<!-- IDE integration -->
<target name="eclipse" depends="deps" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target.">
<ivy:eclipsegen source="1.6">
<srcdir dir="src/core" />
<srcdir dir="src/eclipse" />
<srcdir dir="src/javac" />
<srcdir dir="test/eclipse" />
<srcdir dir="test/javac" />
<conf name="build" sources="contrib" />
<conf name="test" sources="contrib" />
<settings>
<url url="http://cloud.github.com/downloads/peichhorn/lombok-pg/lombok.eclipse.settings" />
</settings>
<apt location="lib/build/spi.jar" />
</ivy:eclipsegen>
<condition property="startOnFirstThread" value="-XstartOnFirstThread" else="">
<os family="mac" />
</condition>
<copy file="buildScripts/eclipse-debug-target.template" tofile="LombokizedEclipse.launch" preservelastmodified="true" overwrite="true">
<filterset>
<filter token="START_ON_FIRST_THREAD" value="${startOnFirstThread}" />
</filterset>
</copy>
</target>
<!-- clean -->
<target name="clean" description="Removes all generated files.">
<delete dir="build" quiet="true" />
</target>
<target name="distclean" depends="clean" description="Deletes everything that this build script has ever generated.">
<delete dir="lib" quiet="true" />
<delete dir="dist" quiet="true" />
<delete file=".project" quiet="true" />
<delete file=".classpath" quiet="true" />
<delete dir=".settings" quiet="true" />
<delete dir="ivyCache" quiet="true" />
</target>
<!-- compile -->
<path id="build.path">
<fileset dir="lib/build">
<include name="*.jar" />
</fileset>
</path>
<target name="unpackLibs" depends="ensureBuildDeps">
<ivy:cachedunjar dest="build/lombok-pg" marker="build/unpackDeps.marker">
<fileset file="lib/build/lombok.jar" />
</ivy:cachedunjar>
</target>
<target name="compile" depends="ensureBuildDeps, unpackLibs" description="Compiles the code.">
<delete file="build/lombok-pg/META-INF/services/javax.annotation.processing.Processor" quiet="true" />
<ivy:compile destdir="build/lombok-pg" source="1.6" target="1.6" includeantruntime="false">
<src path="src/core" />
<src path="src/eclipse" />
<src path="src/javac" />
<classpath location="build/lombok-pg" />
<classpath refid="build.path" />
</ivy:compile>
<mkdir dir="build/lombok-pg/META-INF" />
<mkdir dir="build/lombok-pg/META-INF/services" />
<echo file="build/lombok-pg/META-INF/services/javax.annotation.processing.Processor">lombok.core.AnnotationProcessor</echo>
</target>
<!-- version -->
<target name="version" depends="ensure-ipp" description="Shows the version number." unless="lombok.version">
<mkdir dir="build/lombok-pg" />
<javac includeDestClasses="false" srcdir="src/core" debug="on" destdir="build/lombok-pg" source="1.5" target="1.5" includes="lombok/core/Version.java" includeantruntime="false" />
<java classname="lombok.core.Version" classpath="build/lombok-pg" failonerror="true" output="build/version.txt" />
<ivy:loadversion property="lombok.version" file="build/version.txt" />
<echo level="info">lombok-pg is based on lombok-${lombok.version}</echo>
</target>
<!-- dist -->
<target name="dist" description="Builds THE lombok-pg.jar and lombok-pg-runtime.jar file which contain everything." depends="compile, version">
<mkdir dir="dist" />
<jar destfile="dist/lombok-pg-${lombok.version}.jar">
<fileset dir="build/lombok-pg" />
<fileset dir="." includes="LICENSE" />
<manifest>
<attribute name="Premain-Class" value="lombok.core.LombokPGAgent" />
<attribute name="Agent-Class" value="lombok.core.LombokPGAgent" />
<attribute name="Can-Redefine-Classes" value="true" />
<attribute name="Main-Class" value="lombok.core.Main" />
<attribute name="Lombok-Version" value="${lombok.version}" />
</manifest>
</jar>
<copy file="dist/lombok-pg-${lombok.version}.jar" tofile="dist/lombok-pg.jar" />
<jar destfile="dist/lombok-pg-${lombok.version}-sources.jar">
<fileset dir="src/core" />
<fileset dir="src/eclipse" />
<fileset dir="src/javac" />
<fileset dir="." includes="LICENSE" />
</jar>
<ant antfile="buildScripts/javadoc.ant.xml" target="javadoc" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
</ant>
<jar destfile="dist/lombok-pg-${lombok.version}-javadoc.jar">
<fileset dir="build/javadoc" />
<fileset dir="." includes="LICENSE" />
</jar>
<jar destfile="dist/lombok-pg-${lombok.version}-runtime.jar">
<fileset dir="build/lombok-pg">
<include name="*lombok/Actions*.class" />
<include name="*lombok/Functions*.class" />
<include name="*lombok/Predicates*.class" />
<include name="*lombok/TypeArguments.class" />
</fileset>
<fileset dir="." includes="LICENSE" />
<manifest>
<attribute name="Lombok-Version" value="${lombok.version}" />
</manifest>
</jar>
<property name="lombok.dist.built" value="true" />
</target>
<!-- deploy -->
<target name="deploy" depends="ensure-maven-ant-tasks, dist" description="Deploy snapshot version to Maven snapshot repository">
<copy tofile="dist/pom.xml" overwrite="true" file="buildScripts/maven-pom.xml">
<filterchain>
<replacetokens>
<token key="VERSION" value="${lombok.version}" />
</replacetokens>
</filterchain>
</copy>
<!-- 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=dist/pom.xml" />
<arg value="-Dfile=${maven-jar}" />
</artifact:mvn -->
</target>
<target name="website" description="Prepares the website for distribution.">
<ant antfile="buildScripts/website.ant.xml" target="website" inheritAll="false" />
</target>
<!-- test -->
<path id="test.path">
<fileset dir="lib/test">
<include name="*.jar" />
</fileset>
</path>
</project>