homebrew-core/Formula/kobalt.rb
Igor Kapkov 40c6d2208a kobalt 1.0.118
Closes #33684.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
2018-11-03 16:52:24 +01:00

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.118/kobalt-1.0.118.zip"
sha256 "87b16c029afea0b712beef2f33cc4598bde770a4a0f22943399bcbb4407737b9"
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