Merge pull request #207012 from Homebrew/bump-tailwindcss-4.0.5
[Homebrew/homebrew-core.git] / Formula / g / groovy.rb
blob62d4f3558cd1f90b8f05bd0f48ce176a6fc26dcc
1 class Groovy < Formula
2   desc "Java-based scripting language"
3   homepage "https://www.groovy-lang.org/"
4   url "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-4.0.25.zip"
5   sha256 "822cad8e03388f23bf613d37f990b813bb4165fe389fd3fcc24f8b96476c30ef"
6   license "Apache-2.0"
8   livecheck do
9     url "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/"
10     regex(/href=.*?apache-groovy-binary[._-]v?(\d+(?:\.\d+)+)\.zip/i)
11   end
13   bottle do
14     sha256 cellar: :any_skip_relocation, arm64_sequoia: "2ca901974e16788e25606c527434078bfc7318068db230cd3299f502c14090a8"
15     sha256 cellar: :any_skip_relocation, arm64_sonoma:  "b0ca05c6a1b392e02da91c603506e0bf401d88169650bbbaf97047bbe1b79f44"
16     sha256 cellar: :any_skip_relocation, arm64_ventura: "727ba13f764b371a17df2afd03a52e2c509d43553538cc0fc150391d4ad72406"
17     sha256 cellar: :any_skip_relocation, sonoma:        "6469f693d616f1c662dbac79217d771997c591c5c21f3c2a00743bd1b22100b2"
18     sha256 cellar: :any_skip_relocation, ventura:       "3c1dab55e70f2a4f3de261598b3dfc1346085a11789714ee66a50f6df731c5c3"
19     sha256 cellar: :any_skip_relocation, x86_64_linux:  "8eb98117c31ce438ff85be1c4445873200b6e389b405111ab3a56955bb9c06eb"
20   end
22   depends_on "openjdk"
24   on_macos do
25     # Temporary build dependencies for compiling jansi-native
26     depends_on "autoconf" => :build
27     depends_on "automake" => :build
28     depends_on "libtool" => :build
29     depends_on "maven" => :build
31     # jansi-native is used to build native binary to support Apple Silicon.
32     # Source version is from jline-2.14.6 -> jansi-1.12 -> jansi-native-1.6
33     # TODO: Remove once updated to jline-3.x: https://issues.apache.org/jira/browse/GROOVY-8162
34     resource "jansi-native" do
35       url "https://github.com/fusesource/jansi-native/archive/refs/tags/jansi-native-1.6.tar.gz"
36       sha256 "f4075ad012c9ed79eaa8d3240d869e10d94ca8b130f3e7dac2ba3978dce0fb21"
38       # Update pom.xml to replace unsupported Java 6 source and to disable universal binary
39       patch :DATA
40     end
41   end
43   conflicts_with "groovysdk", because: "both install the same binaries"
45   def install
46     if OS.mac?
47       jline_jar = buildpath/"lib/jline-2.14.6.jar"
48       resource("jansi-native").stage do
49         # Fix compile with newer Clang
50         ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403
52         system "mvn", "-Dplatform=osx", "prepare-package"
53         system "zip", "-d", jline_jar, "META-INF/native/*"
54         system "jar", "-uvf", jline_jar,
55                       "-C", "target/generated-sources/hawtjni/lib",
56                       "META-INF/native/osx64/libjansi.jnilib"
57       end
58     end
60     # Don't need Windows files.
61     rm(Dir["bin/*.bat"])
63     libexec.install "bin", "conf", "lib"
64     bin.install Dir["#{libexec}/bin/*"] - ["#{libexec}/bin/groovy.ico"]
65     bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
66   end
68   def caveats
69     <<~EOS
70       You should set GROOVY_HOME:
71         export GROOVY_HOME=#{opt_libexec}
72     EOS
73   end
75   test do
76     output = shell_output("#{bin}/grape install org.activiti activiti-engine 5.16.4")
77     assert_match "found org.activiti#activiti-engine;5.16.4", output
78     assert_match "65536\n===> null\n", pipe_output("#{bin}/groovysh", "println 64*1024\n:exit\n")
79   end
80 end
82 __END__
83 diff --git a/pom.xml b/pom.xml
84 index 369cc8c..6dbac6f 100644
85 --- a/pom.xml
86 +++ b/pom.xml
87 @@ -151,8 +151,8 @@
88          <groupId>org.apache.maven.plugins</groupId>
89          <artifactId>maven-compiler-plugin</artifactId>
90          <configuration>
91 -          <source>1.5</source>
92 -          <target>1.5</target>
93 +          <source>1.8</source>
94 +          <target>1.8</target>
95          </configuration>
96        </plugin>
97        
98 @@ -306,35 +306,5 @@
99        </build>
100      </profile>
101      
103 -    <!-- Profile which enables Universal binaries on OS X -->
104 -    <profile>
105 -      <id>mac</id>
106 -      <activation>
107 -        <os><family>mac</family></os>
108 -      </activation>
109 -      <build>
110 -        <plugins>
111 -          <plugin>
112 -            <groupId>org.fusesource.hawtjni</groupId>
113 -            <artifactId>maven-hawtjni-plugin</artifactId>
114 -            <configuration>
115 -              <osgiPlatforms>
116 -                <osgiPlatform>osname=MacOS;processor=x86-64</osgiPlatform>
117 -                <osgiPlatform>osname=MacOS;processor=x86</osgiPlatform>
118 -                <osgiPlatform>osname=MacOS;processor=PowerPC</osgiPlatform>
119 -                <osgiPlatform>*</osgiPlatform>
120 -              </osgiPlatforms>
121 -              <configureArgs>
122 -                <arg>--with-universal</arg>
123 -              </configureArgs>
124 -              <platform>osx</platform>
125 -            </configuration>
126 -          </plugin>
127 -        </plugins>
128 -      </build>
129 -    </profile>
130 -    
131 -    
132    </profiles>
133  </project>