Skip to content

Commit

Permalink
Fallback to manual installation for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olafur Pall Geirsson committed Sep 8, 2020
1 parent 484e1b4 commit 09e5782
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,23 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2016, windows-latest]
os: [windows-latest]
steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-scala@v7
- run: java -version
- run: choco install -y windows-sdk-7.1 vcbuildtools kb2519277
- shell: bash
- name: Configure Pagefile
uses: al-cheb/[email protected]
- name: Refresh Pagefile
run: |
cp "/C/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64/advapi32.lib" "/C/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64/stdc++.lib"
- shell: cmd
name: sbt test
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
- uses: olafurpg/setup-scala@v7
with:
java-version: [email protected]
- name: gu install native-image
shell: bash
run: |
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd"
sbt test
echo $JAVA_HOME
"$JAVA_HOME\bin\gu.cmd" install native-image
- name: sbt test
shell: cmd
run: >-
"C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt test
26 changes: 17 additions & 9 deletions plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,23 @@ object NativeImagePlugin extends AutoPlugin {
}
},
nativeImageCommand := {
val svmVersion = nativeImageVersion.value
List(
nativeImageCoursier.value.absolutePath,
"launch",
"--jvm",
s"${nativeImageJvm.value}:$svmVersion",
s"org.graalvm.nativeimage:svm-driver:$svmVersion",
"--"
)
if (
Properties.isWin ||
Properties.propIsSet("native-image-installed") ||
"true".equalsIgnoreCase(System.getenv("NATIVE_IMAGE_INSTALLED"))
) {
List[String]("native-image")
} else {
val svmVersion = nativeImageVersion.value
List(
nativeImageCoursier.value.absolutePath,
"launch",
"--jvm",
s"${nativeImageJvm.value}:$svmVersion",
s"org.graalvm.nativeimage:svm-driver:$svmVersion",
"--"
)
}
},
nativeImageOutput :=
target.in(NativeImage).value / name.in(NativeImage).value,
Expand Down

0 comments on commit 09e5782

Please sign in to comment.