homebrew-core/Formula/kobalt.rb
ilovezfs 641246b9a6 kobalt 0.899
Closes #3851.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-08-13 03:07:50 -07:00

44 lines
1 KiB
Ruby

class Kobalt < Formula
desc "Build system"
homepage "http://beust.com/kobalt"
url "https://github.com/cbeust/kobalt/releases/download/0.899/kobalt-0.899.zip"
sha256 "a207a775ca01c297a18eea9fc9a9f0c80d9dc4606ea0692c246c4e7f35576609"
bottle :unneeded
def install
libexec.install %w[kobalt]
(bin/"kobaltw").write <<-EOS.undent
#!/bin/bash
java -jar #{libexec}/kobalt/wrapper/kobalt-wrapper.jar $*
EOS
end
test do
ENV.java_cache
(testpath/"src/main/kotlin/com/A.kt").write <<-EOS.undent
package com
class A
EOS
(testpath/"kobalt/src/Build.kt").write <<-EOS.undent
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 File.exist?(output), "Couldn't find #{output}"
end
end