Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for JDK 21 on various distributions #215

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.4
version = 3.7.14
project.git = true

align.preset = more
Expand All @@ -13,7 +13,7 @@ newlines.beforeMultiline = keep
newlines.afterCurlyLambdaParams = keep
newlines.alwaysBeforeElseAfterCurlyIf = true

runner.dialect = scala213
runner.dialect = scala3

rewrite.rules = [
RedundantBraces
Expand Down
10 changes: 8 additions & 2 deletions scala-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -eu

SCALA_CLI_VERSION="0.1.19"
SCALA_CLI_VERSION="1.0.4"

GH_ORG="VirtusLab"
GH_NAME="scala-cli"
Expand All @@ -19,7 +19,13 @@ else
fi

if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-x86_64-pc-linux.gz"
arch=$(uname -m)
if [[ "$arch" == "aarch64" ]] || [[ "$arch" == "x86_64" ]]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-${arch}-pc-linux.gz"
else
echoerr "scala-cli is not supported on $arch"
exit 2
fi
CACHE_BASE="$HOME/.cache/coursier/v1"
elif [ "$(uname)" == "Darwin" ]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-x86_64-apple-darwin.gz"
Expand Down
8 changes: 4 additions & 4 deletions src/Corretto.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import sttp.client3.quick._

/*
- Latest Corretto binaries are listed at https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html
- This gives latest versions only!
- Latest Corretto binaries are listed at https://docs.aws.amazon.com/corretto/
- Previous tags for various JDK versions are in GitHub
- See all Corretto JDK versions: https://github.com/orgs/corretto/repositories?q=corretto,
- See all tag names for a given JDK version: e.g. https://github.com/corretto/corretto-17/releases
Expand Down Expand Up @@ -54,8 +53,9 @@ object Corretto {
val correttoJdk17Index0 = index(ghToken, "17")
val correttoJdk18Index0 = index(ghToken, "18") // public archive, 3 tags
val correttoJdk19Index0 = index(ghToken, "19")
val correttoJdk20Index0 = index(ghToken, "20") // pre-release at this time, filtered out
correttoIndex0 + correttoJdk11Index0 + correttoJdk17Index0 + correttoJdk18Index0 + correttoJdk19Index0 + correttoJdk20Index0
val correttoJdk20Index0 = index(ghToken, "20")
val correttoJdk21Index0 = index(ghToken, "21")
correttoIndex0 + correttoJdk11Index0 + correttoJdk17Index0 + correttoJdk18Index0 + correttoJdk19Index0 + correttoJdk20Index0 + correttoJdk21Index0
}

def index(
Expand Down
11 changes: 5 additions & 6 deletions src/GenerateIndex.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//> using scala "2.13"
//> using lib "com.softwaremill.sttp.client3::core:3.8.15"
//> using lib "com.lihaoyi::ujson:3.1.0"
//> using lib "com.lihaoyi::os-lib:0.9.1"
//> using option "-deprecation"
//> using option "-Ywarn-unused"
//> using scala 3
//> using dep com.softwaremill.sttp.client3::core:3.9.0
//> using dep com.lihaoyi::ujson:3.1.3
//> using dep com.lihaoyi::os-lib:0.9.1
//> using options -Wunused:all -deprecation

object GenerateIndex {

Expand Down
3 changes: 2 additions & 1 deletion src/Graalvm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ object Graalvm {
def fullIndex(ghToken: String): Index = {
val graalvmJdk17Index0 = index(ghToken, "17")
val graalvmJdk20Index0 = index(ghToken, "20")
graalvmJdk17Index0 + graalvmJdk20Index0
val graalvmJdk21Index0 = index(ghToken, "21")
graalvmJdk17Index0 + graalvmJdk20Index0 + graalvmJdk21Index0
}

def index(
Expand Down
2 changes: 1 addition & 1 deletion src/Temurin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ object Temurin {

def fullIndex(ghToken: String): Index = {
val adoptIndices = (8 to 16).map(ver => ver -> index(ghToken, ver, adopt = true))
val temurinIndices = Seq(8, 11, 16, 17, 18, 19, 20)
val temurinIndices = Seq(8, 11, 16, 17, 18, 19, 20, 21)
.map(ver => ver -> index(ghToken, ver, adopt = false))

val adoptiumIndices = (adoptIndices.toMap ++ temurinIndices)
Expand Down