diff --git a/.gitignore b/.gitignore index 2edfc3f..a4db5de 100644 --- a/.gitignore +++ b/.gitignore @@ -149,3 +149,5 @@ gradle-app.setting .classpath # End of https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,forgegradle,java + +srgmap.cfg \ No newline at end of file diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.MD b/README.MD index ea2e47b..b966466 100644 --- a/README.MD +++ b/README.MD @@ -1,17 +1,17 @@ A library for 1.7.10 with lots of useful stuff, licensed under the LGPL3.0+SNEED license. -| Package | Contents / Purpose | -|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------| -| [asm](src/main/java/com/falsepattern/lib/asm) | ASM helper code | -| [compat](src/main/java/com/falsepattern/lib/compat) | Code backported from vanilla 1.12.2 | -| [config](src/main/java/com/falsepattern/lib/config) | 1.12.2-style annotation-based config library | -| [dependencies](src/main/java/com/falsepattern/lib/dependencies) | Runtime dependency loader which uses Maven | -| [mapping](src/main/java/com/falsepattern/lib/mapping) | Notch-SRG-MCP name mapping helper code | -| [mixin](src/main/java/com/falsepattern/lib/mixin) | Mixin loader plugin boilerplate code | -| [text](src/main/java/com/falsepattern/lib/text) | Better Chat and GUI text processing | -| [toasts](src/main/java/com/falsepattern/lib/toasts) | The toast system from newer versions, with some extras | -| [updates](src/main/java/com/falsepattern/lib/updates) | Helper code for update checking | -| [util](src/main/java/com/falsepattern/lib/util) | Additional utilities that do not fit the above categories, see below for more information | +| Package | Contents / Purpose | +|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| [asm](src/main/java/com/falsepattern/lib/asm) | ASM helper code | +| [compat](src/main/java/com/falsepattern/lib/compat) | Code backported from vanilla 1.12.2 | +| [config](src/main/java/com/falsepattern/lib/config) | 1.12.2-style annotation-based config library | +| [dependencies](src/main/java/com/falsepattern/lib/dependencies) | Runtime dependency loader which uses Maven (DEPRECATED, see [The new data-driven dependency format](src/main/resources/DEPENDENCIES.MD) | +| [mapping](src/main/java/com/falsepattern/lib/mapping) | Notch-SRG-MCP name mapping helper code | +| [mixin](src/main/java/com/falsepattern/lib/mixin) | Mixin loader plugin boilerplate code | +| [text](src/main/java/com/falsepattern/lib/text) | Better Chat and GUI text processing | +| [toasts](src/main/java/com/falsepattern/lib/toasts) | The toast system from newer versions, with some extras | +| [updates](src/main/java/com/falsepattern/lib/updates) | Helper code for update checking | +| [util](src/main/java/com/falsepattern/lib/util) | Additional utilities that do not fit the above categories, see below for more information | The contents of the [util](src/main/java/com/falsepattern/lib/util) package so far: @@ -28,6 +28,4 @@ See the [@StableAPI](src/main/java/com/falsepattern/lib/StableAPI.java) annotati API stability. The update checker module and the library downloader module can be toggled with the `ENABLE_UPDATE_CHECKER` and -`ENABLE_LIBRARY_DOWNLOADS` booleans in the `falsepatternlib.cfg` config file respectively. Note that the update checker -depends on the module downloader to grab [FJson](https://github.com/FalsePattern/FJson), so if it's not already present -on disk, disabling the library loader breaks the update checker. This is only required the first time download, though. +`ENABLE_LIBRARY_DOWNLOADS` booleans in the `falsepatternlib.cfg` config file respectively. diff --git a/build.gradle b/build.gradle index 74849c5..f78365b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1656003793falsepattern59 +//version: 1656003793falsepattern60 /* DO NOT CHANGE THIS FILE! @@ -282,9 +282,13 @@ if(file("addon.gradle").exists()) { apply from: 'repositories.gradle' configurations { - implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored - implementation.extendsFrom(shadowCompile) - implementation.extendsFrom(shadeCompile) + for (config in [shadowImplementation, shadowCompile, shadeCompile]) { + implementation.extendsFrom(shadeCompile) + compileClasspath.extendsFrom(config) + runtimeClasspath.extendsFrom(config) + testCompileClasspath.extendsFrom(config) + testRuntimeClasspath.extendsFrom(config) + } } repositories { @@ -314,6 +318,8 @@ dependencies { compile("org.spongepowered:mixin:0.8.5-gasstation_7") compile("com.llamalad7:MixinExtras:0.1.1-gasstation") compile("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev") + runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') } else if(hasMixinDeps.toBoolean()) { runtime("com.llamalad7:MixinExtras:0.1.1-gasstation") runtime("org.spongepowered:mixin:0.8.5-gasstation_7") @@ -668,8 +674,11 @@ publish.dependsOn(build) publishing { publications { maven(MavenPublication) { + from components.java artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: "" - artifact source: sourcesJar, classifier: "sources" + if (!project.hasProperty("noPublishedSources") || !noPublishedSources) { + artifact source: sourcesJar, classifier: "sources" + } artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev" if (apiPackage) { artifact source: apiJar, classifier: "api" diff --git a/dependencies.gradle b/dependencies.gradle index 7286317..1f2c034 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,12 +1,14 @@ dependencies { + //Dev-only deps compileOnly("org.projectlombok:lombok:1.18.24") { transitive = false } - compileOnly("org.spongepowered:mixin:0.8.3-gasstation") - compileOnly("com.llamalad7:MixinExtras:0.0.12-gasstation") - compileOnly("com.falsepattern:00gasstation-mc1.7.10:0.2.1:dev") - compileOnly("com.falsepattern:json:0.4.1") - compileOnly("org.tukaani:xz:1.9") - testCompile("org.tukaani:xz:1.9") - annotationProcessor("org.projectlombok:lombok:1.18.22") + annotationProcessor("org.projectlombok:lombok:1.18.24") + + compileOnly("org.jetbrains:annotations:23.1.0") + + //Mod deps + compileOnly("org.spongepowered:mixin:0.8.5-gasstation_7") + compileOnly("com.llamalad7:MixinExtras:0.1.1-gasstation") + compileOnly("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev") } diff --git a/gradle.properties b/gradle.properties index 09a56bd..2ad5b02 100644 --- a/gradle.properties +++ b/gradle.properties @@ -187,7 +187,7 @@ containsMixinsAndOrCoreModOnly = false # If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. -usesShadowedDependencies = false +usesShadowedDependencies = true # If enabled, class stubbing will be enabled. In this mode, all classes with a package named "stubpackage" in their # path will be removed, and all classes that refer to said classes will be modified so that the "stubpackage" will map diff --git a/repositories.gradle b/repositories.gradle index 3d5cf5e..d6151d0 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -11,4 +11,8 @@ repositories { name = "mvnpattern" url = "https://mvn.falsepattern.com/releases/" } + maven { + name = "repsy_ventooth" + url = "https://repo.repsy.io/mvn/ventooth/public/" + } } diff --git a/src/main/java/com/falsepattern/lib/DeprecationDetails.java b/src/main/java/com/falsepattern/lib/DeprecationDetails.java index 8ff8c82..32589d4 100644 --- a/src/main/java/com/falsepattern/lib/DeprecationDetails.java +++ b/src/main/java/com/falsepattern/lib/DeprecationDetails.java @@ -34,4 +34,5 @@ import java.lang.annotation.RetentionPolicy; @StableAPI(since = "0.10.0") public @interface DeprecationDetails { @StableAPI.Expose String deprecatedSince(); + @StableAPI.Expose(since = "0.11.0") String replacement() default ""; } diff --git a/src/main/java/com/falsepattern/lib/dependencies/ComplexVersion.java b/src/main/java/com/falsepattern/lib/dependencies/ComplexVersion.java index 59bd9cb..a6f0737 100644 --- a/src/main/java/com/falsepattern/lib/dependencies/ComplexVersion.java +++ b/src/main/java/com/falsepattern/lib/dependencies/ComplexVersion.java @@ -56,7 +56,7 @@ public class ComplexVersion extends Version { } } else if (o instanceof SemanticVersion) { val other = (SemanticVersion) o; - val result = other.compareTo(versions[0]); + val result = versions[0].compareTo(other); if (result != 0) { return result; } diff --git a/src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java b/src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java index ed3e50c..40f9d16 100644 --- a/src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java +++ b/src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java @@ -28,6 +28,13 @@ import lombok.NonNull; import java.util.concurrent.CompletableFuture; +/** + * DEPRECATED. See the DEPENDENCIES.MD files in the root of the resources for more information. + *
+ * This class will stay here for legacy compatibility
+ */
+@Deprecated
+@DeprecationDetails(deprecatedSince = "0.11.0")
@StableAPI(since = "0.6.0")
public class DependencyLoader {
@@ -64,8 +71,9 @@ public class DependencyLoader {
return new VoidBuilder();
}
- @StableAPI(since = "0.6.0")
+ @Deprecated
@DeprecationDetails(deprecatedSince = "0.10.0")
+ @StableAPI(since = "0.6.0")
public static class VoidBuilder {
private String loadingModId;
private String groupId;
diff --git a/src/main/java/com/falsepattern/lib/dependencies/Library.java b/src/main/java/com/falsepattern/lib/dependencies/Library.java
index 89f6b21..3fbe3fa 100644
--- a/src/main/java/com/falsepattern/lib/dependencies/Library.java
+++ b/src/main/java/com/falsepattern/lib/dependencies/Library.java
@@ -21,9 +21,12 @@
package com.falsepattern.lib.dependencies;
+import com.falsepattern.lib.DeprecationDetails;
import com.falsepattern.lib.StableAPI;
import lombok.NonNull;
+@Deprecated
+@DeprecationDetails(deprecatedSince = "0.11.0")
@StableAPI(since = "0.10.0")
public class Library {
@StableAPI.Expose
diff --git a/src/main/java/com/falsepattern/lib/dependencies/RawVersion.java b/src/main/java/com/falsepattern/lib/dependencies/RawVersion.java
new file mode 100644
index 0000000..e3447f5
--- /dev/null
+++ b/src/main/java/com/falsepattern/lib/dependencies/RawVersion.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2022 FalsePattern
+ * All Rights Reserved
+ *
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see