mirror of https://github.com/sbt/sbt.git
Merge pull request #403 from alexarchambault/fix-lmcoursier-jni
Ensure lmcoursier can load jniutils stuff fine on Windows
This commit is contained in:
commit
4d7c64febe
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: coursier/cache-action@v6.3
|
- uses: coursier/cache-action@v6.3
|
||||||
- uses: coursier/setup-action@v1
|
- uses: coursier/setup-action@v1.2.1
|
||||||
with:
|
with:
|
||||||
jvm: 8
|
jvm: 8
|
||||||
apps: sbt
|
apps: sbt
|
||||||
|
|
@ -48,7 +48,7 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: coursier/cache-action@v6.3
|
- uses: coursier/cache-action@v6.3
|
||||||
- uses: coursier/setup-action@v1
|
- uses: coursier/setup-action@v1.2.1
|
||||||
with:
|
with:
|
||||||
jvm: 8
|
jvm: 8
|
||||||
apps: sbt
|
apps: sbt
|
||||||
|
|
|
||||||
11
build.sbt
11
build.sbt
|
|
@ -66,6 +66,10 @@ lazy val definitions = project
|
||||||
dontPublish,
|
dontPublish,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// FIXME Ideally, we should depend on the same version of io.get-coursier.jniutils:windows-jni-utils that
|
||||||
|
// io.get-coursier::coursier depends on.
|
||||||
|
val jniUtilsVersion = "0.3.3"
|
||||||
|
|
||||||
lazy val `lm-coursier` = project
|
lazy val `lm-coursier` = project
|
||||||
.in(file("modules/lm-coursier"))
|
.in(file("modules/lm-coursier"))
|
||||||
.settings(
|
.settings(
|
||||||
|
|
@ -75,6 +79,7 @@ lazy val `lm-coursier` = project
|
||||||
Mima.lmCoursierFilters,
|
Mima.lmCoursierFilters,
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"io.get-coursier" %% "coursier" % coursierVersion0,
|
"io.get-coursier" %% "coursier" % coursierVersion0,
|
||||||
|
"io.get-coursier.jniutils" % "windows-jni-utils-lmcoursier" % jniUtilsVersion,
|
||||||
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
||||||
// We depend on librarymanagement-ivy rather than just
|
// We depend on librarymanagement-ivy rather than just
|
||||||
// librarymanagement-core to handle the ModuleDescriptor passed
|
// librarymanagement-core to handle the ModuleDescriptor passed
|
||||||
|
|
@ -106,7 +111,10 @@ lazy val `lm-coursier-shaded` = project
|
||||||
Mima.lmCoursierFilters,
|
Mima.lmCoursierFilters,
|
||||||
Mima.lmCoursierShadedFilters,
|
Mima.lmCoursierShadedFilters,
|
||||||
Compile / sources := (`lm-coursier` / Compile / sources).value,
|
Compile / sources := (`lm-coursier` / Compile / sources).value,
|
||||||
shadedModules += "io.get-coursier" %% "coursier",
|
shadedModules ++= Set(
|
||||||
|
"io.get-coursier" %% "coursier",
|
||||||
|
"io.get-coursier.jniutils" % "windows-jni-utils-lmcoursier"
|
||||||
|
),
|
||||||
validNamespaces += "lmcoursier",
|
validNamespaces += "lmcoursier",
|
||||||
validEntries ++= Set(
|
validEntries ++= Set(
|
||||||
// FIXME Ideally, we should just strip those from the resulting JAR…
|
// FIXME Ideally, we should just strip those from the resulting JAR…
|
||||||
|
|
@ -139,6 +147,7 @@ lazy val `lm-coursier-shaded` = project
|
||||||
},
|
},
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"io.get-coursier" %% "coursier" % coursierVersion0,
|
"io.get-coursier" %% "coursier" % coursierVersion0,
|
||||||
|
"io.get-coursier.jniutils" % "windows-jni-utils-lmcoursier" % jniUtilsVersion,
|
||||||
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
"net.hamnaberg" %% "dataclass-annotation" % dataclassScalafixV % Provided,
|
||||||
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1",
|
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1",
|
||||||
"org.scala-lang.modules" %% "scala-xml" % "1.3.0", // depending on that one so that it doesn't get shaded
|
"org.scala-lang.modules" %% "scala-xml" % "1.3.0", // depending on that one so that it doesn't get shaded
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euvx
|
set -euvx
|
||||||
|
|
||||||
|
# Force the use of coursier JNI stuff on Windows, which ought to work fine.
|
||||||
|
# JNI stuff is used to compute the default cache location on Windows (to get the AppData local
|
||||||
|
# dir, or something like this, via native Windows APIs).
|
||||||
|
# Without this, if ever coursier fails to load its JNI library on Windows, it falls back
|
||||||
|
# to using some powershell scripts (via dirs-dev/directories-jvm), which are often a problem,
|
||||||
|
# see sbt/sbt#5206.
|
||||||
|
# Enable this once sbt uses the upcoming lm-coursier-shaded version (> 2.0.10-1)
|
||||||
|
# export COURSIER_JNI="force"
|
||||||
|
|
||||||
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
|
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
|
||||||
SBT="sbt"
|
SBT="sbt"
|
||||||
elif [ "$(uname)" == "Darwin" ]; then
|
elif [ "$(uname)" == "Darwin" ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue