diff --git a/build.gradle b/build.gradle index c1d5f514..b4c665b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,11 @@ +plugins { + id 'fabric-loom' version '1.2-SNAPSHOT' apply(false) + id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply(false) + id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply(false) + id 'net.darkhax.curseforgegradle' version '1.0.14' apply(false) + id "com.modrinth.minotaur" version "2.+" apply(false) +} + subprojects { apply plugin: 'java' @@ -5,16 +13,6 @@ subprojects { java.withSourcesJar() java.withJavadocJar() - tasks.withType(GenerateModuleMetadata).tap { - configureEach { - enabled = false // Do not publish dependencies in pom - } - } - - configurations { - testImplementation.extendsFrom compileOnly - } - jar { manifest { attributes([ @@ -23,14 +21,14 @@ subprojects { "Specification-Version" : "1", "Implementation-Title" : project.name, "Implementation-Version" : project.jar.archiveVersion, - "Implementation-Vendor" : "BlayTheNinth", - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + "Implementation-Vendor" : "BlayTheNinth" ]) - if (forge_mixins.toBoolean()) { - attributes([ - "MixinConfigs": mod_id + ".mixins.json" - ]) - } + } + } + + sourcesJar { + from(rootProject.file("LICENSE")) { + rename { "${it}_${mod_id}" } } } @@ -62,12 +60,42 @@ subprojects { tasks.withType(JavaCompile).configureEach { it.options.encoding = 'UTF-8' - it.options.release = java_version as int + it.options.getRelease().set(java_version.toInteger()) + } + + tasks.withType(Javadoc).configureEach { + failOnError false } - tasks.withType(Javadoc).tap { - configureEach { - failOnError false + processResources { + def expandProps = [ + "version": version, + "group": project.group, //Else we target the task's group. + "minecraft_version": minecraft_version, + "forge_version": forge_version, + "forge_loader_version_range": forge_loader_version_range, + "forge_version_range": forge_version_range, + "minecraft_version_range": minecraft_version_range, + "fabric_version": fabric_version, + "fabric_loader_version": fabric_loader_version, + "mod_name": mod_name, + "mod_id": mod_id, + "license": license, + "description": project.description, + "neoforge_version": neoforge_version, + "neoforge_loader_version_range": neoforge_loader_version_range + ] + + filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { + expand expandProps } + inputs.properties(expandProps) + } + + // Disables Gradle's custom module metadata from being published to maven. The + // metadata includes mapped dependencies which are not reasonably consumable by + // other mod developers. + tasks.withType(GenerateModuleMetadata).configureEach { + enabled = false } } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index bed866cb..3c5076f2 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,14 +1,14 @@ plugins { - id 'fabric-loom' version '1.2-SNAPSHOT' + id 'fabric-loom' id 'maven-publish' id 'idea' - id 'net.darkhax.curseforgegradle' version '1.0.14' - id "com.modrinth.minotaur" version "2.+" + id 'net.darkhax.curseforgegradle' + id "com.modrinth.minotaur" } -group = mod_group -archivesBaseName = "${mod_id}-fabric-${minecraft_version}" -version = mod_version +base { + archivesName = "${mod_id}-fabric-${minecraft_version}" +} dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" @@ -16,20 +16,24 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" + implementation project(":shared") implementation project(":shared-bridge") compileOnly "org.jetbrains:annotations:22.0.0" - - modCompileOnly "mezz.jei:jei-$jei_minecraft_version-fabric-api:$jei_version" - if (jei_minecraft_version == minecraft_version) { - modRuntimeOnly "mezz.jei:jei-$jei_minecraft_version-fabric:$jei_version" - } } apply from: 'dependencies.gradle' loom { + if (project(":shared").file("src/main/resources/${mod_id}.accesswidener").exists()) { + accessWidenerPath.set(project(":shared").file("src/main/resources/${mod_id}.accesswidener")) + } + + mixin { + defaultRefmapName.set("${mod_id}.refmap.json") + } + runs { client { client() @@ -56,32 +60,23 @@ loom { } } -sourceSets { - main { - resources { - srcDirs 'src/generated/resources' - } - } -} - -processResources { - from project(":shared").sourceSets.main.resources - inputs.property "version", project.version - - filesMatching("fabric.mod.json") { - expand "version": project.version - } -} +sourceSets.main.resources.srcDir('src/generated/resources') -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { source(project(":shared").sourceSets.main.allSource) source(project(":shared-bridge").sourceSets.main.allSource) } +tasks.withType(Javadoc).configureEach { + source(project(":shared").sourceSets.main.allJava) + source(project(":shared-bridge").sourceSets.main.allJava) +} +tasks.named("sourcesJar", Jar) { + from(project(":shared").sourceSets.main.allSource) + from(project(":shared-bridge").sourceSets.main.allSource) +} -jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_id}" } - } +processResources { + from project(":shared").sourceSets.main.resources } publishing { diff --git a/fabric/dependencies.gradle b/fabric/dependencies.gradle index e424a462..8b8582e2 100644 --- a/fabric/dependencies.gradle +++ b/fabric/dependencies.gradle @@ -8,6 +8,11 @@ repositories { } dependencies { + modCompileOnly "mezz.jei:jei-$jei_minecraft_version-fabric-api:$jei_version" + if (jei_minecraft_version == minecraft_version) { + modRuntimeOnly "mezz.jei:jei-$jei_minecraft_version-fabric:$jei_version" + } + modCompileOnly "me.shedaniel.cloth:cloth-config-fabric:11.0.99" modCompileOnly "com.terraformersmc:modmenu:$modmenu_version" diff --git a/fabric/src/main/resources/balm.mixins.json b/fabric/src/main/resources/balm.fabric.mixins.json similarity index 97% rename from fabric/src/main/resources/balm.mixins.json rename to fabric/src/main/resources/balm.fabric.mixins.json index e67d76e8..2c3d479c 100644 --- a/fabric/src/main/resources/balm.mixins.json +++ b/fabric/src/main/resources/balm.fabric.mixins.json @@ -2,6 +2,7 @@ "required": true, "minVersion": "0.8", "package": "net.blay09.mods.balm.mixin", + "refmap": "${mod_id}.refmap.json", "compatibilityLevel": "JAVA_17", "mixins": [ "ChunkMapMixin", diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index b3ceaf35..26b1fb98 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -3,8 +3,8 @@ "id": "balm-fabric", "version": "${version}", - "name": "Balm", - "description": "Abstraction Layer (but not really)™ for Blay's multiplatform mods", + "name": "${mod_name}", + "description": "${description}", "authors": [ "BlayTheNinth" ], @@ -14,8 +14,8 @@ "issues": "https://github.com/TwelveIterationMods/Balm/issues" }, - "license": "All Rights Reserved", - "icon": "balm-icon.png", + "license": "${license}", + "icon": "${mod_id}.png", "environment": "*", "entrypoints": { @@ -30,11 +30,12 @@ ] }, "mixins": [ - "balm.mixins.json" + "${mod_id}.mixins.json", + "${mod_id}.fabric.mixins.json" ], "depends": { - "fabricloader": ">=0.14.21", + "fabricloader": ">=0.14", "fabric-api": "*", "minecraft": ">=1.20.2", "java": ">=17" diff --git a/forge/build.gradle b/forge/build.gradle index e07b1746..f22d7e0c 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,56 +1,48 @@ -buildscript { - repositories { - maven { url = "https://repo.spongepowered.org/maven" } - mavenCentral() - } - dependencies { - classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' - } -} - plugins { - id 'net.minecraftforge.gradle' version '[6.0,6.2)' - id 'maven-publish' id 'idea' - id 'net.darkhax.curseforgegradle' version '1.0.14' - id "com.modrinth.minotaur" version "2.+" + id 'maven-publish' + id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id 'org.spongepowered.mixin' + id 'net.darkhax.curseforgegradle' + id "com.modrinth.minotaur" +} + +base { + archivesName = "${mod_id}-forge-${minecraft_version}" } -apply plugin: "org.spongepowered.mixin" +mixin { + add(sourceSets.main, "${mod_id}.refmap.json") -group = mod_group -archivesBaseName = "${mod_id}-forge-${minecraft_version}" -version = mod_version + config("${mod_id}.mixins.json") + config("${mod_id}.forge.mixins.json") +} minecraft { mappings channel: 'official', version: minecraft_version copyIdeResources = true + // Automatically enable forge AccessTransformers if the file exists + // This location is hardcoded in Forge and can not be changed. + // https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 + if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + } + runs { client { workingDirectory project.file('run') ideaModule "${rootProject.name}.${project.name}.main" taskName "Client" - if (forge_mixins.toBoolean()) { - arg "-mixin.config=${mod_id}.mixins.json" - } - - property "mixin.env.disableRefMap", "true" - property "mixin.debug.export", "true" - property "mixin.debug.export.decompile", "false" - property "mixin.debug.verbose", "true" - property "mixin.debug.dumpTargetOnFailure", "true" - property "mixin.checks", "true" - property "mixin.hotSwap", "true" - - property 'forge.logging.console.level', 'debug' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" property 'forge.enabledGameTestNamespaces', mod_id mods { - "${mod_id}" { + modClientRun { source sourceSets.main source project(":shared").sourceSets.main } @@ -62,24 +54,13 @@ minecraft { ideaModule "${rootProject.name}.${project.name}.main" taskName "Server" - if (forge_mixins.toBoolean()) { - arg "-mixin.config=${mod_id}.mixins.json" - } - - property "mixin.env.disableRefMap", "true" - property "mixin.debug.export", "true" - property "mixin.debug.export.decompile", "false" - property "mixin.debug.verbose", "true" - property "mixin.debug.dumpTargetOnFailure", "true" - property "mixin.checks", "true" - property "mixin.hotSwap", "true" - - property 'forge.logging.console.level', 'debug' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" property 'forge.enabledGameTestNamespaces', mod_id mods { - "${mod_id}" { + modServerRun { source sourceSets.main source project(":shared").sourceSets.main } @@ -91,24 +72,13 @@ minecraft { ideaModule "${rootProject.name}.${project.name}.main" taskName "GameTest" - if (forge_mixins.toBoolean()) { - arg "-mixin.config=${mod_id}.mixins.json" - } - - property "mixin.env.disableRefMap", "true" - property "mixin.debug.export", "true" - property "mixin.debug.export.decompile", "false" - property "mixin.debug.verbose", "true" - property "mixin.debug.dumpTargetOnFailure", "true" - property "mixin.checks", "true" - property "mixin.hotSwap", "true" - - property 'forge.logging.console.level', 'debug' + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" property 'forge.enabledGameTestNamespaces', mod_id mods { - "${mod_id}" { + modGameTestRun { source sourceSets.main source project(":shared").sourceSets.main } @@ -118,26 +88,14 @@ minecraft { data { workingDirectory project.file('run') ideaModule "${rootProject.name}.${project.name}.main" + args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') taskName "Data" - property 'forge.logging.console.level', 'debug' - - if (forge_mixins.toBoolean()) { - arg "-mixin.config=${mod_id}.mixins.json" - } - - property "mixin.env.disableRefMap", "true" - property "mixin.debug.export", "true" - property "mixin.debug.export.decompile", "false" - property "mixin.debug.verbose", "true" - property "mixin.debug.dumpTargetOnFailure", "true" - property "mixin.checks", "true" - property "mixin.hotSwap", "true" - - args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" mods { - "${mod_id}" { + modDataRun { source sourceSets.main source project(":shared").sourceSets.main } @@ -146,56 +104,30 @@ minecraft { } } -sourceSets { - main { - resources { - srcDirs 'src/generated/resources' - } - ext.refMap = "${mod_id}.refmap.json" - } -} +sourceSets.main.resources.srcDir 'src/generated/resources' dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" - annotationProcessor 'org.spongepowered:mixin:0.8.4:processor' + annotationProcessor 'org.spongepowered:mixin:0.8.5-SNAPSHOT:processor' compileOnly project(":shared") compileOnly "org.jetbrains:annotations:22.0.0" - - compileOnly fg.deobf("mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version") - if (jei_minecraft_version == minecraft_version) { - runtimeOnly fg.deobf("mezz.jei:jei-$jei_minecraft_version-forge:$jei_version") - } } apply from: 'dependencies.gradle' -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { source(project(":shared").sourceSets.main.allSource) } +tasks.withType(Javadoc).configureEach { + source(project(":shared").sourceSets.main.allJava) +} +tasks.named("sourcesJar", Jar) { + from(project(":shared").sourceSets.main.allSource) +} -def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta'] -def replaceProperties = [ - minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, - forge_version: forge_version, forge_version_range: forge_version_range, - forge_loader_version_range: forge_loader_version_range, - mod_id: mod_id, mod_version: mod_version -] processResources { from project(":shared").sourceSets.main.resources - - inputs.properties replaceProperties - replaceProperties.put 'project', project - - filesMatching(resourceTargets) { - expand replaceProperties - } -} - -jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_id}" } - } } jar.finalizedBy('reobfJar') @@ -206,7 +138,8 @@ publishing { artifactId = mod_id + "-forge" version = project.version + (!project.version.endsWith("SNAPSHOT") ? "+" + minecraft_version : "") - artifact jar + from components.java + fg.component(it) } } @@ -220,7 +153,7 @@ publishing { } } } - +3 task curseforge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) { dependsOn('build') description = 'Publishes the Forge build to CurseForge.' diff --git a/forge/dependencies.gradle b/forge/dependencies.gradle index 571b4175..215ff135 100644 --- a/forge/dependencies.gradle +++ b/forge/dependencies.gradle @@ -1,2 +1,6 @@ dependencies { + compileOnly fg.deobf("mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version") + if (jei_minecraft_version == minecraft_version) { + runtimeOnly fg.deobf("mezz.jei:jei-$jei_minecraft_version-forge:$jei_version") + } } \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 6a5f452f..70a81573 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,25 +1,23 @@ modLoader="javafml" loaderVersion="${forge_loader_version_range}" -license="All rights reserved" +license="${license}" issueTrackerURL="https://github.com/TwelveIterationMods/Balm/issues" [[mods]] -modId="balm" -version="${mod_version}" -displayName="Balm" +modId="${mod_id}" +version="${version}" +displayName="${mod_name}" displayURL="https://mods.twelveiterations.com/" -logoFile="balm-icon.png" +logoFile="${mod_id}.png" credits="BlayTheNinth" authors="BlayTheNinth" -description=''' -Abstraction Layer (but not really)™ for Blay's multiplatform mods -''' -[[dependencies.balm]] +description='''${description}''' +[[dependencies.${mod_id}]] modId="forge" mandatory=true versionRange="${forge_version_range}" ordering="NONE" side="BOTH" -[[dependencies.balm]] +[[dependencies.${mod_id}]] modId="minecraft" mandatory=true versionRange="${minecraft_version_range}" diff --git a/neoforge/src/main/resources/balm.mixins.json b/forge/src/main/resources/balm.forge.mixins.json similarity index 94% rename from neoforge/src/main/resources/balm.mixins.json rename to forge/src/main/resources/balm.forge.mixins.json index 8ab01373..7f04ae2e 100644 --- a/neoforge/src/main/resources/balm.mixins.json +++ b/forge/src/main/resources/balm.forge.mixins.json @@ -3,7 +3,7 @@ "minVersion": "0.8", "package": "net.blay09.mods.balm.mixin", "compatibilityLevel": "JAVA_17", - "refmap": "balm.refmap.json", + "refmap": "${mod_id}.refmap.json", "mixins": [ "CropBlockMixin", "StemBlockMixin", diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta deleted file mode 100644 index 7fe5c38e..00000000 --- a/forge/src/main/resources/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "description": "Balm resources", - "pack_format": 15 - } -} diff --git a/gradle.properties b/gradle.properties index d783a3c5..faf16d1a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,10 @@ # Mod mod_id=balm -mod_version = 8.0.1 -mod_group=net.blay09.mods -pack_format_number=18 +mod_name=Balm +description=Abstraction Layer (but not really)? for Blay's multiplatform mods +version = 8.0.1 +group=net.blay09.mods +license=All Rights Reserved # Publishing curseforge_release_type=release @@ -15,10 +17,11 @@ modrinth_project_id=MBAkmtvl minecraft_version = 1.20.2 minecraft_versions = 1.20.2 minecraft_version_range=[1.20.2,1.21) +pack_format_number=18 java_version = 17 # Forge -forge_version = 48.0.1 +forge_version = 48.0.13 forge_version_range=[48,) forge_loader_version_range=[48,) forge_mixins=true @@ -27,8 +30,6 @@ forge_mixins=true neoforge_version = 20.2.47-beta neoforge_version_range=[20.2,) neoforge_loader_version_range=[1,) -mapping_channel=official -mapping_version=1.20.2 # Fabric fabric_version = 0.89.0+1.20.2 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 8b261f7b..592862a9 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -3,23 +3,14 @@ plugins { id 'idea' id 'maven-publish' id 'net.neoforged.gradle.userdev' version '7.0.41' - id 'net.darkhax.curseforgegradle' version '1.0.14' - id "com.modrinth.minotaur" version "2.+" -} - -version = mod_version -group = mod_group - -repositories { - mavenLocal() + id 'net.darkhax.curseforgegradle' + id "com.modrinth.minotaur" } base { archivesName = "${mod_id}-neoforge-${minecraft_version}" } -java.toolchain.languageVersion = JavaLanguageVersion.of(17) - if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg') } @@ -98,31 +89,6 @@ tasks.withType(ProcessResources).excludingNeoTasks().configureEach { from project(":shared").sourceSets.main.resources } -def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta'] -def replaceProperties = [ - minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, - neoforge_version: neoforge_version, neoforge_version_range: neoforge_version_range, - neoforge_loader_version_range: neoforge_loader_version_range, - mod_id: mod_id, mod_version: mod_version -] -tasks.withType(ProcessResources).configureEach { - inputs.properties replaceProperties - - filesMatching(resourceTargets) { - expand replaceProperties - } -} - -jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_id}" } - } -} - -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation -} - publishing { publications { mavenJava(MavenPublication) { diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml index 75678bb0..e7f58a43 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -1,25 +1,23 @@ modLoader="javafml" loaderVersion="${neoforge_loader_version_range}" -license="All rights reserved" +license="${license}" issueTrackerURL="https://github.com/TwelveIterationMods/Balm/issues" [[mods]] -modId="balm" -version="${mod_version}" -displayName="Balm" +modId="${mod_id}" +version="${version}" +displayName="${mod_name}" displayURL="https://mods.twelveiterations.com/" -logoFile="balm-icon.png" +logoFile="${mod_id}.png" credits="BlayTheNinth" authors="BlayTheNinth" -description=''' -Abstraction Layer (but not really)™ for Blay's multiplatform mods -''' -[[dependencies.balm]] +description='''${description}''' +[[dependencies.${mod_id}]] modId="neoforge" mandatory=true versionRange="${neoforge_version_range}" ordering="NONE" side="BOTH" -[[dependencies.balm]] +[[dependencies.${mod_id}]] modId="minecraft" mandatory=true versionRange="${minecraft_version_range}" diff --git a/forge/src/main/resources/balm.mixins.json b/neoforge/src/main/resources/balm.neoforge.mixins.json similarity index 95% rename from forge/src/main/resources/balm.mixins.json rename to neoforge/src/main/resources/balm.neoforge.mixins.json index 8ab01373..c7b6ca5c 100644 --- a/forge/src/main/resources/balm.mixins.json +++ b/neoforge/src/main/resources/balm.neoforge.mixins.json @@ -3,7 +3,6 @@ "minVersion": "0.8", "package": "net.blay09.mods.balm.mixin", "compatibilityLevel": "JAVA_17", - "refmap": "balm.refmap.json", "mixins": [ "CropBlockMixin", "StemBlockMixin", diff --git a/neoforge/src/main/resources/pack.mcmeta b/neoforge/src/main/resources/pack.mcmeta deleted file mode 100644 index 7bcc5b91..00000000 --- a/neoforge/src/main/resources/pack.mcmeta +++ /dev/null @@ -1,8 +0,0 @@ -{ - "pack": { - "description": { - "text": "${mod_id} resources" - }, - "pack_format": ${pack_format_number} - } -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e7d4457e..45128c5b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,7 +24,9 @@ plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' } -include("shared", "shared-bridge") +rootProject.name = 'Balm' +include("shared") +include("shared-bridge") include("fabric") include("forge") include("neoforge") \ No newline at end of file diff --git a/shared-bridge/build.gradle b/shared-bridge/build.gradle index 8694f5fe..6e4bf1b1 100644 --- a/shared-bridge/build.gradle +++ b/shared-bridge/build.gradle @@ -1,10 +1,8 @@ plugins { id('java') - id('org.spongepowered.gradle.vanilla') version '0.2.1-SNAPSHOT' + id('org.spongepowered.gradle.vanilla') } -group = mod_group -version = mod_version archivesBaseName = "${mod_id}-common-${minecraft_version}" minecraft { diff --git a/shared/build.gradle b/shared/build.gradle index 1aa444fa..4de0b851 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -1,23 +1,25 @@ plugins { - id('java') - id('org.spongepowered.gradle.vanilla') version '0.2.1-SNAPSHOT' + id 'idea' + id 'java' + id 'org.spongepowered.gradle.vanilla' id 'maven-publish' } -group = mod_group -version = mod_version -archivesBaseName = "${mod_id}-common-${minecraft_version}" +base { + archivesName = "${mod_id}-common-${minecraft_version}" +} minecraft { version(minecraft_version) + if(file("src/main/resources/${mod_id}.accesswidener").exists()){ + accessWideners(file("src/main/resources/${mod_id}.accesswidener")) + } } dependencies { compileOnly "org.spongepowered:mixin:$mixin_version" compileOnly project(":shared-bridge") - - compileOnly "mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version" } apply from: 'dependencies.gradle' @@ -26,18 +28,6 @@ tasks.withType(JavaCompile).configureEach { source(project(":shared-bridge").sourceSets.main.allSource) } -jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_id}" } - } -} - -sourcesJar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_id}" } - } -} - publishing { publications { mavenJava(MavenPublication) { diff --git a/shared/dependencies.gradle b/shared/dependencies.gradle index 571b4175..f63be1eb 100644 --- a/shared/dependencies.gradle +++ b/shared/dependencies.gradle @@ -1,2 +1,3 @@ dependencies { + compileOnly "mezz.jei:jei-$jei_minecraft_version-common-api:$jei_version" } \ No newline at end of file diff --git a/shared/src/main/resources/balm-icon.png b/shared/src/main/resources/balm.png similarity index 100% rename from shared/src/main/resources/balm-icon.png rename to shared/src/main/resources/balm.png diff --git a/shared/src/main/resources/pack.mcmeta b/shared/src/main/resources/pack.mcmeta new file mode 100644 index 00000000..ad94494c --- /dev/null +++ b/shared/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "${mod_name}", + "pack_format": ${pack_format_number} + } +} \ No newline at end of file