Skip to content

Commit

Permalink
[build] Check version before allowing release
Browse files Browse the repository at this point in the history
  • Loading branch information
rzwitserloot committed May 24, 2023
1 parent 250bc06 commit 375891f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions buildScripts/setup.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ This buildfile is part of projectlombok.org. It sets up the build itself.
<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>
Expand Down
6 changes: 4 additions & 2 deletions buildScripts/website.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ such as applying the templates to produce the website, converting the changelog
<fail />
</target>

<target name="release.publish" depends="maven, -release.publish.site, website.publish, eclipsep2.publish, maven.publish" description="Deploys a new official lombok release everywhere: maven, website, p2 site" />
<target name="release.publish" depends="-test.release.version, maven, -release.publish.site, website.publish, eclipsep2.publish, maven.publish, -edge.publish" description="Deploys a new official lombok release everywhere: maven, website, p2 site" />

<target name="edge.website" depends="compile.support, version, dist">
<delete quiet="true" file="build/website/download-edge.html" />
Expand All @@ -288,7 +288,9 @@ such as applying the templates to produce the website, converting the changelog

<target name="-edge.website.publish" depends="-edge.website.tohost, -website.commit-and-push-hostgit" />

<target name="edge.publish" depends="dist, -edge.website.publish, maven.edge" description="Builds an edge release, sends it to the projectlombok.org server and deploys it by updating the download-edge link">
<target name="edge.publish" depends="-edge.website.publish, -edge.publish" description="Builds an edge release, sends it to the projectlombok.org server and deploys it by updating the download-edge link" />

<target name="-edge.publish" depends="dist, maven.edge">
<copy file="dist/lombok-${lombok.version}.jar" tofile="build/edge-releases/lombok-edge.jar" />
<java classname="lombok.publish.PublishToBucket" failonerror="true">
<classpath>
Expand Down

0 comments on commit 375891f

Please sign in to comment.