Skip to content

Commit 08929ba

Browse files
authored
Return gmaven for OS detection (#1348)
As Nisse is "drop in replacement" for OS-Detector, but this code was different from start (ie amd64 vs x86_64).
1 parent 6875a3c commit 08929ba

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.mvn/maven.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
-Dnisse.compat.osDetector=true

pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,41 @@
567567
</execution>
568568
</executions>
569569
</plugin>
570+
<plugin>
571+
<groupId>org.codehaus.gmavenplus</groupId>
572+
<artifactId>gmavenplus-plugin</artifactId>
573+
<executions>
574+
<execution>
575+
<id>set-platform-properties</id>
576+
<goals>
577+
<goal>execute</goal>
578+
</goals>
579+
<phase>generate-sources</phase>
580+
<configuration>
581+
<scripts>
582+
<script>// Naming conventions coined by GraalVM
583+
// https://github.com/graalvm/graalvm-ce-builds/releases/
584+
String osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
585+
if (osName.startsWith('windows')) {
586+
project.properties['os.detected.name'] = 'windows'
587+
} else if (osName.startsWith('linux')) {
588+
project.properties['os.detected.name'] = 'linux'
589+
} else if (osName.startsWith('osx') || osName.startsWith('mac os x')) {
590+
project.properties['os.detected.name'] = 'darwin'
591+
} else {
592+
project.properties['os.detected.name'] = osName
593+
}
594+
String osArch = System.getProperty('os.arch').toLowerCase(Locale.ROOT)
595+
if (osArch.equals('amd64') || osArch.equals('x86_64')) {
596+
project.properties['os.detected.arch'] = 'amd64'
597+
} else {
598+
project.properties['os.detected.arch'] = osArch
599+
}</script>
600+
</scripts>
601+
</configuration>
602+
</execution>
603+
</executions>
604+
</plugin>
570605
</plugins>
571606
</build>
572607

0 commit comments

Comments
 (0)