plugins { id "java" id "eclipse" id "maven-publish" } sourceCompatibility = targetCompatibility = 1.8 compileJava { sourceCompatibility = targetCompatibility = 1.8 } version = "${fw_version}${-> getVersionSuffix()}" group = "io.github.zekerzhayard" archivesBaseName = rootProject.name configurations { provided { implementation.extendsFrom provided } multirelase { implementation.extendsFrom multirelase } } repositories { mavenCentral() maven { name = "forge" url = "https://maven.minecraftforge.net/" } } dependencies { compileOnly "com.google.code.gson:gson:2.8.7" compileOnly "cpw.mods:modlauncher:8.0.9" compileOnly "net.minecraftforge:installer:2.2.7" compileOnly "net.sf.jopt-simple:jopt-simple:5.0.4" provided project(":common") provided project(":legacy") multirelase project(":jigsaw") } java { withSourcesJar() } jar { manifest.attributes([ "Specification-Title": "${project.name}", "Specification-Vendor": "ZekerZhayard", "Specification-Version": "${project.version}".split("-")[0], "Implementation-Title": "${project.name}", "Implementation-Version": "${project.version}", "Implementation-Vendor" :"ZekerZhayard", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "Automatic-Module-Name": "${project.group}.${project.archivesBaseName}".toString().toLowerCase(), "Multi-Release": "true", "GitCommit": String.valueOf(System.getenv("GITHUB_SHA")) ]) from configurations.provided.files.collect { zipTree(it) } into "META-INF/versions/9", { from configurations.multirelase.files.collect { zipTree(it) } exclude "META-INF/**" } } publishing { publications { maven(MavenPublication) { groupId "${project.group}" artifactId "${project.archivesBaseName}" version "${project.version}" from components.java } } repositories { maven { url = layout.buildDirectory.dir("maven") } } } tasks.publish.dependsOn build static String getVersionSuffix() { return "" }