Skip to content

Commit

Permalink
fiuxp
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Nov 19, 2024
1 parent 4381397 commit 9c640f1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
8 changes: 2 additions & 6 deletions .github/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ set -exo pipefail

TEST_VERSION="0.1.0-test"

export COURSIER_INTERFACE_JAVA8_HOME="$(cs java-home --jvm 8)"

echo "Running tests"
sbt +test

Expand All @@ -27,11 +25,9 @@ if [ "$IS_UNIX" == "true" ]; then
sbt \
'set version in ThisBuild := "'"$TEST_VERSION"'"' \
publishLocal
echo "Running JDK 11 tests…"
# test that things work from JDK 11
# not actually building things from it, running into weird proguard issues…
echo "Running JDK 8 tests…"

TEST_JDK="adopt:1.11.0-7"
TEST_JDK="adoptium:8"
eval "$(cs java --jvm "$TEST_JDK" --env)"

java -Xmx32m -version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: coursier/cache-action@v6
- uses: coursier/[email protected]
with:
jvm: 17
jvm: 21
apps: sbt
- name: Test
run: ./.github/scripts/ci.sh
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: coursier/cache-action@v6
- uses: coursier/[email protected]
with:
jvm: 17
jvm: 21
- run: .github/scripts/gpg-setup.sh
shell: bash
env:
Expand Down
18 changes: 12 additions & 6 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ object Settings {

def scala212 = "2.12.20"

private lazy val java8Home = Option(System.getenv("COURSIER_INTERFACE_JAVA8_HOME"))
.map(java.nio.file.Paths.get(_))
.getOrElse {
sys.error("COURSIER_INTERFACE_JAVA8_HOME not set")
}
private lazy val java8Home = Option(System.getenv("COURSIER_INTERFACE_JAVA8_HOME")).getOrElse {
val jvmId =
if (Properties.isMac && isArm64)
// no native JDK 8 on Mac ARM, using amd64 one
"https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u432-b06/OpenJDK8U-jdk_x64_mac_hotspot_8u432b06.tar.gz"
else
"adoptium:8"
os.proc("cs", "java-home", "--jvm", jvmId)
.call()
.out.trim()
}
private lazy val rtJar = {
val path = java8Home.resolve("jre/lib/rt.jar")
val path = java.nio.file.Paths.get(java8Home).resolve("jre/lib/rt.jar")
assert(java.nio.file.Files.exists(path))
path
}
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")
addSbtPlugin("com.lightbend.sbt" % "sbt-proguard" % "0.4.0")

libraryDependencies += "com.eed3si9n.jarjarabrams" %% "jarjar-abrams-core" % "1.14.0"

libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.11.3"

0 comments on commit 9c640f1

Please sign in to comment.