Skip to content

Commit cf1dadf

Browse files
committed
Stop publishing CLI's Homebrew formula in commercial builds
Closes gh-43247
1 parent c36d307 commit cf1dadf

File tree

1 file changed

+23
-11
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-cli

1 file changed

+23
-11
lines changed

spring-boot-project/spring-boot-tools/spring-boot-cli/build.gradle

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.springframework.boot.build.properties.BuildProperties
2+
import org.springframework.boot.build.properties.BuildType
3+
14
plugins {
25
id "java"
36
id "eclipse"
@@ -104,17 +107,27 @@ task tar(type: Tar) {
104107
configureArchive it
105108
}
106109

107-
task homebrewFormula(type: org.springframework.boot.build.cli.HomebrewFormula) {
108-
dependsOn tar
109-
outputDir = layout.buildDirectory.dir("homebrew")
110-
template = file("src/main/homebrew/spring-boot.rb")
111-
archive = tar.archiveFile
112-
}
110+
if (BuildProperties.get(project).buildType() == BuildType.OPEN_SOURCE) {
111+
task homebrewFormula(type: org.springframework.boot.build.cli.HomebrewFormula) {
112+
dependsOn tar
113+
outputDir = layout.buildDirectory.dir("homebrew")
114+
template = file("src/main/homebrew/spring-boot.rb")
115+
archive = tar.archiveFile
116+
}
113117

114-
def homebrewFormulaArtifact = artifacts.add("archives", file(layout.buildDirectory.file("homebrew/spring-boot.rb"))) {
115-
type "rb"
116-
classifier "homebrew"
117-
builtBy "homebrewFormula"
118+
def homebrewFormulaArtifact = artifacts.add("archives", file(layout.buildDirectory.file("homebrew/spring-boot.rb"))) {
119+
type "rb"
120+
classifier "homebrew"
121+
builtBy "homebrewFormula"
122+
}
123+
124+
publishing {
125+
publications {
126+
getByName("maven") {
127+
artifact homebrewFormulaArtifact
128+
}
129+
}
130+
}
118131
}
119132

120133
publishing {
@@ -123,7 +136,6 @@ publishing {
123136
artifact fullJar
124137
artifact tar
125138
artifact zip
126-
artifact homebrewFormulaArtifact
127139
}
128140
}
129141
}

0 commit comments

Comments
 (0)