2016-02-21 16:30:09 +00:00
|
|
|
class Kobalt < Formula
|
|
|
|
desc "Build system"
|
|
|
|
homepage "http://beust.com/kobalt"
|
2016-12-08 09:12:03 +00:00
|
|
|
url "https://github.com/cbeust/kobalt/releases/download/0.906/kobalt-0.906.zip"
|
|
|
|
sha256 "ee4aa7218f470d8abdabbc06115ea0c335c91e106459c547863c6c0db28e1612"
|
2016-02-21 16:30:09 +00:00
|
|
|
|
2016-02-23 09:01:45 +00:00
|
|
|
bottle :unneeded
|
|
|
|
|
2016-02-21 16:30:09 +00:00
|
|
|
def install
|
2016-03-18 17:42:30 +00:00
|
|
|
libexec.install %w[kobalt]
|
|
|
|
|
|
|
|
(bin/"kobaltw").write <<-EOS.undent
|
|
|
|
#!/bin/bash
|
|
|
|
java -jar #{libexec}/kobalt/wrapper/kobalt-wrapper.jar $*
|
|
|
|
EOS
|
2016-02-21 16:30:09 +00:00
|
|
|
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 {
|
2016-03-18 17:42:30 +00:00
|
|
|
jar {}
|
|
|
|
}
|
2016-02-21 16:30:09 +00:00
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
|
|
|
system "#{bin}/kobaltw", "assemble"
|
|
|
|
output = "kobaltBuild/libs/test-1.0.jar"
|
|
|
|
assert File.exist?(output), "Couldn't find #{output}"
|
|
|
|
end
|
|
|
|
end
|