build.gradle 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. plugins {
  2. id 'fabric-loom' version "0.4-SNAPSHOT"
  3. id 'maven-publish'
  4. id 'maven'
  5. id 'signing'
  6. id 'com.jfrog.bintray' version '1.8.4'
  7. id 'com.matthewprenger.cursegradle' version '1.4.0'
  8. id 'java-library'
  9. id 'net.corda.plugins.jar-filter' version "5.0.8" apply false
  10. }
  11. repositories {
  12. maven {
  13. name = 'Fabric'
  14. url = 'https://maven.fabricmc.net/'
  15. }
  16. jcenter()
  17. maven { url "https://jitpack.io" }
  18. maven { url "https://dl.bintray.com/shedaniel/legacy-yarn-updated" }
  19. }
  20. sourceCompatibility = targetCompatibility = 1.8
  21. group = "me.shedaniel.cloth"
  22. archivesBaseName = "config-2"
  23. version = project.mod_version
  24. repositories {
  25. maven { url "https://dl.bintray.com/shedaniel/shedaniel-mods" }
  26. }
  27. minecraft {
  28. accessWidener = file("src/main/resources/cloth-config.accessWidener")
  29. }
  30. processResources {
  31. filesMatching('fabric.mod.json') {
  32. expand 'version': project.version
  33. }
  34. inputs.property "version", project.version
  35. }
  36. dependencies {
  37. compile("org.jetbrains:annotations:18.0.0")
  38. minecraft("com.mojang:minecraft:${project.minecraft_version}")
  39. mappings("me.shedaniel:legacy-yarn:${project.yarn_mappings}:v2")
  40. modApi("net.fabricmc:fabric-loader:${project.loader_version}")
  41. modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
  42. modApi("me.shedaniel.cloth:basic-math:0.5.1")
  43. include("me.shedaniel.cloth:basic-math:0.5.1")
  44. modCompileOnly("io.github.prospector:modmenu:${modmenu_version}") {
  45. transitive(false)
  46. }
  47. modRuntime("io.github.prospector:modmenu:${modmenu_version}") {
  48. transitive(false)
  49. }
  50. // modRuntime("me.shedaniel:SmoothScrollingEverywhere:3.0.3-unstable") {
  51. // transitive(false)
  52. // }
  53. }
  54. task jarFilter(type: net.corda.gradle.jarfilter.JarFilterTask) {
  55. jars remapJar
  56. annotations {
  57. forRemove = [
  58. "org.jetbrains.annotations.NotNull",
  59. "org.jetbrains.annotations.Nullable",
  60. "org.jetbrains.annotations.ApiStatus\$Experimental",
  61. "org.jetbrains.annotations.ApiStatus\$Internal",
  62. "org.jetbrains.annotations.ApiStatus\$ScheduledForRemoval",
  63. "org.jetbrains.annotations.ApiStatus\$AvailableSince",
  64. "org.jetbrains.annotations.ApiStatus\$NonExtendable",
  65. "org.jetbrains.annotations.ApiStatus\$OverrideOnly"
  66. ]
  67. }
  68. }
  69. task copyJarFilter(type: Copy) {
  70. from jarFilter
  71. into "${project.buildDir}/filtered-libs/"
  72. rename { "${project.archivesBaseName}-${project.version}.jar" }
  73. }
  74. bintray {
  75. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  76. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  77. publications = ["MyPublication"]
  78. publish = true
  79. pkg {
  80. repo = "cloth-config-2"
  81. name = "config-2"
  82. userOrg = "shedaniel"
  83. licenses = ["Unlicense"]
  84. version {
  85. name = project.version
  86. vcsTag = project.version
  87. released = new Date()
  88. desc = "Cloth Config API for Minecraft"
  89. githubRepo = 'shedaniel/ClothConfig'
  90. websiteUrl = 'https://github.com/shedaniel/ClothConfig'
  91. issueTrackerUrl = 'https://github.com/shedaniel/ClothConfig/issues'
  92. vcsUrl = 'https://github.com/shedaniel/ClothConfig.git'
  93. gpg {
  94. sign = true
  95. }
  96. }
  97. }
  98. }
  99. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  100. // if it is present.
  101. // If you remove this task, sources will not be generated.
  102. task sourcesJar(type: Jar, dependsOn: classes) {
  103. classifier = 'sources'
  104. from sourceSets.main.allSource
  105. }
  106. task javadocs(type: Javadoc) {
  107. source = sourceSets.main.allJava
  108. }
  109. task javadocsJar(type: Jar, dependsOn: javadocs) {
  110. classifier = "javadocs"
  111. javadocs.failOnError false
  112. from javadocs.destinationDir
  113. }
  114. publishing {
  115. publications {
  116. MyPublication(MavenPublication) {
  117. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  118. builtBy remapJar
  119. }
  120. artifact(sourcesJar) {
  121. builtBy remapSourcesJar
  122. }
  123. artifact javadocsJar
  124. groupId 'me.shedaniel.cloth'
  125. artifactId 'config-2'
  126. version = project.version
  127. }
  128. }
  129. // select the repositories you want to publish to
  130. repositories {
  131. // uncomment to publish to the local maven
  132. // mavenLocal()
  133. }
  134. }
  135. curseforge {
  136. apiKey = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('CF_API_KEY')
  137. if (apiKey != null)
  138. project {
  139. id = '319057'
  140. releaseType = 'beta'
  141. addGameVersion '1.16-Snapshot'
  142. addGameVersion 'Fabric'
  143. addGameVersion 'Java 8'
  144. relations {
  145. requiredDependency 'fabric-api'
  146. }
  147. mainArtifact(file("${project.buildDir}/filtered-libs/${project.archivesBaseName}-${project.version}.jar")) {
  148. displayName = "[Fabric ${project.supported_version}] ClothConfig2-$project.version"
  149. }
  150. addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
  151. afterEvaluate {
  152. uploadTask.dependsOn("copyJarFilter")
  153. uploadTask.dependsOn("remapSourcesJar")
  154. }
  155. }
  156. options {
  157. forgeGradleIntegration = false
  158. javaVersionAutoDetect = false
  159. }
  160. }