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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
<!--
Copyright (C) 2020-2021 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.setup" default="deps" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" xmlns:unless="ant:unless" basedir="..">
<description>
This buildfile is part of projectlombok.org. It sets up the build itself.
</description>
<!-- increment this number to force a clean of the 'build' dir -->
<property name="build.version" value="2021-03-18_001" />
<property name="pattern.jdk11plus" value="^(\d\d\d+|1[1-9]|[2-9]\d)(\..*)?$" />
<property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" />
<property environment="env" />
<available file="lib/ivyplusplus.jar" property="ivyplusplus.available" />
<property name="jdk6-rt.loc" location="lib/openjdk6_rt.jar" />
<property name="jdk8-rt.loc" location="lib/openjdk8_rt.jar" />
<property name="rtstubs18.loc" location="lib/rtstubs18.jar" />
<available file="${jdk6-rt.loc}" property="jdk6-rt.available" />
<available file="${jdk8-rt.loc}" property="jdk8-rt.available" />
<available file="${rtstubs18.loc}" property="rtstubs18.available" />
<property name="ssh.configuration.file" location="ssh.configuration" />
<property name="gpg.keyrings" location="gpg.keyring" />
<property name="exe.gpg" value="gpg" />
<property name="exe.curl" value="curl" />
<property name="exe.git" value="git" />
<condition property="os.supported">
<and>
<or>
<os family="unix" />
<os family="windows" />
<os name="Mac OS X" />
</or>
<or>
<os arch="aarch64" />
<os arch="x86-64" />
<os arch="x86_64" />
<os arch="amd64" />
</or>
</and>
</condition>
<fail unless="os.supported">Full eclipse testing requires downloading a native SWT binding. This script knows how to download for OS = [mac, linux, or windows] and architecture = [aarch64 or x86-64]. You have something different, you unique snowflake you. Your OS: "${os.name}", Your arch: "${os.arch}".</fail>
<target name="-autoclean.check">
<available type="dir" file="build" property="existingbuild.present" />
<loadresource property="existingbuild.ver">
<first count="1">
<resources>
<restrict>
<fileset dir="." includes="build/build-ver.txt" />
<exists />
</restrict>
<string>0</string>
</resources>
</first>
</loadresource>
<condition property="existingbuild.mismatch">
<and>
<isset property="existingbuild.present" />
<not><equals arg1="${existingbuild.ver}" arg2="${build.version}" trim="true" /></not>
</and>
</condition>
</target>
<target name="autoclean" depends="-autoclean.check" if="existingbuild.mismatch" description="Checks if a change in the build or deplist neccessitates a clean">
<echo>build ver has been incremented, neccessitating a clean...</echo>
<delete dir="build" />
</target>
<target name="-setup.build" depends="autoclean">
<mkdir dir="build" />
<echo file="build/build-ver.txt">${build.version}</echo>
</target>
<target name="clean" description="Removes all generated files.">
<delete dir="build" quiet="true" />
</target>
<target name="clean.dist" 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=".idea" quiet="true" />
<delete file="lombok.iml" quiet="true" />
<delete dir="ivyCache" quiet="true" />
</target>
<target name="-ipp.download" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="-ipp.load" depends="-ipp.download">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
<ivy:ensureippversion version="1.42" property="ivyplusplus.minimumAvailable" />
</target>
<target name="-ipp.redownload" unless="ivyplusplus.minimumAvailable">
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" />
<fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail>
</target>
<target name="ipp.setup" />
<target name="ivy.config" depends="ipp.setup" unless="ivy.config">
<ivy:configure file="/usr/share/ivy-debian-helper/ivysettings.xml" />
<property name="ivy.config" value="true" />
</target>
<target name="deps.jdk6-runtime" unless="jdk6-rt.available">
<echo>To ensure stable builds and avoid accessing API that was not available in JDK6, most of lombok is set up to build against OpenJDK6's runtime, which will now be downloaded...</echo>
<mkdir dir="lib" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${jdk6-rt.loc}" verbose="true" usetimestamp="true" />
</target>
<target name="deps.jdk8-runtime" unless="jdk8-rt.available">
<echo>To test java8, we need a java8 runtime, which will now be downloaded...</echo>
<mkdir dir="lib" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${jdk8-rt.loc}" verbose="true" usetimestamp="true" />
</target>
<target name="deps.rtstubs18" unless="rtstubs18.available">
<echo>To test in eclipse, we need a java runtime, which will now be downloaded...</echo>
<mkdir dir="lib" />
<get src="https://github.com/eclipse-jdt/eclipse.jdt.ui/raw/master/org.eclipse.jdt.ui.tests/testresources/rtstubs18.jar" dest="${rtstubs18.loc}" verbose="true" usetimestamp="true" />
</target>
<target name="deps.jdk-runtime" depends="deps.jdk6-runtime, deps.jdk8-runtime" />
<target name="deps.custom" depends="ivy.config" description="Download the dependencies that comprise a configuration (from ivy.xml)">
<fail unless="deps.conf">Supply ant with -Ddeps.conf=confname to pick the configuration you want to fetch</fail>
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="${deps.conf}" />
<ivy:retrieve symlink="true" />
</target>
<target name="deps.eclipse.oxygen" depends="deps.rtstubs18, compile.support">
<fetchdep.eclipse.osgi name="oxygen" version="4.7" />
</target>
<target name="deps.eclipse.202203" depends="deps.rtstubs18, compile.support">
<fetchdep.eclipse.osgi name="2022-03" version="4.23" />
</target>
<target name="deps.eclipse.202403" depends="deps.rtstubs18, compile.support">
<fetchdep.eclipse.osgi name="2024-03" version="4.31" />
</target>
<target name="deps.eclipse.202503" depends="deps.rtstubs18, compile.support">
<fetchdep.eclipse.osgi name="2025-03" version="4.35" />
</target>
<target name="deps.eclipse.integration" depends="deps.rtstubs18, compile.support">
<fetchdep.eclipse.osgi name="I-build" version="I-builds" />
</target>
<macrodef name="fetchdep.ecj">
<attribute name="version" />
<sequential>
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="ecj@{version}" />
<ivy:retrieve symlink="true" />
<ivy:cachepath pathid="cp.ecj@{version}" conf="ecj@{version}" />
<property name="cp.ecj@{version}" refid="cp.ecj@{version}" />
</sequential>
</macrodef>
<macrodef name="fetchdep.eclipse">
<attribute name="version" />
<sequential>
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="eclipse-@{version}" />
<ivy:retrieve symlink="true" />
<ivy:cachepath pathid="cp.eclipse-@{version}" conf="eclipse-@{version}" />
<property name="cp.eclipse-@{version}" refid="cp.eclipse-@{version}" />
</sequential>
</macrodef>
<macrodef name="fetchdep.eclipse.osgi">
<attribute name="name" />
<attribute name="version" />
<sequential>
<fetchdep.eclipse.updatesite name="@{name}" version="@{version}">
<bundles>
<!-- osgi.extender dependecies -->
<arg value="osgi.bundle:org.apache.felix.scr" />
<arg value="osgi.bundle:org.apache.aries.spifly.dynamic.bundle" />
<!-- Unresolvable until we add property based dependency resolution -->
<arg value="osgi.bundle:org.eclipse.swt.svg" />
<!-- Real dependencies -->
<arg value="osgi.bundle:org.eclipse.jdt.core" />
<arg value="osgi.bundle:org.eclipse.jdt.ui" />
</bundles>
</fetchdep.eclipse.updatesite>
</sequential>
</macrodef>
<macrodef name="fetchdep.eclipse.updatesite">
<attribute name="target" default="testenv" />
<attribute name="name" />
<attribute name="version" />
<attribute name="resolveDependencies" default="true" />
<element name="bundles" />
<sequential>
<java classname="lombok.eclipse.dependencies.DownloadEclipseDependencies" failonerror="true">
<classpath>
<path refid="cp.buildtools" />
<pathelement location="build/support" />
</classpath>
<arg value="@{target}" />
<arg value="eclipse-@{name}" />
<arg value="https://download.eclipse.org/eclipse/updates/@{version}/" />
<arg value="@{resolveDependencies}" />
<bundles />
</java>
</sequential>
</macrodef>
<target name="deps" depends="ivy.config, deps.jdk-runtime" description="Downloads all dependencies needed for common tasks">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="javac6,javac8,ecj8,build,eclipse-oxygen,mapstruct,sources,stripe,buildtools,test" />
<ivy:retrieve symlink="true" />
<ivy:cachepath pathid="cp.javac6" conf="javac6" />
<ivy:cachepath pathid="cp.javac8" conf="javac8" />
<ivy:cachepath pathid="cp.ecj8" conf="ecj8" />
<ivy:cachepath pathid="cp.build" conf="build" />
<ivy:cachepath pathid="cp.eclipse-oxygen" conf="eclipse-oxygen" />
<ivy:cachepath pathid="cp.mapstruct" conf="mapstruct" />
<ivy:cachepath pathid="cp.stripe" conf="stripe" />
<ivy:cachepath pathid="cp.buildtools" conf="buildtools" />
<ivy:cachepath pathid="cp.test" conf="test" />
</target>
<target name="-setup.mavenCentral">
<loadfile quiet="true" failonerror="false" encoding="UTF-8" property="mavencentral.authToken" srcfile="${gpg.keyrings}/mavenCentral.authToken">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
</target>
<target name="test.release.version" depends="-test.release.version" />
<target name="-test.release.version" depends="version" unless="skip.test.version">
<fail>
<condition>
<not><matches pattern="^.*[02468]$" string="${lombok.version}"/></not>
</condition>
You need to manually sort out the changelog, and set Version.java so that the release version is an even number (and the name isn't Edgy Guinea Pig). Use -Dskip.test.version= to override.
</fail>
</target>
<fail>ant needs to be at least v1.10.0 or higher to build lombok. Your version is: ${ant.version}
<condition>
<not><antversion atleast="1.10.0" /></not>
</condition>
</fail>
<fail>lombok must be compiled on jdk11 or later. Your version is: ${ant.java.version}
<condition>
<not><matches string="${ant.java.version}" pattern="${pattern.jdk11plus}" /></not>
</condition>
</fail>
</project>
|