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 e38963a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/gradle-windows.yml
@@ -0,0 +1,34 @@
name: Windows Minimal Tests for Gradle

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 --fail-fast
- name: Tests results
if: always()
uses: actions/upload-artifact@v2
with:
name: functional-tests-results
path: native-maven-plugin/build/reports/tests/
34 changes: 34 additions & 0 deletions .github/workflows/maven-windows.yml
@@ -0,0 +1,34 @@
name: Windows Minimal Tests for Maven

on:
push:
paths:
- 'native-maven-plugin/**'
- 'samples/**'
- 'common/**'
pull_request:
paths:
- 'native-maven-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 Maven plugin
run: ./gradlew.bat :native-maven-plugin:functionalTest --no-daemon --fail-fast
- name: Tests results
if: always()
uses: actions/upload-artifact@v2
with:
name: functional-tests-results
path: native-maven-plugin/build/reports/tests/
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 e38963a

Please sign in to comment.