diff options
author | nea <romangraef@gmail.com> | 2022-07-29 20:51:53 +0200 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-07-29 20:51:53 +0200 |
commit | f4bf70032a45b4daa7805ca38f2d820645dc9a6b (patch) | |
tree | dc91fa8e13b78ac9a7fcda24a26894e430f7fc84 | |
parent | 386ee78026801bf50d9cba24de541ed087f145d6 (diff) | |
download | Firmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.tar.gz Firmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.tar.bz2 Firmament-f4bf70032a45b4daa7805ca38f2d820645dc9a6b.zip |
no arch
-rw-r--r-- | build.gradle.kts | 140 | ||||
-rw-r--r-- | common/build.gradle.kts | 36 | ||||
-rw-r--r-- | common/src/main/resources/architectury.common.json | 3 | ||||
-rw-r--r-- | fabric/build.gradle.kts | 113 | ||||
-rw-r--r-- | fabric/src/main/kotlin/moe/nea/notenoughupdates/FabricMain.kt | 10 | ||||
-rw-r--r-- | fabric/src/main/resources/notenoughupdates.mixins.json | 12 | ||||
-rw-r--r-- | gradle.properties | 4 | ||||
-rw-r--r-- | settings.gradle.kts | 3 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt) | 11 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt) | 0 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt) | 0 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt) | 0 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt | 17 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt) | 0 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt (renamed from common/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt) | 0 | ||||
-rw-r--r-- | src/main/resources/fabric.mod.json (renamed from fabric/src/main/resources/fabric.mod.json) | 24 | ||||
-rw-r--r-- | src/main/resources/notenoughupdates.accesswidener (renamed from common/src/main/resources/notenoughupdates.accesswidener) | 0 | ||||
-rw-r--r-- | src/main/resources/notenoughupdates.mixins.json (renamed from common/src/main/resources/notenoughupdates-common.mixins.json) | 2 |
18 files changed, 110 insertions, 265 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 162f269..21a5cda 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,84 +1,92 @@ -import net.fabricmc.loom.api.LoomGradleExtensionAPI import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { java - `kotlin-dsl` - id("architectury-plugin") version "3.4-SNAPSHOT" - id("dev.architectury.loom") version "0.12.0.+" apply false + `maven-publish` + kotlin("jvm") version "1.7.10" + id("dev.architectury.loom") version "0.12.0.+" + id("com.github.johnrengelman.plugin-shadow") version "2.0.3" } -architectury { - minecraft = rootProject.property("minecraft_version").toString() +loom { + accessWidenerPath.set(project.file("src/main/resources/notenoughupdates.accesswidener")) + launches { + removeIf { it.name != "client" } + named("client") { + property("fabric.log.level", "info") + } + } +} + +repositories { + maven("https://maven.terraformersmc.com/releases/") + maven("https://maven.shedaniel.me") + maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") + maven("https://api.modrinth.com/maven") { + content { + includeGroup("maven.modrinth") + } + } + mavenLocal() } -subprojects { - apply(plugin = "dev.architectury.loom") +val shadowMe by configurations.creating { + configurations.implementation.get().extendsFrom(this) +} - val loom = project.extensions.getByName<LoomGradleExtensionAPI>("loom") +dependencies { + // Minecraft dependencies + "minecraft"("com.mojang:minecraft:${project.property("minecraft_version")}") + "mappings"(loom.officialMojangMappings()) + // Fabric dependencies + modImplementation("net.fabricmc:fabric-loader:${project.property("fabric_loader_version")}") + modApi("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_api_version")}") + modImplementation("net.fabricmc:fabric-language-kotlin:1.8.2+kotlin.1.7.10") + + // Actual dependencies + modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.property("rei_version")}") + shadowMe("io.github.moulberry:neurepoparser:0.0.1") + + // Dev environment preinstalled mods + modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.property("rei_version")}") + modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:${project.property("devauth_version")}") + modRuntimeOnly("maven.modrinth:modmenu:${project.property("modmenu_version")}") - dependencies { - "minecraft"("com.mojang:minecraft:${project.property("minecraft_version")}") - // The following line declares the mojmap mappings, you may use other mappings as well - "mappings"( - loom.officialMojangMappings() - ) - // The following line declares the yarn mappings you may select this one as well. - // "mappings"("net.fabricmc:yarn:1.18.2+build.3:v2") - } } -allprojects { - apply(plugin = "java") - apply(plugin = "architectury-plugin") - apply(plugin = "maven-publish") - apply(plugin = "org.jetbrains.kotlin.jvm") - - base.archivesName.set(rootProject.property("archives_base_name").toString()) - //base.archivesBaseName = rootProject.property("archives_base_name").toString() - version = rootProject.property("mod_version").toString() - group = rootProject.property("maven_group").toString() - - repositories { - // Add repositories to retrieve artifacts from in here. - // You should only use this when depending on other mods because - // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. - // See https://docs.gradle.org/current/userguide/declaring_repositories.html - // for more information about repositories. - maven("https://maven.terraformersmc.com/releases/") - maven("https://maven.shedaniel.me") - maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") - maven("https://api.modrinth.com/maven") { - content { - includeGroup("maven.modrinth") - } - } - mavenLocal() - } - dependencies { - "compileClasspath"("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") - implementation("io.github.moulberry:neurepoparser:0.0.1") - } +version = rootProject.property("mod_version").toString() +group = rootProject.property("maven_group").toString() - tasks.withType<JavaCompile> { - options.encoding = "UTF-8" - options.release.set(17) - } +tasks.withType<JavaCompile> { + options.encoding = "UTF-8" + options.release.set(17) +} - java { - withSourcesJar() - toolchain.languageVersion.set(JavaLanguageVersion.of(17)) - } +java { + withSourcesJar() + toolchain.languageVersion.set(JavaLanguageVersion.of(17)) +} - // could not set to 17, up to 16 - val compileKotlin: KotlinCompile by tasks - compileKotlin.kotlinOptions { - jvmTarget = "16" - } - val compileTestKotlin: KotlinCompile by tasks - compileTestKotlin.kotlinOptions { - jvmTarget = "16" - } +// could not set to 17, up to 16 +val compileKotlin: KotlinCompile by tasks +compileKotlin.kotlinOptions { + jvmTarget = "16" +} +val compileTestKotlin: KotlinCompile by tasks +compileTestKotlin.kotlinOptions { + jvmTarget = "16" +} + +tasks.shadowJar { + configurations = listOf(shadowMe) + archiveClassifier.set("dev-thicc") +} + +tasks.remapJar { + injectAccessWidener.set(true) + inputFile.set(tasks.shadowJar.flatMap { it.archiveFile }) + dependsOn(tasks.shadowJar) + archiveClassifier.set("thicc") } diff --git a/common/build.gradle.kts b/common/build.gradle.kts deleted file mode 100644 index 17146d0..0000000 --- a/common/build.gradle.kts +++ /dev/null @@ -1,36 +0,0 @@ -plugins { - `maven-publish` -} - -architectury { - val enabled_platforms: String by rootProject - common(enabled_platforms.split(",")) -} - -loom { - accessWidenerPath.set(file("src/main/resources/notenoughupdates.accesswidener")) -} - -dependencies { - // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies - // Do NOT use other classes from fabric loader - modImplementation("net.fabricmc:fabric-loader:${rootProject.property("fabric_loader_version")}") - // Remove the next line if you don't want to depend on the API - modApi("dev.architectury:architectury:${rootProject.property("architectury_version")}") - modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:${rootProject.property("rei_version")}") - implementation(kotlin("stdlib-jdk8")) -} - -publishing { - publications { - create<MavenPublication>("maven") { - artifactId = rootProject.property("archives_base_name").toString() - from(components.getByName("java")) - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } -} diff --git a/common/src/main/resources/architectury.common.json b/common/src/main/resources/architectury.common.json deleted file mode 100644 index 017e6cd..0000000 --- a/common/src/main/resources/architectury.common.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "accessWidener": "notenoughupdates.accesswidener" -} diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts deleted file mode 100644 index 1e39832..0000000 --- a/fabric/build.gradle.kts +++ /dev/null @@ -1,113 +0,0 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" -} - -architectury { - platformSetupLoomIde() - fabric() -} - -loom { - accessWidenerPath.set(project(":common").loom.accessWidenerPath) - launches { - named("client") { - property("fabric.log.level", "info") - } - } -} - -/** - * @see: https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html - * */ -val common: Configuration by configurations.creating -val shadowCommon: Configuration by configurations.creating // Don't use shadow from the shadow plugin because we don't want IDEA to index this. -val developmentFabric: Configuration = configurations.getByName("developmentFabric") -configurations { - compileClasspath.get().extendsFrom(configurations["common"]) - runtimeClasspath.get().extendsFrom(configurations["common"]) - developmentFabric.extendsFrom(configurations["common"]) -} - -dependencies { - modImplementation("net.fabricmc:fabric-loader:${rootProject.property("fabric_loader_version")}") - modApi("net.fabricmc.fabric-api:fabric-api:${rootProject.property("fabric_api_version")}") - // Remove the next line if you don't want to depend on the API - modApi("dev.architectury:architectury-fabric:${rootProject.property("architectury_version")}") - - common(project(":common", configuration = "namedElements")) { isTransitive = false } - shadowCommon(project(":common", configuration = "transformProductionFabric")) { isTransitive = false } - common(kotlin("stdlib-jdk8")) - modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:${rootProject.property("rei_version")}") - modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:${rootProject.property("devauth_version")}") - modRuntimeOnly("maven.modrinth:modmenu:${rootProject.property("modmenu_version")}") -} - -val javaComponent = components.getByName("java", AdhocComponentWithVariants::class) -javaComponent.withVariantsFromConfiguration(configurations["sourcesElements"]) { - skip() -} - -tasks { - processResources { - inputs.property("version", project.version) - - filesMatching("fabric.mod.json") { - expand("version" to project.version) - } - } - - shadowJar { - exclude("architectury.common.json") - /** - * magic! - * groovy -> kotlin dsl - * [project.configurations.shadowCommon] -> listOf(project.configurations["shadowCommon"]) - * */ - configurations = listOf(project.configurations["shadowCommon"]) - archiveClassifier.set("dev-shadow") - } - - remapJar { - injectAccessWidener.set(true) - /** - * magic! - * groovy -> kotlin dsl - * shadowJar.archiveFile -> shadowJar.flatMap { it.archiveFile } - * */ - inputFile.set(shadowJar.flatMap { it.archiveFile }) - dependsOn(shadowJar) - /** - * affect suffix of build jar name - * if { archiveClassifier.set("fabric") } - * name will be examplemod-1.0.0-fabric.jar - */ - archiveClassifier.set("fabric") - } - - jar { - archiveClassifier.set("dev") - } - - sourcesJar { - val commonSources = project(":common").tasks.getByName("sourcesJar", Jar::class) - dependsOn(commonSources) - from(commonSources.archiveFile.map { zipTree(it) }) - } - - - - publishing { - publications { - create<MavenPublication>("mavenFabric") { - artifactId = "${rootProject.property("archives_base_name")}-${project.name}" - from(javaComponent) - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } - } -} - diff --git a/fabric/src/main/kotlin/moe/nea/notenoughupdates/FabricMain.kt b/fabric/src/main/kotlin/moe/nea/notenoughupdates/FabricMain.kt deleted file mode 100644 index 918100b..0000000 --- a/fabric/src/main/kotlin/moe/nea/notenoughupdates/FabricMain.kt +++ /dev/null @@ -1,10 +0,0 @@ -package moe.nea.notenoughupdates - -import moe.nea.notenoughupdates.NotEnoughUpdates.init -import net.fabricmc.api.ModInitializer - -class FabricMain : ModInitializer { - override fun onInitialize() { - init() - } -} diff --git a/fabric/src/main/resources/notenoughupdates.mixins.json b/fabric/src/main/resources/notenoughupdates.mixins.json deleted file mode 100644 index ab40cb1..0000000 --- a/fabric/src/main/resources/notenoughupdates.mixins.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "required": true, - "package": "net.examplemod.mixin.fabric", - "compatibilityLevel": "JAVA_16", - "client": [ - ], - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 - } -}
\ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 73d85fc..8473b3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx4096M minecraft_version=1.19 -enabled_platforms=fabric +loom.platform=fabric archives_base_name=notenoughupdates mod_version=1.0.0 @@ -12,8 +12,6 @@ architectury_version=5.10.33 fabric_loader_version=0.14.8 fabric_api_version=0.58.0+1.19 -kotlin_version=1.7.0-RC - rei_version=9.1.518 devauth_version=1.0.0 modmenu_version=4.0.4 diff --git a/settings.gradle.kts b/settings.gradle.kts index ca29fa8..e2fd19e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,8 +16,5 @@ pluginManagement { } } -include("common") -include("fabric") - rootProject.name = "NotEnoughApdates" diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt b/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt index 3526bc4..79b8819 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt @@ -1,12 +1,11 @@ package moe.nea.notenoughupdates -import dev.architectury.registry.registries.Registries import io.github.moulberry.repo.NEURepository +import net.fabricmc.api.ModInitializer import java.nio.file.Path -import java.util.logging.Logger -object NotEnoughUpdates { - val REGISTRIES by lazy { Registries.get(MOD_ID) } +object NotEnoughUpdates : ModInitializer { + val DATA_DIR = Path.of(".notenoughupdates") const val MOD_ID = "notenoughupdates" @@ -14,8 +13,6 @@ object NotEnoughUpdates { it.reload() } - - fun init() { - + override fun onInitialize() { } } diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt index cc4b0f1..cc4b0f1 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt index 6726b4f..6726b4f 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt b/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt index aa93fec..aa93fec 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt diff --git a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt b/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt new file mode 100644 index 0000000..47b2878 --- /dev/null +++ b/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt @@ -0,0 +1,17 @@ +package moe.nea.notenoughupdates.repo + +import moe.nea.notenoughupdates.NotEnoughUpdates + +object RepoDownloadManager { + + val repoSavedLocation = NotEnoughUpdates.DATA_DIR.resolve("repo-extracted") + val repoMetadataLocation = NotEnoughUpdates.DATA_DIR.resolve("loaded-repo.json") + + data class RepoMetadata( + var latestCommit: String, + var user: String, + var repository: String, + var branch: String, + ) + +} diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt index d5b8881..d5b8881 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt index a4ec7e1..a4ec7e1 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt diff --git a/fabric/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3ff8349..c739445 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -5,30 +5,32 @@ "name": "Not Enough Updates", "description": "Not Enough Updates - A mod for Hypixel Skyblock", "authors": [ - "nea89" + "nea89" ], "contact": { - "homepage": "https://github.com/romangraef/TODO", - "sources": "https://github.com/romangraef/TODO" + "homepage": "https://github.com/romangraef/TODO", + "sources": "https://github.com/romangraef/TODO" }, "license": "LGPL-3.0", "icon": "assets/notenoughupdates/icon.png", "environment": "client", "entrypoints": { - "main": [ - "moe.nea.notenoughupdates.FabricMain" - ], + "main": [ + { + "adapter": "kotlin", + "value": "moe.nea.notenoughupdates.NotEnoughUpdates" + } + ], "rei": [ "moe.nea.notenoughupdates.rei.NEUReiPlugin" ] }, "mixins": [ - "notenoughupdates.mixins.json", - "notenoughupdates-common.mixins.json" + "notenoughupdates.mixins.json" ], "depends": { - "fabric": "*", - "minecraft": ">=1.18.2", - "architectury": ">=4.2.50" + "fabric": "*", + "fabric-language-kotlin": ">=1.8.2+kotlin.1.7.10", + "minecraft": ">=1.18.2" } } diff --git a/common/src/main/resources/notenoughupdates.accesswidener b/src/main/resources/notenoughupdates.accesswidener index 236e6b1..236e6b1 100644 --- a/common/src/main/resources/notenoughupdates.accesswidener +++ b/src/main/resources/notenoughupdates.accesswidener diff --git a/common/src/main/resources/notenoughupdates-common.mixins.json b/src/main/resources/notenoughupdates.mixins.json index e83444e..3067bcc 100644 --- a/common/src/main/resources/notenoughupdates-common.mixins.json +++ b/src/main/resources/notenoughupdates.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "net.examplemod.mixin", + "package": "moe.nea.notenoughupdates.mixins", "compatibilityLevel": "JAVA_16", "client": [ ], |