From a3c398ca0a7735df3c424ed08b0e5b693b4e6562 Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Mon, 27 Jan 2014 15:26:50 -0800 Subject: [PATCH] Add --HEAD support to Homebrew formula This change adds support for --HEAD builds to the Homebrew formula. It defines a conditional dependency on Maven and builds the -cli project during install. The location to install from is abstracted out so that code is identical regardless of whether the build is --HEAD or mainline. --- .../src/main/homebrew/springboot.rb | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/spring-boot-cli/src/main/homebrew/springboot.rb b/spring-boot-cli/src/main/homebrew/springboot.rb index b872419e31..062072b102 100644 --- a/spring-boot-cli/src/main/homebrew/springboot.rb +++ b/spring-boot-cli/src/main/homebrew/springboot.rb @@ -5,11 +5,23 @@ class Springboot < Formula url 'https://repo.spring.io/${repo}/org/springframework/boot/spring-boot-cli/${project.version}/spring-boot-cli-${project.version}-bin.tar.gz' version '${project.version}' sha1 '${checksum}' + head 'https://github.com/spring-projects/spring-boot.git' + + if build.head? + depends_on 'maven' => :build + end def install - bin.install 'bin/spring' - lib.install 'lib/spring-boot-cli-${project.version}.jar' - bash_completion.install 'shell-completion/bash/spring' - zsh_completion.install 'shell-completion/zsh/_spring' + if build.head? + Dir.chdir('spring-boot-cli') { system 'mvn -U -DskipTests=true package' } + root = 'spring-boot-cli/target/spring-boot-cli-*-bin/spring-*' + else + root = '.' + end + + bin.install Dir["#{root}/bin/spring"] + lib.install Dir["#{root}/lib/spring-boot-cli-*.jar"] + bash_completion.install Dir["#{root}/shell-completion/bash/spring"] + zsh_completion.install Dir["#{root}/shell-completion/zsh/_spring"] end end