Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
JReleaser updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke committed Dec 26, 2021
1 parent 27656dc commit ea36748
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
32 changes: 14 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ tasks {
}
}

tasks {
withType(Tar::class) {
compression = Compression.NONE
}
}

tasks {
withType(Tar::class) {
compression = Compression.NONE
}
}

if (Os.isFamily(Os.FAMILY_MAC) || properties.containsKey("graalbuild")) {
graal {
mainClass("com.baulsupp.okurl.MainKt")
Expand Down Expand Up @@ -163,7 +151,7 @@ publishing {
create("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar)
artifact(tasks.distTar.get())
artifact(tasks.distZip.get())
}
}
}
Expand Down Expand Up @@ -206,15 +194,23 @@ jreleaser {
enabled.set(true)
}

packagers {
brew {
active.set(org.jreleaser.model.Active.ALWAYS)
addDependency("jq")
repoTap {
owner.set("yschimke")
formulaName.set("okurl")
}
}
}

this.distributions.create("okurl") {
active.set(org.jreleaser.model.Active.ALWAYS)
distributionType.set(org.jreleaser.model.Distribution.DistributionType.NATIVE_IMAGE)
artifact {
path.set(file("build/distributions/okurl-graal-$version.tar"))
}
brew {
active.set(org.jreleaser.model.Active.ALWAYS)
tap.active.set(org.jreleaser.model.Active.ALWAYS)
platform.set("osx")
path.set(file("build/distributions/okurl-graal-$version.zip"))
}
}
}
33 changes: 33 additions & 0 deletions src/jreleaser/distributions/okurl/brew/formula.rb.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

# {{jreleaserCreationStamp}}
class {{brewFormulaName}} < Formula
desc "{{projectDescription}}"
homepage "{{projectWebsite}}"
url "{{distributionUrl}}"
version "{{projectVersion}}"
sha256 "{{distributionChecksumSha256}}"
license "{{projectLicense}}"

{{#brewHasLivecheck}}
livecheck do
{{#brewLivecheck}}
{{.}}
{{/brewLivecheck}}
end
{{/brewHasLivecheck}}
{{#brewDependencies}}
depends_on {{.}}
{{/brewDependencies}}

def install
libexec.install Dir["*"]
bin.install_symlink "#{libexec}/bin/{{distributionExecutable}}"

zsh_completion.install "#{libexec}/zsh/_okurl" => "_okurl"
end

test do
output = shell_output("#{bin}/{{distributionExecutable}} --version")
assert_match "{{projectVersion}}", output
end
end

0 comments on commit ea36748

Please sign in to comment.