-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
groovy.rb
134 lines (118 loc) 路 4.88 KB
/
groovy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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.21.zip"
sha256 "5ef878f70db8b642d204e9a410c519c1131a3e7a9ddb4b6910d214909cb2e98a"
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_sonoma: "de116b62a6043207cd332cbbb6ae0576416d9beeecd26233dff3c845e0ba8a7f"
sha256 cellar: :any_skip_relocation, arm64_ventura: "7e3dbc6c810dd3dfe0871f31ada9bcc7b82bb71008a4d3c5c6e77f1d4334011c"
sha256 cellar: :any_skip_relocation, arm64_monterey: "62932a9216fe7bf6fa912f09d78382f7cd96fe390a5ef00740ae5b57d65f0272"
sha256 cellar: :any_skip_relocation, sonoma: "49fe4d6ce21c68c365bbc15e994f47281c0325b9394c1395cffabbb547ac1e48"
sha256 cellar: :any_skip_relocation, ventura: "92bdee71c8b6dde27962d65a2de8fbbe43a920d54303480d17be02a3d4150948"
sha256 cellar: :any_skip_relocation, monterey: "f64ee0ed726e366c191967e749182fff2ec7f6ca6a767e9194ca286de675aeea"
sha256 cellar: :any_skip_relocation, x86_64_linux: "d5f785a1ce82ddfaa5260980ec5f2b7677ade12f2ace0d95b41291c6a2efd604"
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
# Fix compile with newer Clang
ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403
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.8</source>
+ <target>1.8</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>