Return gmaven for OS detection (#1348)
Some checks failed
Early Access / Default build (without GraalVM) (push) Has been cancelled
Early Access / Build with GraalVM on ${{ matrix.os }} (macos-13) (push) Has been cancelled
Early Access / Build with GraalVM on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
Early Access / Build with GraalVM on ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled
Early Access / Build with GraalVM on ${{ matrix.os }} (windows-latest) (push) Has been cancelled
Early Access / Site build (push) Has been cancelled

As Nisse is "drop in replacement" for OS-Detector, but
this code was different from start (ie amd64 vs x86_64).
This commit is contained in:
Tamas Cservenak
2025-06-10 12:09:55 +02:00
committed by GitHub
parent 6875a3c759
commit 08929bafab
2 changed files with 35 additions and 1 deletions

View File

@@ -1 +0,0 @@
-Dnisse.compat.osDetector=true

35
pom.xml
View File

@@ -567,6 +567,41 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<id>set-platform-properties</id>
<goals>
<goal>execute</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<scripts>
<script>// Naming conventions coined by GraalVM
// https://github.com/graalvm/graalvm-ce-builds/releases/
String osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
if (osName.startsWith('windows')) {
project.properties['os.detected.name'] = 'windows'
} else if (osName.startsWith('linux')) {
project.properties['os.detected.name'] = 'linux'
} else if (osName.startsWith('osx') || osName.startsWith('mac os x')) {
project.properties['os.detected.name'] = 'darwin'
} else {
project.properties['os.detected.name'] = osName
}
String osArch = System.getProperty('os.arch').toLowerCase(Locale.ROOT)
if (osArch.equals('amd64') || osArch.equals('x86_64')) {
project.properties['os.detected.arch'] = 'amd64'
} else {
project.properties['os.detected.arch'] = osArch
}</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>