Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ model {
architecture "amd64"
operatingSystem "linux"
}
linux_s390x {
architecture "s390x"
operatingSystem "linux"
}
linux_s390 {
architecture "s390"
operatingSystem "linux"
}
windows_i386 {
architecture "i386"
operatingSystem "windows"
Expand Down Expand Up @@ -258,7 +266,7 @@ mainPom.scopeMappings.mappings.clear()
mainPom.withXml { provider ->
def node = provider.asNode()
def deps = node.appendNode('dependencies')
['osx-i386', 'osx-amd64', 'linux-amd64', 'linux-i386',
['osx-i386', 'osx-amd64', 'linux-amd64', 'linux-i386', 'linux-s390x', 'linux-s390',
'windows-amd64', 'windows-i386', 'freebsd-i386', 'freebsd-amd64'].each { platform ->
def dep = deps.appendNode('dependency')
dep.appendNode('groupId', project.group)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/rubygrapefruit/platform/SystemInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
@ThreadSafe
public interface SystemInfo extends NativeIntegration {
enum Architecture { i386, amd64 }
enum Architecture { i386, amd64, s390, s390x }

/**
* Returns the name of the kernel for the current operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public Architecture getArchitecture() {
if (machineArchitecture.equals("i386") || machineArchitecture.equals("x86") || machineArchitecture.equals("i686")) {
return Architecture.i386;
}
if (machineArchitecture.equals("s390x")) {
return Architecture.s390x;
}
if (machineArchitecture.equals("s390")) {
return Architecture.s390;
}
throw new NativeException(String.format("Cannot determine architecture from kernel architecture name '%s'.",
machineArchitecture));
}
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/net/rubygrapefruit/platform/internal/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static Platform current() {
platform = new Linux64Bit();
} else if (arch.equals("i386") || arch.equals("x86")) {
platform = new Linux32Bit();
} else if (arch.equals("s390x")) {
platform = new LinuxZ64Bit();
} else if (arch.equals("s390")) {
platform = new LinuxZ32Bit();
}
} else if (osName.contains("os x") || osName.contains("darwin")) {
if (arch.equals("i386")) {
Expand Down Expand Up @@ -251,6 +255,20 @@ public String getId() {
}
}

private static class LinuxZ32Bit extends Linux {
@Override
public String getId() {
return "linux-s390";
}
}

private static class LinuxZ64Bit extends Linux {
@Override
public String getId() {
return "linux-s390x";
}
}

private static class FreeBSD32Bit extends Unix {
@Override
public String getId() {
Expand Down