41 lines
1.1 KiB
Ruby
41 lines
1.1 KiB
Ruby
class Ballerina < Formula
|
|
desc "Programming Language for Network Distributed Applications"
|
|
homepage "https://ballerina.io"
|
|
url "https://dist.ballerina.io/downloads/2201.2.2/ballerina-2201.2.2-swan-lake.zip"
|
|
sha256 "261edc56ea1dbceffd24ed3e8654fafbd4614d5a4b53930bdb689a3b5e73c12c"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://github.com/ballerina-platform/ballerina-lang.git"
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "7822298f08c96c14cf6c71e57dcb73f5b086df40f40f4ba11c4fd4a6639c54c3"
|
|
end
|
|
|
|
depends_on "openjdk@11"
|
|
|
|
def install
|
|
# Remove Windows files
|
|
rm Dir["bin/*.bat"]
|
|
|
|
chmod 0755, "bin/bal"
|
|
|
|
bin.install "bin/bal"
|
|
libexec.install Dir["*"]
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("11"))
|
|
end
|
|
|
|
test do
|
|
(testpath/"helloWorld.bal").write <<~EOS
|
|
import ballerina/io;
|
|
public function main() {
|
|
io:println("Hello, World!");
|
|
}
|
|
EOS
|
|
output = shell_output("#{bin}/bal run helloWorld.bal")
|
|
assert_equal "Hello, World!", output.chomp
|
|
end
|
|
end
|