Merge pull request #3833 from eed3si9n/wip/jna

try to set jna.nosys to true programmatically
This commit is contained in:
Dale Wijnand 2017-12-21 08:24:17 +00:00 committed by GitHub
commit bef5c9c996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

View File

@ -20,4 +20,4 @@ install:
- SET PATH=C:\sbt\sbt\bin;%PATH%
- SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g -Dfile.encoding=UTF8
test_script:
- sbt "-Djna.nosys=true" "scripted actions/*"
- sbt "scripted actions/*"

View File

@ -572,7 +572,7 @@ def otherRootSettings =
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
// scriptedPrescripted := { addSbtAlternateResolver _ },
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server", "-Djna.nosys=true"),
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server"),
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
aggregate in bintrayRelease := false

View File

@ -128,6 +128,9 @@ object StandardMain {
def initialState(configuration: xsbti.AppConfiguration,
initialDefinitions: Seq[Command],
preCommands: Seq[String]): State = {
// This is to workaround https://github.com/sbt/io/issues/110
sys.props.put("jna.nosys", "true")
import BasicCommandStrings.isEarlyCommand
val userCommands = configuration.arguments.map(_.trim)
val (earlyCommands, normalCommands) = (preCommands ++ userCommands).partition(isEarlyCommand)

View File

@ -156,7 +156,8 @@ private[sbt] final class CommandExchange {
// rememeber to shutdown only when the server comes up
server = Some(x)
case Some(Failure(e: AlreadyRunningException)) =>
s.log.warn("sbt server could not start because there's another instance of sbt running on this build.")
s.log.warn(
"sbt server could not start because there's another instance of sbt running on this build.")
s.log.warn("Running multiple instances is unsupported")
server = None
firstInstance.set(false)

View File

@ -37,6 +37,9 @@ trait ScriptedKeys {
}
object Scripted {
// This is to workaround https://github.com/sbt/io/issues/110
sys.props.put("jna.nosys", "true")
lazy val MavenResolverPluginTest = config("mavenResolverPluginTest") extend Compile
lazy val RepoOverrideTest = config("repoOverrideTest") extend Compile