build.gradle 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. plugins {
  2. id 'fabric-loom' version '0.2.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. }
  9. sourceCompatibility = 1.8
  10. targetCompatibility = 1.8
  11. group = "me.shedaniel.cloth"
  12. archivesBaseName = "config-2"
  13. version = project.mod_version
  14. minecraft {
  15. }
  16. processResources {
  17. filesMatching('fabric.mod.json') {
  18. expand 'version': project.version
  19. }
  20. inputs.property "version", project.version
  21. }
  22. dependencies {
  23. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  24. mappings "net.fabricmc:yarn:${project.yarn_version}"
  25. modApi "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
  26. modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  27. modImplementation "io.github.prospector:modmenu:${modmenu_version}"
  28. }
  29. bintray {
  30. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  31. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  32. publications = ["MyPublication"]
  33. override = true
  34. pkg {
  35. repo = "cloth-config-2"
  36. name = "config-2"
  37. userOrg = "shedaniel"
  38. licenses = ["Unlicense"]
  39. version {
  40. name = project.version
  41. vcsTag = project.version
  42. released = new Date()
  43. desc = "Cloth Config API for Minecraft"
  44. githubRepo = 'shedaniel/ClothConfig'
  45. websiteUrl = 'https://github.com/shedaniel/ClothConfig'
  46. issueTrackerUrl = 'https://github.com/shedaniel/ClothConfig/issues'
  47. vcsUrl = 'https://github.com/shedaniel/ClothConfig.git'
  48. gpg {
  49. sign = true
  50. }
  51. // mavenCentralSync {
  52. // sync = true //[Default: true] Determines whether to sync the version to Maven Central.
  53. // user = project.hasProperty('ossToken') ? project.property('ossToken') : System.getenv('OSS_TOKEN')
  54. // OSS user token: mandatory
  55. // password = project.hasProperty('ossPass') ? project.property('ossPass') : System.getenv('OSS_PASS')
  56. //OSS user password: mandatory
  57. // close = '1'
  58. //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
  59. // }
  60. }
  61. }
  62. }
  63. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  64. // if it is present.
  65. // If you remove this task, sources will not be generated.
  66. task sourcesJar(type: Jar, dependsOn: classes) {
  67. classifier = 'sources'
  68. from sourceSets.main.allSource
  69. }
  70. task javadocs(type: Javadoc) {
  71. source = sourceSets.main.allJava
  72. }
  73. task javadocsJar(type: Jar, dependsOn: javadocs) {
  74. classifier = "javadocs"
  75. from javadocs.destinationDir
  76. }
  77. publishing {
  78. publications {
  79. MyPublication(MavenPublication) {
  80. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  81. builtBy remapJar
  82. }
  83. artifact(sourcesJar) {
  84. builtBy remapSourcesJar
  85. }
  86. artifact javadocsJar
  87. groupId 'me.shedaniel.cloth'
  88. artifactId 'config-2'
  89. version = project.version
  90. pom.withXml {
  91. def root = asNode()
  92. root.appendNode('description', 'Cloth Config API for Minecraft')
  93. root.appendNode('name', 'config-2')
  94. root.appendNode('url', 'https://github.com/shedaniel/ClothConfig')
  95. root.appendNode('packaging', 'jar')
  96. def license = root.appendNode('licenses').appendNode('license')
  97. license.appendNode('name', 'Unlicense')
  98. license.appendNode('url', 'http://unlicense.org')
  99. license.appendNode('distribution', 'repo')
  100. def developers = root.appendNode('developers')
  101. def shedaniel = developers.appendNode('developer')
  102. shedaniel.appendNode('id', 'shedaniel')
  103. shedaniel.appendNode('name', 'shedaniel')
  104. shedaniel.appendNode('email', 'daniel@shedaniel.me')
  105. def scm = root.appendNode('scm')
  106. scm.appendNode('url', "https://github.com/shedaniel/ClothConfig")
  107. scm.appendNode('connection', "scm:git:git://github.com/shedaniel/ClothConfig.git")
  108. scm.appendNode('developerConnection', "scm:git:ssh://github.com:shedaniel/ClothConfig.git")
  109. }
  110. }
  111. }
  112. // select the repositories you want to publish to
  113. repositories {
  114. // uncomment to publish to the local maven
  115. // mavenLocal()
  116. }
  117. }
  118. curseforge {
  119. apiKey = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('CF_API_KEY')
  120. if (apiKey != null)
  121. project {
  122. id = '319057'
  123. releaseType = 'beta'
  124. addGameVersion '1.15-Snapshot'
  125. addGameVersion 'Java 8'
  126. relations {
  127. requiredDependency 'fabric-api'
  128. }
  129. mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  130. displayName = "[Fabric 1.14.x, 19w38a - 19w38b] ClothConfig2-$project.version"
  131. }
  132. addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
  133. afterEvaluate {
  134. uploadTask.dependsOn("remapJar")
  135. uploadTask.dependsOn("remapSourcesJar")
  136. }
  137. }
  138. options {
  139. forgeGradleIntegration = false
  140. javaVersionAutoDetect = false
  141. }
  142. }