Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Aug 12, 2024
1 parent 86cdecd commit c921e7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class LWJGL3UpgradeLibraryProcessor extends LibraryProcessor {
private static final String LWJGL_GROUP = "org.lwjgl";
// Version used to support ARM64 macOS, or Java 19 on all platforms
private static final String LWJGL_VERSION = "3.3.2";
// Version used to support RiscV Linux
// Version used to support RISC-V Linux
private static final String LWJGL_VERSION_RISCV = "3.3.4";

public LWJGL3UpgradeLibraryProcessor(Platform platform, LibraryContext context) {
Expand All @@ -65,11 +65,11 @@ public ApplicationResult getApplicationResult() {

if (upgradeLinuxRiscV()) {
if (!context.hasClasspathNatives()) {
// Don't support upgrading versions not using classpath natives to support RiscV
// Don't support upgrading versions not using classpath natives to support RISC-V
return ApplicationResult.DONT_APPLY;
}

// Update LWJGL when RiscV Linux is not supported
// Update LWJGL when RISC-V Linux is not supported
return ApplicationResult.MUST_APPLY;
}

Expand Down Expand Up @@ -106,7 +106,7 @@ private boolean upgradeMacOSArm() {
&& !context.hasClasspathNatives();
}

// Add support for Linux RiscV
// Add support for Linux RISC-V
private boolean upgradeLinuxRiscV() {
return platform.getOperatingSystem().isLinux()
&& platform.getArchitecture().isRiscV()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import net.fabricmc.loom.util.Platform;

/**
* A processor to add support for RiscV.
* A processor to add support for RISC-V.
*/
public class RiscVNativesLibraryProcessor extends LibraryProcessor {
private static final String LWJGL_GROUP = "org.lwjgl";
Expand All @@ -53,12 +53,12 @@ public ApplicationResult getApplicationResult() {
}

if (!platform.getArchitecture().isRiscV() || !platform.getArchitecture().is64Bit()) {
// Not an RiscV platform, can never apply this.
// Not an RISC-V platform, can never apply this.
return ApplicationResult.DONT_APPLY;
}

if (!platform.getOperatingSystem().isLinux()) {
// Only linux supports RiscV
// Only linux supports RISC-V
return ApplicationResult.DONT_APPLY;
}

Expand All @@ -73,9 +73,9 @@ public ApplicationResult getApplicationResult() {
@Override
public Predicate<Library> apply(Consumer<Library> dependencyConsumer) {
return library -> {
// Add additional riscv64 natives for LWJGL, alongside the existing x64 linux natives.
// Add additional RISC-V natives for LWJGL, alongside the existing x64 linux natives.
if (library.is(LWJGL_GROUP) && library.target() == Library.Target.NATIVES && (library.classifier() != null && library.classifier().equals("natives-linux"))) {
// Add the riscv64 natives.
// Add the RISC-V natives.
dependencyConsumer.accept(library.withClassifier(library.classifier() + "-riscv64"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LibraryProcessorManagerTest extends LibraryProcessorTest {
processed.find { it.is("org.lwjgl:lwjgl-glfw") && it.target() == Library.Target.NATIVES }.classifier() == "natives-macos"
}

// A test to ensure that we can add linux ARM64 support on an unsupported version
// A test to ensure that we can add linux RISC-V support on an unsupported version
def "Linux riscv"() {
when:
def platform = PlatformTestUtils.LINUX_RISCV
Expand Down

0 comments on commit c921e7d

Please sign in to comment.