Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed Mar 10, 2024
2 parents b06b3b9 + b8dc2d2 commit f73a977
Show file tree
Hide file tree
Showing 17 changed files with 351 additions and 785 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Build the project
run: ./gradlew build --stacktrace --warning-mode=fail

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: build/libs
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'java'
id 'java-library'
id 'application'
id 'maven-publish'
id "checkstyle"
Expand Down Expand Up @@ -34,6 +34,8 @@ java {
languageVersion = JavaLanguageVersion.of(17)
}
}

withSourcesJar()
}

javafx {
Expand All @@ -47,15 +49,15 @@ javafx {
}

dependencies {
api "org.ow2.asm:asm:${asm_version}"
api "org.ow2.asm:asm-tree:${asm_version}"
api "net.fabricmc:mapping-io:${mappingio_version}"
implementation "org.ow2.asm:asm-commons:${asm_version}"
implementation "org.ow2.asm:asm-util:${asm_version}"
implementation "com.github.javaparser:javaparser-core:${javaparser_version}"
implementation "net.fabricmc:cfr:${fabric_cfr_version}"
implementation "net.fabricmc:fabric-fernflower:${fabric_fernflower_version}"
implementation "net.fabricmc:mapping-io:${mappingio_version}"
implementation "org.vineflower:vineflower:${vineflower_version}"
implementation "org.bitbucket.mstrobel:procyon-compilertools:${procyon_version}"
implementation "org.ow2.asm:asm:${asm_version}"
implementation "org.ow2.asm:asm-commons:${asm_version}"
implementation "org.ow2.asm:asm-tree:${asm_version}"
implementation "org.ow2.asm:asm-util:${asm_version}"

// JavaFX for all platforms (needed for cross-platform fat jar)
runtimeOnly "org.openjfx:javafx-base:${javafx_version}:win"
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
org.gradle.jvmargs=-Xmx2G

# Gradle Plugins
javafx_plugin_version = 0.0.13
javafx_plugin_version = 0.1.0
shadow_version = 7.1.2

# Poject Properties
version = 0.1.0

# Project Dependencies
asm_version = 9.4
fabric_cfr_version = 0.2.0
fabric_fernflower_version = 2.0.0
asm_version = 9.6
fabric_cfr_version = 0.2.1
vineflower_version = 1.9.3
procyon_version = 0.6.0
mappingio_version = 0.3.0
javaparser_version = 3.24.2
javafx_version = 17.0.2
checkstyle_version = 10.3.4
mappingio_version = 0.5.0
javaparser_version = 3.25.6
javafx_version = 21.0.1
checkstyle_version = 10.12.5
Empty file modified gradlew
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/main/java/matcher/classifier/MethodClassifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private static double compareAsmNodes(MethodInstance a, MethodInstance b) {
}

public abstract static class AbstractClassifier implements IClassifier<MethodInstance> {
AbstractClassifier(String name) {
public AbstractClassifier(String name) {
this.name = name;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/matcher/classifier/MethodVarClassifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void init() {
addClassifier(usage, 8);
}

private static void addClassifier(AbstractClassifier classifier, double weight, ClassifierLevel... levels) {
public static void addClassifier(AbstractClassifier classifier, double weight, ClassifierLevel... levels) {
if (levels.length == 0) levels = ClassifierLevel.ALL;

classifier.weight = weight;
Expand Down Expand Up @@ -114,8 +114,8 @@ public double getScore(MethodVarInstance argA, MethodVarInstance argB, ClassEnvi
}
};

private abstract static class AbstractClassifier implements IClassifier<MethodVarInstance> {
AbstractClassifier(String name) {
public abstract static class AbstractClassifier implements IClassifier<MethodVarInstance> {
public AbstractClassifier(String name) {
this.name = name;
}

Expand Down
14 changes: 5 additions & 9 deletions src/main/java/matcher/gui/menu/FileMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@ private void init() {
getItems().add(menuItem);
menuItem.setOnAction(event -> loadMappings(null));

menuItem = new MenuItem("Load mappings (Enigma)");
menuItem = new MenuItem("Load mappings (Enigma dir)");
getItems().add(menuItem);
menuItem.setOnAction(event -> loadMappings(MappingFormat.ENIGMA));

menuItem = new MenuItem("Load mappings (MCP dir)");
getItems().add(menuItem);
menuItem.setOnAction(event -> loadMappings(MappingFormat.MCP));
menuItem.setOnAction(event -> loadMappings(MappingFormat.ENIGMA_DIR));

menuItem = new MenuItem("Save mappings");
getItems().add(menuItem);
menuItem.setOnAction(event -> saveMappings(null));

menuItem = new MenuItem("Save mappings (Enigma)");
menuItem = new MenuItem("Save mappings (Enigma dir)");
getItems().add(menuItem);
menuItem.setOnAction(event -> saveMappings(MappingFormat.ENIGMA));
menuItem.setOnAction(event -> saveMappings(MappingFormat.ENIGMA_DIR));

menuItem = new MenuItem("Clear mappings");
getItems().add(menuItem);
Expand Down Expand Up @@ -361,7 +357,7 @@ private static boolean isDirEmpty(Path dir) {
}

private static MappingFormat getFormat(Path file) {
if (Files.isDirectory(file)) return MappingFormat.ENIGMA;
if (Files.isDirectory(file)) return MappingFormat.ENIGMA_DIR;

String name = file.getFileName().toString().toLowerCase(Locale.ENGLISH);

Expand Down
Loading

0 comments on commit f73a977

Please sign in to comment.