Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Nov 19, 2024
1 parent 1a1c1fa commit c4f2e3e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ TEST_VERSION="0.1.0-test"
echo "Running tests"
sbt +test

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

IS_UNIX="false"
case "$(uname -s)" in
Linux*) IS_UNIX="true";;
Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ inThisBuild(List(

lazy val finalPackageBin = taskKey[File]("")

lazy val isJava9OrMore = sys.props.get("java.version").exists(!_.startsWith("1."))

lazy val interface = project
.enablePlugins(SbtProguard)
.settings(
Expand Down Expand Up @@ -121,7 +123,6 @@ lazy val interface = project
"-keep class coursierapi.** {\n public protected *;\n}"
)

val isJava9OrMore = sys.props.get("java.version").exists(!_.startsWith("1."))
val maybeJava9Options =
if (isJava9OrMore) {
val javaHome = sys.props.getOrElse("java.home", ???)
Expand Down
22 changes: 18 additions & 4 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@ 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 rtJar = {
val path = java8Home.resolve("jre/lib/rt.jar")
assert(java.nio.file.Files.exists(path))
path
}
lazy val shared = Seq(
scalaVersion := scala213,
crossScalaVersions := Seq(scala213, scala212),
scalacOptions += "-target:jvm-1.8",
scalacOptions ++= Seq("--release", "8"),
javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
"-source", "8",
"-target", "8",
"-bootclasspath", rtJar.toString
),
Compile / doc / javacOptions := Seq("-source", "1.8")
Compile / doc / javacOptions := Seq(
"-source", "8",
"-bootclasspath", rtJar.toString
)
)

private val filterOut = Set("0.0.1")
Expand Down

0 comments on commit c4f2e3e

Please sign in to comment.