homebrew-core/Formula/kobalt.rb
2017-09-17 11:31:04 -07:00

42 lines
1,022 B
Ruby

class Kobalt < Formula
desc "Build system"
homepage "http://beust.com/kobalt"
url "https://github.com/cbeust/kobalt/releases/download/1.0.90/kobalt-1.0.90.zip"
sha256 "6aaec7e96390017ac170823a82f1fb6268d549324d447fce118e6471067dbe98"
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
(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