mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-14 06:59:07 +00:00
293 lines
12 KiB
XML
293 lines
12 KiB
XML
<!--
|
|
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" depends="-ipp.load, -ipp.redownload" />
|
|
|
|
<target name="ivy.config" depends="ipp.setup" unless="ivy.config">
|
|
<ivy:configure file="buildScripts/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.2022-03" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2022-03" version="4.23" />
|
|
</target>
|
|
|
|
<target name="deps.eclipse.2023-09" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2023-09" version="4.29" />
|
|
</target>
|
|
|
|
<target name="deps.eclipse.2023-12" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2023-12" version="4.30" />
|
|
</target>
|
|
|
|
<target name="deps.eclipse.2024-03" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2024-03" version="4.31" />
|
|
</target>
|
|
|
|
<target name="deps.eclipse.2024-06" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2024-06" version="4.32" />
|
|
</target>
|
|
|
|
<target name="deps.eclipse.2024-09" depends="deps.rtstubs18, compile.support">
|
|
<fetchdep.eclipse.osgi name="2024-09" version="4.33" />
|
|
</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" />
|
|
<!-- 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.ossrh">
|
|
<loadfile quiet="true" failonerror="false" encoding="UTF-8" property="ossrh.password" srcfile="${gpg.keyrings}/ossrh.password">
|
|
<filterchain>
|
|
<striplinebreaks />
|
|
</filterchain>
|
|
</loadfile>
|
|
<property name="ossrh.username" value="rzwitserloot" />
|
|
</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>
|