131 lines
4.6 KiB
Ruby
131 lines
4.6 KiB
Ruby
class Groovy < Formula
|
|
desc "Java-based scripting language"
|
|
homepage "https://www.groovy-lang.org/"
|
|
url "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-4.0.5.zip"
|
|
sha256 "402f442387efbdd73904ea8a390025525636774f72b8149cc55bf19b5d4ace4a"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/"
|
|
regex(/href=.*?apache-groovy-binary[._-]v?(\d+(?:\.\d+)+)\.zip/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "2ef0f64b6fcd7f93f57faf42365213c200ecf3b9e4fbfb6580395f66bad4f19e"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "a65217593816d156ec97dd8d9807bd4846a26ec69d6de79097f3282f42041bac"
|
|
sha256 cellar: :any_skip_relocation, monterey: "73f36b2fdc740cbb2f23cf9bf00a9b87c8db471bf98957d906e70bd724b8012b"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "b9d8a58599cb7cee49ab020cb8a44aa11ff96f6981d0b830b44c4459a4525471"
|
|
sha256 cellar: :any_skip_relocation, catalina: "95b6072b6c3aa959ca770a76d78609206172ddd6be3746eb5a020ce301dcfe0a"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "9acab2f62a93c8a6a650fb7e24e79b2322ded4a31b1061e98ec5668ca6cd1676"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
on_macos do
|
|
# Temporary build dependencies for compiling jansi-native
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
depends_on "maven" => :build
|
|
|
|
# jansi-native is used to build native binary to support Apple Silicon.
|
|
# Source version is from jline-2.14.6 -> jansi-1.12 -> jansi-native-1.6
|
|
# TODO: Remove once updated to jline-3.x: https://issues.apache.org/jira/browse/GROOVY-8162
|
|
resource "jansi-native" do
|
|
url "https://github.com/fusesource/jansi-native/archive/refs/tags/jansi-native-1.6.tar.gz"
|
|
sha256 "f4075ad012c9ed79eaa8d3240d869e10d94ca8b130f3e7dac2ba3978dce0fb21"
|
|
|
|
# Update pom.xml to replace unsupported Java 6 source and to disable universal binary
|
|
patch :DATA
|
|
end
|
|
end
|
|
|
|
conflicts_with "groovysdk", because: "both install the same binaries"
|
|
|
|
def install
|
|
if OS.mac?
|
|
jline_jar = buildpath/"lib/jline-2.14.6.jar"
|
|
resource("jansi-native").stage do
|
|
system "mvn", "-Dplatform=osx", "prepare-package"
|
|
system "zip", "-d", jline_jar, "META-INF/native/*"
|
|
system "jar", "-uvf", jline_jar,
|
|
"-C", "target/generated-sources/hawtjni/lib",
|
|
"META-INF/native/osx64/libjansi.jnilib"
|
|
end
|
|
end
|
|
|
|
# Don't need Windows files.
|
|
rm_f Dir["bin/*.bat"]
|
|
|
|
libexec.install "bin", "conf", "lib"
|
|
bin.install Dir["#{libexec}/bin/*"] - ["#{libexec}/bin/groovy.ico"]
|
|
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
You should set GROOVY_HOME:
|
|
export GROOVY_HOME=#{opt_libexec}
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
output = shell_output("#{bin}/grape install org.activiti activiti-engine 5.16.4")
|
|
assert_match "found org.activiti#activiti-engine;5.16.4", output
|
|
assert_match "65536\n===> null\n", pipe_output("#{bin}/groovysh", "println 64*1024\n:exit\n")
|
|
end
|
|
end
|
|
|
|
__END__
|
|
diff --git a/pom.xml b/pom.xml
|
|
index 369cc8c..6dbac6f 100644
|
|
--- a/pom.xml
|
|
+++ b/pom.xml
|
|
@@ -151,8 +151,8 @@
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<configuration>
|
|
- <source>1.5</source>
|
|
- <target>1.5</target>
|
|
+ <source>1.7</source>
|
|
+ <target>1.7</target>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
@@ -306,35 +306,5 @@
|
|
</build>
|
|
</profile>
|
|
|
|
-
|
|
- <!-- Profile which enables Universal binaries on OS X -->
|
|
- <profile>
|
|
- <id>mac</id>
|
|
- <activation>
|
|
- <os><family>mac</family></os>
|
|
- </activation>
|
|
- <build>
|
|
- <plugins>
|
|
- <plugin>
|
|
- <groupId>org.fusesource.hawtjni</groupId>
|
|
- <artifactId>maven-hawtjni-plugin</artifactId>
|
|
- <configuration>
|
|
- <osgiPlatforms>
|
|
- <osgiPlatform>osname=MacOS;processor=x86-64</osgiPlatform>
|
|
- <osgiPlatform>osname=MacOS;processor=x86</osgiPlatform>
|
|
- <osgiPlatform>osname=MacOS;processor=PowerPC</osgiPlatform>
|
|
- <osgiPlatform>*</osgiPlatform>
|
|
- </osgiPlatforms>
|
|
- <configureArgs>
|
|
- <arg>--with-universal</arg>
|
|
- </configureArgs>
|
|
- <platform>osx</platform>
|
|
- </configuration>
|
|
- </plugin>
|
|
- </plugins>
|
|
- </build>
|
|
- </profile>
|
|
-
|
|
-
|
|
</profiles>
|
|
</project>
|