Skip to content

Commit d8b54cb

Browse files
Versioned casks
(also includes improved tests for them)
1 parent dd91314 commit d8b54cb

File tree

7 files changed

+268
-7
lines changed

7 files changed

+268
-7
lines changed

.travis.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,32 @@ language: bash
33
os: osx
44

55
env:
6-
- JAVA_VERSION=8 RELEASE_STREAM=
7-
- JAVA_VERSION=11 RELEASE_STREAM=
8-
- JAVA_VERSION=8 RELEASE_STREAM=-lts
9-
- JAVA_VERSION=11 RELEASE_STREAM=-lts
6+
- JAVA_VERSION=8 RELEASE_STREAM= FIXVER= FIXVER_INST=
7+
- JAVA_VERSION=11 RELEASE_STREAM= FIXVER= FIXVER_INST=
8+
- JAVA_VERSION=8 RELEASE_STREAM=-lts FIXVER= FIXVER_INST=
9+
- JAVA_VERSION=11 RELEASE_STREAM=-lts FIXVER= FIXVER_INST=
10+
- JAVA_VERSION=8 RELEASE_STREAM= [email protected] FIXVER_INST=-v19.3
11+
- JAVA_VERSION=11 RELEASE_STREAM= [email protected] FIXVER_INST=-v19.3
12+
- JAVA_VERSION=8 RELEASE_STREAM= [email protected] FIXVER_INST=-v20.0
13+
- JAVA_VERSION=11 RELEASE_STREAM= [email protected] FIXVER_INST=-v20.0
14+
- JAVA_VERSION=8 RELEASE_STREAM= [email protected] FIXVER_INST=-v20.1
15+
- JAVA_VERSION=11 RELEASE_STREAM= [email protected] FIXVER_INST=-v20.1
16+
# add further fixed versions here
1017

1118
script:
12-
- CASK_NAME="graalvm-ce${RELEASE_STREAM}-java${JAVA_VERSION}"
13-
# Check style
19+
- CASK_NAME="graalvm-ce${RELEASE_STREAM}-java${JAVA_VERSION}${FIXVER}"
20+
- INSTALL_NAME="graalvm-ce${RELEASE_STREAM}-java${JAVA_VERSION}${FIXVER_INST}"
21+
# Check style and validity
1422
- brew cask style Casks/${CASK_NAME}.rb
23+
- HOMEBREW_NO_AUTO_UPDATE=1 brew cask audit --download Casks/${CASK_NAME}.rb
1524
# Install tap
1625
- GRAALVM_TAP_DIR="$(dirname $(dirname $(brew --repo homebrew/core)))/graalvm/homebrew-tap"
1726
- mkdir -p $(dirname $GRAALVM_TAP_DIR)
1827
- ln -s $(pwd) $GRAALVM_TAP_DIR
1928
# Install cask, extract its version, and update `PATH`
2029
- HOMEBREW_NO_AUTO_UPDATE=1 brew cask install --require-sha graalvm/tap/${CASK_NAME}
2130
- VERSION=$(brew cask info $CASK_NAME | head -n 1 | awk '{print $2}')
22-
- TARGET_DIR="/Library/Java/JavaVirtualMachines/${CASK_NAME}-${VERSION}"
31+
- TARGET_DIR="/Library/Java/JavaVirtualMachines/${INSTALL_NAME}-${VERSION}"
2332
- export PATH="${TARGET_DIR}/Contents/Home/bin:${PATH}"
2433
# Ensure the expected `java` version is installed
2534
- test ! -z "$(java -version 2>&1 | grep $VERSION)"

Casks/[email protected]

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
version '19.3.2'
3+
sha256 '3809582f4b616fbf603ed9c917c404a1ce160067e41ba6e56b07d0a11ca70764'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 19.3 (Java 11)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
postflight do
18+
# Ensure GraalVM JDK 11 is listed by `/usr/libexec/java_home -V`.
19+
macos_dir = "#{TARGET_DIR}/Contents/MacOS"
20+
libjli_filename = 'libjli.dylib'
21+
libjli_path = "#{TARGET_DIR}/Contents/Home/lib/jli/#{libjli_filename}"
22+
libjli_symlink_path = "#{macos_dir}/#{libjli_filename}"
23+
next if File.exist?(libjli_symlink_path)
24+
25+
system_command '/bin/mkdir', args: ['-p', macos_dir], sudo: true
26+
system_command '/bin/ln', args: ['-s', libjli_path, libjli_symlink_path], sudo: true
27+
end
28+
29+
caveats <<~EOS
30+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 11) in #{JVMS_DIR} requires root permissions.
31+
You may be asked to enter your password to proceed.
32+
33+
On macOS Catalina, you may get a warning that "the developer cannot be
34+
verified". This check can be disabled in the "Security & Privacy"
35+
preferences pane or by running the following command:
36+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
37+
38+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
39+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
40+
41+
or you may want to add its `bin` directory to your `PATH`:
42+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
43+
44+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
45+
https://github.com/oracle/graal/blob/master/LICENSE
46+
47+
EOS
48+
end

Casks/[email protected]

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
version '20.0.0'
3+
sha256 '8ba1205bb08cab04f1efc72423674d5816efbc3b22e482709c508788d87a692a'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 20.0 (Java 11)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
postflight do
18+
# Ensure GraalVM JDK 11 is listed by `/usr/libexec/java_home -V`.
19+
macos_dir = "#{TARGET_DIR}/Contents/MacOS"
20+
libjli_filename = 'libjli.dylib'
21+
libjli_path = "#{TARGET_DIR}/Contents/Home/lib/jli/#{libjli_filename}"
22+
libjli_symlink_path = "#{macos_dir}/#{libjli_filename}"
23+
next if File.exist?(libjli_symlink_path)
24+
25+
system_command '/bin/mkdir', args: ['-p', macos_dir], sudo: true
26+
system_command '/bin/ln', args: ['-s', libjli_path, libjli_symlink_path], sudo: true
27+
end
28+
29+
caveats <<~EOS
30+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 11) in #{JVMS_DIR} requires root permissions.
31+
You may be asked to enter your password to proceed.
32+
33+
On macOS Catalina, you may get a warning that "the developer cannot be
34+
verified". This check can be disabled in the "Security & Privacy"
35+
preferences pane or by running the following command:
36+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
37+
38+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
39+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
40+
41+
or you may want to add its `bin` directory to your `PATH`:
42+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
43+
44+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
45+
https://github.com/oracle/graal/blob/master/LICENSE
46+
47+
EOS
48+
end

Casks/[email protected]

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
version '20.1.0'
3+
sha256 '04efcb7bdd2e94715d0f3fddcc754594da032887e6aec94a3701bd4774d1a92e'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 20.1 (Java 11)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
postflight do
18+
# Ensure GraalVM JDK 11 is listed by `/usr/libexec/java_home -V`.
19+
macos_dir = "#{TARGET_DIR}/Contents/MacOS"
20+
libjli_filename = 'libjli.dylib'
21+
libjli_path = "#{TARGET_DIR}/Contents/Home/lib/jli/#{libjli_filename}"
22+
libjli_symlink_path = "#{macos_dir}/#{libjli_filename}"
23+
next if File.exist?(libjli_symlink_path)
24+
25+
system_command '/bin/mkdir', args: ['-p', macos_dir], sudo: true
26+
system_command '/bin/ln', args: ['-s', libjli_path, libjli_symlink_path], sudo: true
27+
end
28+
29+
caveats <<~EOS
30+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 11) in #{JVMS_DIR} requires root permissions.
31+
You may be asked to enter your password to proceed.
32+
33+
On macOS Catalina, you may get a warning that "the developer cannot be
34+
verified". This check can be disabled in the "Security & Privacy"
35+
preferences pane or by running the following command:
36+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
37+
38+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
39+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
40+
41+
or you may want to add its `bin` directory to your `PATH`:
42+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
43+
44+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
45+
https://github.com/oracle/graal/blob/master/LICENSE
46+
47+
EOS
48+
end

Casks/[email protected]

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
version '19.3.2'
3+
sha256 '6db0e536893fcad314bbcec39dd598abd64f96e3dad9ffb9aa382ff18009f91e'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 19.3 (Java 8)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
caveats <<~EOS
18+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 8) in #{JVMS_DIR} requires root permissions.
19+
You may be asked to enter your password to proceed.
20+
21+
On macOS Catalina, you may get a warning that "the developer cannot be
22+
verified". This check can be disabled in the "Security & Privacy"
23+
preferences pane or by running the following command:
24+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
25+
26+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
27+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
28+
29+
or you may want to add its `bin` directory to your `PATH`:
30+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
31+
32+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
33+
https://github.com/oracle/graal/blob/master/LICENSE
34+
35+
EOS
36+
end

Casks/[email protected]

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
version '20.0.0'
3+
sha256 'e3d35fdfe4f62022c42029c052f2b8277b3d896496cf45c2e82d251f5d49701a'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 20.0 (Java 8)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
caveats <<~EOS
18+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 8) in #{JVMS_DIR} requires root permissions.
19+
You may be asked to enter your password to proceed.
20+
21+
On macOS Catalina, you may get a warning that "the developer cannot be
22+
verified". This check can be disabled in the "Security & Privacy"
23+
preferences pane or by running the following command:
24+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
25+
26+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
27+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
28+
29+
or you may want to add its `bin` directory to your `PATH`:
30+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
31+
32+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
33+
https://github.com/oracle/graal/blob/master/LICENSE
34+
35+
EOS
36+
end

Casks/[email protected]

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
version '20.1.0'
3+
sha256 '3b9fd8ce84c9162a188fde88907c66990db22af0ff6ae2c04430113253a9a634'
4+
5+
NAME_AND_VER = cask.to_s.split('@')
6+
JVMS_DIR = '/Library/Java/JavaVirtualMachines'.freeze
7+
TARGET_DIR = "#{JVMS_DIR}/#{NAME_AND_VER.first}-v#{NAME_AND_VER.last}-#{version}".freeze
8+
9+
# github.com/graalvm/graalvm-ce-builds was verified as official when first introduced to the cask
10+
url "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-#{version}/#{NAME_AND_VER.first}-darwin-amd64-#{version}.tar.gz"
11+
appcast 'https://github.com/oracle/graal/releases.atom'
12+
name 'GraalVM Community Edition 20.1 (Java 8)'
13+
homepage 'https://www.graalvm.org/'
14+
15+
artifact "#{NAME_AND_VER.first}-#{version}", target: TARGET_DIR
16+
17+
caveats <<~EOS
18+
Installing GraalVM CE #{NAME_AND_VER.last} (Java 8) in #{JVMS_DIR} requires root permissions.
19+
You may be asked to enter your password to proceed.
20+
21+
On macOS Catalina, you may get a warning that "the developer cannot be
22+
verified". This check can be disabled in the "Security & Privacy"
23+
preferences pane or by running the following command:
24+
xattr -r -d com.apple.quarantine #{TARGET_DIR}
25+
26+
To use GraalVM CE #{NAME_AND_VER.last}, you may want to change your `JAVA_HOME`:
27+
export JAVA_HOME=#{TARGET_DIR}/Contents/Home
28+
29+
or you may want to add its `bin` directory to your `PATH`:
30+
export PATH=#{TARGET_DIR}/Contents/Home/bin:"$PATH"
31+
32+
GraalVM CE is licensed under the GPL 2 with Classpath exception:
33+
https://github.com/oracle/graal/blob/master/LICENSE
34+
35+
EOS
36+
end

0 commit comments

Comments
 (0)