Skip to content

Commit 07eae3b

Browse files
committed
set jna.nosys to true programmatically
Ref sbt/io#110
1 parent d8609ce commit 07eae3b

File tree

5 files changed

+152
-146
lines changed

5 files changed

+152
-146
lines changed

.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ install:
2020
- SET PATH=C:\sbt\sbt\bin;%PATH%
2121
- SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g -Dfile.encoding=UTF8
2222
test_script:
23-
- sbt "-Djna.nosys=true" "scripted actions/*"
23+
- sbt "scripted actions/*"

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def otherRootSettings =
572572
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
573573
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
574574
// scriptedPrescripted := { addSbtAlternateResolver _ },
575-
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server", "-Djna.nosys=true"),
575+
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server"),
576576
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
577577
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
578578
aggregate in bintrayRelease := false

main/src/main/scala/sbt/Main.scala

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ object StandardMain {
128128
def initialState(configuration: xsbti.AppConfiguration,
129129
initialDefinitions: Seq[Command],
130130
preCommands: Seq[String]): State = {
131+
// This is to workaround https://github.com/sbt/io/issues/110
132+
sys.props.put("jna.nosys", "true")
133+
131134
import BasicCommandStrings.isEarlyCommand
132135
val userCommands = configuration.arguments.map(_.trim)
133136
val (earlyCommands, normalCommands) = (preCommands ++ userCommands).partition(isEarlyCommand)

project/Scripted.scala

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ trait ScriptedKeys {
3737
}
3838

3939
object Scripted {
40+
// This is to workaround https://github.com/sbt/io/issues/110
41+
sys.props.put("jna.nosys", "true")
42+
4043
lazy val MavenResolverPluginTest = config("mavenResolverPluginTest") extend Compile
4144
lazy val RepoOverrideTest = config("repoOverrideTest") extend Compile
4245

0 commit comments

Comments
 (0)