Fix Homebrew formula's install --head support

This commit updates the Homebrew formula's install --head support to
use the main branch (rather than the default of master) and to build
the project using Gradle rather than trying to use Maven.

Closes gh-33704
This commit is contained in:
Andy Wilkinson 2023-01-06 18:15:31 +00:00
parent 8fa318453f
commit 2d372edcfc

View File

@ -5,16 +5,13 @@ class SpringBoot < Formula
url '${repo}/org/springframework/boot/spring-boot-cli/${project.version}/spring-boot-cli-${project.version}-bin.tar.gz'
version '${project.version}'
sha256 '${hash}'
head 'https://github.com/spring-projects/spring-boot.git'
if build.head?
depends_on 'maven' => :build
end
head 'https://github.com/spring-projects/spring-boot.git', :branch => "main"
def install
if build.head?
Dir.chdir('spring-boot-cli') { system 'mvn -U -DskipTests=true package' }
root = 'spring-boot-cli/target/spring-boot-cli-*-bin/spring-*'
system './gradlew spring-boot-project:spring-boot-tools:spring-boot-cli:tar'
system 'tar -xzf spring-boot-project/spring-boot-tools/spring-boot-cli/build/distributions/spring-* -C spring-boot-project/spring-boot-tools/spring-boot-cli/build/distributions'
root = 'spring-boot-project/spring-boot-tools/spring-boot-cli/build/distributions/spring-*'
else
root = '.'
end