Skip to content

Commit

Permalink
Make sure executable ends with .exe under Windows
Browse files Browse the repository at this point in the history
This commit fixes the executable name when the plugin is running
under Windows: `nativeRun` would fail because it doesn't append
the `.exe` extension to the file name.

Fixes #198
  • Loading branch information
melix committed Feb 3, 2022
1 parent e0e4492 commit b56135f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Windows Minimal Tests

on:
push:
paths:
- 'native-gradle-plugin/**'
- 'samples/**'
- 'common/**'
pull_request:
paths:
- 'native-gradle-plugin/**'
- 'samples/**'
- 'common/**'
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: graalvm/setup-graalvm@v1
with:
version: 'dev'
java-version: '11'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check and test the Gradle plugin
run: ./gradlew.bat :native-gradle-plugin:functionalTest --no-daemon
- name: Tests results
if: always()
uses: actions/upload-artifact@v2
with:
name: functional-tests-results-${{ matrix.gradle-version }}
path: native-maven-plugin/build/reports/tests/
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import java.nio.file.Paths;
import java.util.List;

import static org.graalvm.buildtools.utils.SharedConstants.EXECUTABLE_EXTENSION;
import static org.graalvm.buildtools.utils.SharedConstants.GU_EXE;
import static org.graalvm.buildtools.utils.SharedConstants.NATIVE_IMAGE_EXE;

Expand Down Expand Up @@ -107,7 +108,7 @@ protected Provider<String> getGraalVMHome() {

@Internal
public Provider<String> getExecutableName() {
return getOptions().flatMap(NativeImageOptions::getImageName);
return getOptions().flatMap(options -> options.getImageName().map(name -> name + EXECUTABLE_EXTENSION));
}

@Internal
Expand Down

0 comments on commit b56135f

Please sign in to comment.