diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle b/build.gradle index 50a26d4..8adc53e 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id "com.github.johnrengelman.shadow" version "7.1.2" id "java-library" id "maven-publish" + id "me.modmuss50.mod-publish-plugin" version "0.5.2" } int javaVersion = Integer.parseInt(project.java_version) @@ -10,14 +11,6 @@ int javaVersion = Integer.parseInt(project.java_version) sourceCompatibility = javaVersion targetCompatibility = javaVersion -loom { - runs { - client { - vmArgs "-Dfabric-tag-conventions-v1.legacyTagWarning=DEV_VERBOSE -Dfabric-tag-conventions-v2.missingTagTranslationWarning=VERBOSE" - } - } -} - repositories { maven { url = "https://maven.gegy.dev/" } maven { url = "https://maven.terraformersmc.com/releases/" } @@ -52,6 +45,45 @@ dependencies { modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}") } +publishMods { + displayName = "bodacious berries ${project.version}" + file = remapJar.archiveFile + changelog = rootProject.file("CHANGELOG.md").getText() + type = STABLE + + modLoaders.add("quilt") + modLoaders.add("fabric") + + dryRun = !providers.environmentVariable("MODRINTH_TOKEN").isPresent() + || !providers.environmentVariable("CURSEFORGE_TOKEN").isPresent() + || property("pub.should_publish") == "false" + dryRun = false + + var mcVersions = [project.minecraft_version] + mcVersions.addAll(property("pub.additional_versions").toString().split(" ").findAll { !it.empty }) + + modrinth { + projectId = "KEFyvbuH" + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + mcVersions.forEach(minecraftVersions::add) + + requires("fabric-api") + optional("modmenu") + } + + curseforge { + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + projectId = "576755" + mcVersions.forEach(minecraftVersions::add) + + clientRequired = true + serverRequired = true + + requires("fabric-api") + optional("modmenu") + } +} + tasks.withType(JavaCompile).configureEach { it.options.encoding = 'UTF-8' it.options.deprecation(true) diff --git a/gradle.properties b/gradle.properties index ce14f85..bc2c0b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,4 +19,8 @@ emi_version=1.1.10+1.21 mod_menu_version=11.0.1 # other dependencies -night_config_version=3.8.1 \ No newline at end of file +night_config_version=3.8.1 + +# publishing +pub.should_publish = true +pub.additional_versions = 1.21 \ No newline at end of file