Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
java-version: '27'

- name: Compiling java
run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :snaploader:build
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
java-version: '27'

- name: Setup maven-3.9
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
java-version: '27'

- name: Generate javadoc
run: chmod +rwx ./gradlew && ./gradlew :snaploader:generateJavadocJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ public enum NativeVariant {
*/
JVM(System.getProperty("java.vm.name"));

private static final String Linux = "Linux";
private static final String Windows = "Windows";
private static final String Mac = "Mac";
private static final String WebOs = "WebOs";
private static final String Dalvik = "Dalvik";
private static final String Linux = "linux";
private static final String Windows = "windows";
private static final String Mac = "mac";
private static final String WebOs = "webos";
private static final String Web0s = "web0s";
private static final String Ios = "ios";
private static final String Iphone = "iphone";
private static final String Dalvik = "dalvik";

private final String property;

Expand Down Expand Up @@ -156,7 +159,9 @@ public static boolean isDesktop() {
* @return true if web-os; false otherwise. Current value is constantly false.
*/
public static boolean isWebOs() {
return false;
return NativeVariant.OS_NAME.getProperty()
.contains(NativeVariant.WebOs) || NativeVariant.OS_NAME.getProperty()
.contains(NativeVariant.Web0s);
}

/**
Expand All @@ -166,7 +171,8 @@ public static boolean isWebOs() {
* @return true if iOS; false otherwise. Current value is constantly false.
*/
public static boolean isIos() {
return false;
return NativeVariant.OS_NAME.getProperty()
.contains(NativeVariant.Ios) || NativeVariant.OS_NAME.getProperty().contains(NativeVariant.Iphone);
}
}

Expand Down Expand Up @@ -302,6 +308,15 @@ public static boolean isARM() {
return OS_ARCH.getProperty().contains("arm") || OS_ARCH.getProperty().contains("aarch");
}

/**
* Tests whether the current CPU vendor is a Loongson vendor (i.e., an independent Chinese vendor).
*
* @return true if the current CPU vendor is a Loongson vendor.
*/
public static boolean isLoongArch() {
return OS_ARCH.getProperty().contains("loong");
}

/**
* Reads named CPU features from the OSHI library and parses them into
* words. If system commands are executed, this might be an expensive
Expand Down Expand Up @@ -411,11 +426,11 @@ public static boolean hasExtensions(String... requiredNames) {
}

/**
* Retrieves the data of this native variant property.
* Retrieves the data of this native variant property in a lowercase style.
*
* @return the specified property object in a string format.
*/
public String getProperty() {
return property;
return property.toLowerCase();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public final class PlatformPredicate {
*/
public static final PlatformPredicate LINUX_RISC_V_64 = new PlatformPredicate(NativeVariant.Os.isLinux() && NativeVariant.Cpu.isRiscV() && NativeVariant.Cpu.is64());

/**
* Alias object for Linux on Loongson Arch 64 Chipset; a Chinese RISC microprocessor.
*/
public static final PlatformPredicate LINUX_LOONGARCH_64 = new PlatformPredicate(NativeVariant.Os.isDesktop() &&
NativeVariant.Os.isLinux() && NativeVariant.Cpu.isLoongArch() && NativeVariant.Cpu.is64());

/**
* Alias object for MacOSX on X86 Chipset.
*/
Expand Down
Loading