42 lines
1 KiB
Ruby
42 lines
1 KiB
Ruby
class Kobalt < Formula
|
|
desc "Build system"
|
|
homepage "https://beust.com/kobalt/"
|
|
url "https://github.com/cbeust/kobalt/releases/download/1.0.122/kobalt-1.0.122.zip"
|
|
sha256 "0fb65c41f025b9c65c7191e77bb5d91bb2e8ae1869cc6fcdb9318a002a28add7"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
libexec.install "kobalt-#{version}/kobalt"
|
|
|
|
(bin/"kobaltw").write <<~EOS
|
|
#!/bin/bash
|
|
java -jar #{libexec}/kobalt/wrapper/kobalt-wrapper.jar $*
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
(testpath/"src/main/kotlin/com/A.kt").write <<~EOS
|
|
package com
|
|
class A
|
|
EOS
|
|
|
|
(testpath/"kobalt/src/Build.kt").write <<~EOS
|
|
import com.beust.kobalt.*
|
|
import com.beust.kobalt.api.*
|
|
import com.beust.kobalt.plugin.packaging.*
|
|
|
|
val p = project {
|
|
name = "test"
|
|
version = "1.0"
|
|
assemble {
|
|
jar {}
|
|
}
|
|
}
|
|
EOS
|
|
|
|
system "#{bin}/kobaltw", "assemble"
|
|
output = "kobaltBuild/libs/test-1.0.jar"
|
|
assert_predicate testpath/output, :exist?, "Couldn't find #{output}"
|
|
end
|
|
end
|