aboutsummaryrefslogtreecommitdiff
path: root/buildScripts/create-eclipse-project.ant.xml
blob: 383ebd8bd51ea848ef507515cd263458c7a7fe28 (plain)
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
212
213
214
215
216
217
218
<!--
 Copyright (C) 2010-2020 The Project Lombok Authors.
  
  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="lombok.create-eclipse-project" default="" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir="..">
	<description>
This buildfile is part of projectlombok.org. It creates the infrastructure needed to develop lombok on eclipse.
	</description>
	
	<target name="eclipse" depends="eclipse.projectfiles, eclipse.testtarget.default" description="Downloads dependencies, create eclipse project files, as well as debug/run test targets. Open this directory as project in eclipse (via import... existing projects)" />
	
	<target name="eclipse.projectfiles" depends="deps">
		<ivy:eclipsegen source="1.6" srcout="bin/main">
			<srcdir dir="src/core" />
			<srcdir dir="src/core8" />
			<srcdir dir="src/launch" />
			<srcdir dir="src/utils" />
			<srcdir dir="src/eclipseAgent" />
			<srcdir dir="src/installer" />
			<srcdir dir="src/delombok" />
			<srcdir dir="src/stubs" srcout="bin/stubs" />
			<srcdir dir="src/support" />
			<srcdir dir="experimental/src" />
			<srcdir dir="test/transform/src" />
			<srcdir dir="test/core/src" />
			<srcdir dir="test/bytecode/src" />
			<srcdir dir="test/configuration/src" />
			<srcdir dir="test/stubs" />
			<conf name="build" sources="sources" />
			<conf name="javac6" sources="sources" />
			<conf name="eclipse-oxygen" sources="sources" />
			<conf name="test" sources="sources" />
			<conf name="buildtools" sources="sources" />
			<local org="org.projectlombok" name="lombok.patcher" dir="../lombok.patcher" />
			<settings>
				<url url="https://projectlombok.org/downloads/lombok.eclipse.settings" />
			</settings>
			<apt location="lib/build/projectlombok.org-spi.jar" />
		</ivy:eclipsegen>
	</target>
	
	<target name="eclipse.testtarget.default" depends="deps, compile.support">
		<property name="cp.test" refid="cp.test" />
		<property name="cp.stripe" refid="cp.stripe" />
		
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test Base" />
			<arg value="testType=lombok.TestBase" />
			<arg value="jvmTarget=1.8" />
			<arg value="bootpath=${jdk8-rt.loc}" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="favorite" />
		</java>
		
		<fetchdep.eclipse version="202006" />
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test Eclipse-202006" />
			<arg value="testType=lombok.TestEclipse" />
			<arg value="shadowLoaderBased" />
			<arg value="jvmTarget=1.8" />
			<arg value="bootpath=${jdk8-rt.loc}" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="conf.eclipse-202006=${cp.eclipse-202006}" />
			<arg value="favorite" />
		</java>
		
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test Javac 14" />
			<arg value="testType=lombok.TestJavac" />
			<arg value="jvmTarget=14" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="favorite" />
		</java>
	</target>
	
	<macrodef name="eclipse.testtarget.conf.jvmtarget">
		<attribute name="question" default="Which JDK do you want to target? Enter a version, such as '11'. Suggested (default): 8" />
		<attribute name="validargs" default="6,8,11,14" />
		<sequential>
			<property name="cp.test" refid="cp.test" />
			<property name="cp.stripe" refid="cp.stripe" />
			
			<input message="@{question}" validargs="@{validargs}" defaultvalue="8" addproperty="inputs.jvmtarget.raw" />
			
			<condition property="inputs.jvmtarget" value="1.6"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
			<condition property="inputs.jvmtarget" value="1.8"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
			<property name="inputs.jvmtarget" value="${inputs.jvmtarget.raw}" />
			
			<condition property="inputs.bootpath" value="${jdk6-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
			<condition property="inputs.bootpath" value="${jdk8-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
			<property name="inputs.bootpath" value="0" />
		</sequential>
	</macrodef>
	
	<target name="eclipse.testtarget.javac" depends="compile.support" description="Makes an eclipse launch target for running the tests for javac">
		<eclipse.testtarget.conf.jvmtarget question="Which javac do you want to target? Enter a version, such as '11'." validargs="8,11,13,14,15" />
		
		<local name="inputs.confcp" />
		<condition property="inputs.confcp" value="NONE">
			<not><equals arg1="8" arg2="${inputs.jvmtarget.raw}" /></not>
		</condition>
		<property name="inputs.confcp" refid="cp.javac8" />
		
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test Javac ${inputs.jvmtarget.raw}" />
			<arg value="testType=lombok.TestJavac" />
			<arg value="jvmTarget=${inputs.jvmtarget}" />
			<arg value="bootpath=${inputs.bootpath}" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="conf.${inputs.confname}=${inputs.confcp}" />
			<arg value="favorite" />
		</java>
	</target>
	
	<target name="eclipse.testtarget.eclipse" depends="compile.support" description="Makes an eclipse launch target for running the tests for eclipse support">
		<eclipse.testtarget.conf.jvmtarget />
		
		<local name="inputs.eclipsetarget" />
		<input message="Which eclipse do you want to target? Enter a version, such as 'oxygen'." validargs="oxygen" addproperty="inputs.eclipsetarget" />
		
		<local name="inputs.confname" />
		<property name="inputs.confname" value="eclipse-${inputs.eclipsetarget}" />
		
		<local name="inputs.confcp" />
		<property name="inputs.confcp" refid="cp.eclipse-${inputs.eclipsetarget}" />
		
		<fetchdep.eclipse version="${inputs.eclipsetarget}" />
		
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test Eclipse-${inputs.eclipsetarget}" />
			<arg value="testType=lombok.TestEclipse" />
			<arg value="shadowLoaderBased" />
			<arg value="jvmTarget=${inputs.jvmtarget}" />
			<arg value="bootpath=${inputs.bootpath}" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="conf.${inputs.confname}=${inputs.confcp}" />
			<arg value="favorite" />
		</java>
	</target>
	
	<target name="eclipse.testtarget.ecj" depends="compile.support" description="Makes an eclipse launch target for running the tests for ecj support">
		<eclipse.testtarget.conf.jvmtarget />
		
		<local name="inputs.ecjtarget" />
		<input message="Which ecj do you want to target? Enter a version, such as '8'." validargs="8,11,14" addproperty="inputs.ecjtarget" />
		
		<local name="inputs.confname" />
		<property name="inputs.confname" value="ecj${inputs.ecjtarget}" />
		
		<local name="inputs.confcp" />
		<property name="inputs.confcp" refid="cp.ecj${inputs.ecjtarget}" />
		
		<local name="inputs.bootpath" />
		<condition property="inputs.bootpath" value="${jdk6-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
		<condition property="inputs.bootpath" value="${jdk8-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
		<property name="inputs.bootpath" value="0" />
		
		<fetchdep.ecj version="${inputs.ecjtarget}" />
		
		<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
			<classpath>
				<path refid="cp.buildtools" />
				<pathelement location="build/support" />
			</classpath>
			<arg value="name=Lombok-test ECJ${inputs.ecjtarget}" />
			<arg value="testType=lombok.TestEclipse" />
			<arg value="shadowLoaderBased" />
			<arg value="jvmTarget=${inputs.jvmtarget}" />
			<arg value="bootpath=${inputs.bootpath}" />
			<arg value="conf.test=${cp.test}" />
			<arg value="conf.stripe=${cp.stripe}" />
			<arg value="conf.${inputs.confname}=${inputs.confcp}" />
			<arg value="favorite" />
		</java>
	</target>
</project>