plugins { id 'fabric-loom' version "0.4-SNAPSHOT" id 'maven-publish' id 'maven' id 'signing' id 'com.jfrog.bintray' version '1.8.4' id 'com.matthewprenger.cursegradle' version '1.4.0' id 'java-library' id 'net.corda.plugins.jar-filter' version "5.0.8" apply false } repositories { maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } jcenter() maven { url "https://jitpack.io" } maven { url "https://dl.bintray.com/shedaniel/legacy-yarn-updated" } } sourceCompatibility = targetCompatibility = 1.8 group = "me.shedaniel.cloth" archivesBaseName = "config-2" version = project.mod_version repositories { maven { url "https://dl.bintray.com/shedaniel/shedaniel-mods" } } minecraft { accessWidener = file("src/main/resources/cloth-config.accessWidener") } processResources { filesMatching('fabric.mod.json') { expand 'version': project.version } inputs.property "version", project.version } dependencies { compile("org.jetbrains:annotations:18.0.0") minecraft("com.mojang:minecraft:${project.minecraft_version}") mappings("me.shedaniel:legacy-yarn:${project.yarn_mappings}:v2") modApi("net.fabricmc:fabric-loader:${project.loader_version}") modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}") modApi("me.shedaniel.cloth:basic-math:0.5.1") include("me.shedaniel.cloth:basic-math:0.5.1") modCompileOnly("io.github.prospector:modmenu:${modmenu_version}") { transitive(false) } modRuntime("io.github.prospector:modmenu:${modmenu_version}") { transitive(false) } // modRuntime("me.shedaniel:SmoothScrollingEverywhere:3.0.3-unstable") { // transitive(false) // } } task jarFilter(type: net.corda.gradle.jarfilter.JarFilterTask) { jars remapJar annotations { forRemove = [ "org.jetbrains.annotations.NotNull", "org.jetbrains.annotations.Nullable", "org.jetbrains.annotations.ApiStatus\$Experimental", "org.jetbrains.annotations.ApiStatus\$Internal", "org.jetbrains.annotations.ApiStatus\$ScheduledForRemoval", "org.jetbrains.annotations.ApiStatus\$AvailableSince", "org.jetbrains.annotations.ApiStatus\$NonExtendable", "org.jetbrains.annotations.ApiStatus\$OverrideOnly" ] } } task copyJarFilter(type: Copy) { from jarFilter into "${project.buildDir}/filtered-libs/" rename { "${project.archivesBaseName}-${project.version}.jar" } } bintray { user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY') publications = ["MyPublication"] publish = true pkg { repo = "cloth-config-2" name = "config-2" userOrg = "shedaniel" licenses = ["Unlicense"] version { name = project.version vcsTag = project.version released = new Date() desc = "Cloth Config API for Minecraft" githubRepo = 'shedaniel/ClothConfig' websiteUrl = 'https://github.com/shedaniel/ClothConfig' issueTrackerUrl = 'https://github.com/shedaniel/ClothConfig/issues' vcsUrl = 'https://github.com/shedaniel/ClothConfig.git' gpg { sign = true } } } } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocs(type: Javadoc) { source = sourceSets.main.allJava } task javadocsJar(type: Jar, dependsOn: javadocs) { classifier = "javadocs" javadocs.failOnError false from javadocs.destinationDir } publishing { publications { MyPublication(MavenPublication) { artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) { builtBy remapJar } artifact(sourcesJar) { builtBy remapSourcesJar } artifact javadocsJar groupId 'me.shedaniel.cloth' artifactId 'config-2' version = project.version } } // select the repositories you want to publish to repositories { // uncomment to publish to the local maven // mavenLocal() } } curseforge { apiKey = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('CF_API_KEY') if (apiKey != null) project { id = '319057' releaseType = 'beta' addGameVersion '1.16-Snapshot' addGameVersion 'Fabric' addGameVersion 'Java 8' relations { requiredDependency 'fabric-api' } mainArtifact(file("${project.buildDir}/filtered-libs/${project.archivesBaseName}-${project.version}.jar")) { displayName = "[Fabric ${project.supported_version}] ClothConfig2-$project.version" } addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar")) afterEvaluate { uploadTask.dependsOn("copyJarFilter") uploadTask.dependsOn("remapSourcesJar") } } options { forgeGradleIntegration = false javaVersionAutoDetect = false } }