Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

Commit 57a3829

Browse files
committed
init
1 parent 4344ff6 commit 57a3829

File tree

5 files changed

+93
-0
lines changed

5 files changed

+93
-0
lines changed

Casks/tuna-adoptopenjdk11.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PLEASE DO NOT EDIT THIS FILE. EDIT Templates/adoptopenjdk.rb.tmpl
2+
cask "tuna-adoptopenjdk11" do
3+
version "11.0.8_10"
4+
sha256 "c9ce3e78a7ec7f8c23041af63a66bfe18bbf75c7bfa8f8a51148a098f3653699"
5+
6+
# github.com/AdoptOpenJDK was verified as official when first introduced to the cask
7+
url "https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/11/jdk/x64/mac/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.pkg"
8+
appcast "https://github.com/AdoptOpenJDK"
9+
name "AdoptOpenJDK 11"
10+
homepage "https://adoptopenjdk.net/"
11+
12+
pkg "OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.pkg"
13+
14+
postflight do
15+
system_command "/usr/sbin/pkgutil", args: ["--pkg-info", "net.adoptopenjdk.11.jdk"], print_stdout: true
16+
end
17+
18+
uninstall pkgutil: "net.adoptopenjdk.11.jdk"
19+
end

Casks/tuna-adoptopenjdk8.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PLEASE DO NOT EDIT THIS FILE. EDIT Templates/adoptopenjdk.rb.tmpl
2+
cask "tuna-adoptopenjdk8" do
3+
version "8u265b01"
4+
sha256 "db8b19f943bf96774a805b646b2c0ddd532123391e2e3873fe3720558e6091fe"
5+
6+
# github.com/AdoptOpenJDK was verified as official when first introduced to the cask
7+
url "https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/8/jdk/x64/mac/OpenJDK8U-jdk_x64_mac_hotspot_8u265b01.pkg"
8+
appcast "https://github.com/AdoptOpenJDK"
9+
name "AdoptOpenJDK 8"
10+
homepage "https://adoptopenjdk.net/"
11+
12+
pkg "OpenJDK8U-jdk_x64_mac_hotspot_8u265b01.pkg"
13+
14+
postflight do
15+
system_command "/usr/sbin/pkgutil", args: ["--pkg-info", "net.adoptopenjdk.8.jdk"], print_stdout: true
16+
end
17+
18+
uninstall pkgutil: "net.adoptopenjdk.8.jdk"
19+
end

Templates/adoptopenjdk.tmpl.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PLEASE DO NOT EDIT THIS FILE. EDIT Templates/adoptopenjdk.rb.tmpl
2+
cask "{cask_name}" do
3+
version "{version}"
4+
sha256 "{sha256}"
5+
6+
# github.com/AdoptOpenJDK was verified as official when first introduced to the cask
7+
url "{url}"
8+
appcast "https://github.com/AdoptOpenJDK"
9+
name "{name}"
10+
homepage "https://adoptopenjdk.net/"
11+
12+
pkg "{filename}"
13+
14+
postflight do
15+
system_command "/usr/sbin/pkgutil", args: ["--pkg-info", "{identifier}"], print_stdout: true
16+
end
17+
18+
uninstall pkgutil: "{identifier}"
19+
end

update_casks.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from os import replace
2+
import re
3+
import yaml
4+
5+
with open('versions.yml', 'r', encoding='utf-8') as f:
6+
versions = yaml.load(f.read(), Loader=yaml.Loader)
7+
for version in versions:
8+
print(version)
9+
with open('Templates/adoptopenjdk.tmpl.rb') as f:
10+
cask = f.read().replace('{cask_name}', 'tuna-' + version['cask_name'])\
11+
.replace('{version}', version['version'])\
12+
.replace('{sha256}', version['sha256'])\
13+
.replace('{url}', version['tuna-url'])\
14+
.replace('{name}', version['name'])\
15+
.replace('{filename}', version['filename'])\
16+
.replace('{identifier}', version['identifier'])
17+
18+
with open('Casks/tuna-' + version['cask_name'] + '.rb', "w") as f:
19+
f.write(cask)

versions.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# adoptopenjdk8
2+
- cask_name: adoptopenjdk8
3+
version: 8u265b01
4+
sha256: db8b19f943bf96774a805b646b2c0ddd532123391e2e3873fe3720558e6091fe
5+
tuna-url: https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/8/jdk/x64/mac/OpenJDK8U-jdk_x64_mac_hotspot_8u265b01.pkg
6+
name: AdoptOpenJDK 8
7+
filename: OpenJDK8U-jdk_x64_mac_hotspot_8u265b01.pkg
8+
identifier: net.adoptopenjdk.8.jdk
9+
10+
# adoptopenjdk11
11+
- cask_name: adoptopenjdk11
12+
version: 11.0.8_10
13+
sha256: c9ce3e78a7ec7f8c23041af63a66bfe18bbf75c7bfa8f8a51148a098f3653699
14+
tuna-url: https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/11/jdk/x64/mac/OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.pkg
15+
name: AdoptOpenJDK 11
16+
filename: OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.pkg
17+
identifier: net.adoptopenjdk.11.jdk

0 commit comments

Comments
 (0)