build.gradle 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import java.text.SimpleDateFormat
  2. plugins {
  3. id 'fabric-loom' version '0.2.7-SNAPSHOT'
  4. id 'maven-publish'
  5. id 'maven'
  6. id 'signing'
  7. id 'com.jfrog.bintray' version '1.8.4'
  8. id 'com.matthewprenger.cursegradle' version '1.4.0'
  9. id 'java-library'
  10. }
  11. repositories {
  12. maven {
  13. name = 'Fabric'
  14. url = 'https://maven.fabricmc.net/'
  15. }
  16. jcenter()
  17. maven { url "https://jitpack.io" }
  18. }
  19. sourceCompatibility = targetCompatibility = 1.8
  20. group = "me.shedaniel.cloth"
  21. archivesBaseName = "config-2"
  22. version = project.mod_version
  23. minecraft {
  24. }
  25. processResources {
  26. filesMatching('fabric.mod.json') {
  27. expand 'version': project.version
  28. }
  29. inputs.property "version", project.version
  30. }
  31. dependencies {
  32. compileOnly 'org.jetbrains:annotations:18.0.0'
  33. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  34. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  35. modApi "net.fabricmc:fabric-loader:${project.loader_version}"
  36. modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  37. modApi "me.shedaniel.cloth:basic-math:0.4.1"
  38. include "me.shedaniel.cloth:basic-math:0.4.1"
  39. modImplementation "io.github.prospector:modmenu:${modmenu_version}"
  40. // modRuntime "com.lettuce.fudge:notenoughcrashes:$nec_version"
  41. }
  42. bintray {
  43. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  44. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  45. publications = ["MyPublication"]
  46. override = true
  47. pkg {
  48. repo = "cloth-config-2"
  49. name = "config-2"
  50. userOrg = "shedaniel"
  51. licenses = ["Unlicense"]
  52. version {
  53. name = project.version
  54. vcsTag = project.version
  55. released = new Date()
  56. desc = "Cloth Config API for Minecraft"
  57. githubRepo = 'shedaniel/ClothConfig'
  58. websiteUrl = 'https://github.com/shedaniel/ClothConfig'
  59. issueTrackerUrl = 'https://github.com/shedaniel/ClothConfig/issues'
  60. vcsUrl = 'https://github.com/shedaniel/ClothConfig.git'
  61. gpg {
  62. sign = true
  63. }
  64. // mavenCentralSync {
  65. // sync = true //[Default: true] Determines whether to sync the version to Maven Central.
  66. // user = project.hasProperty('ossToken') ? project.property('ossToken') : System.getenv('OSS_TOKEN')
  67. // OSS user token: mandatory
  68. // password = project.hasProperty('ossPass') ? project.property('ossPass') : System.getenv('OSS_PASS')
  69. //OSS user password: mandatory
  70. // close = '1'
  71. //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.
  72. // }
  73. }
  74. }
  75. }
  76. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  77. // if it is present.
  78. // If you remove this task, sources will not be generated.
  79. task sourcesJar(type: Jar, dependsOn: classes) {
  80. classifier = 'sources'
  81. from sourceSets.main.allSource
  82. }
  83. task javadocs(type: Javadoc) {
  84. source = sourceSets.main.allJava
  85. }
  86. task javadocsJar(type: Jar, dependsOn: javadocs) {
  87. classifier = "javadocs"
  88. javadocs.failOnError false
  89. from javadocs.destinationDir
  90. }
  91. publishing {
  92. publications {
  93. MyPublication(MavenPublication) {
  94. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  95. builtBy remapJar
  96. }
  97. artifact(sourcesJar) {
  98. builtBy remapSourcesJar
  99. }
  100. artifact javadocsJar
  101. groupId 'me.shedaniel.cloth'
  102. artifactId 'config-2'
  103. version = project.version
  104. }
  105. }
  106. // select the repositories you want to publish to
  107. repositories {
  108. // uncomment to publish to the local maven
  109. // mavenLocal()
  110. }
  111. }
  112. curseforge {
  113. apiKey = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('CF_API_KEY')
  114. if (apiKey != null)
  115. project {
  116. id = '319057'
  117. releaseType = 'beta'
  118. addGameVersion '1.16-Snapshot'
  119. addGameVersion 'Fabric'
  120. addGameVersion 'Java 8'
  121. relations {
  122. requiredDependency 'fabric-api'
  123. }
  124. mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  125. displayName = "[Fabric 20w12a] ClothConfig2-$project.version"
  126. }
  127. addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
  128. afterEvaluate {
  129. uploadTask.dependsOn("remapJar")
  130. uploadTask.dependsOn("remapSourcesJar")
  131. }
  132. }
  133. options {
  134. forgeGradleIntegration = false
  135. javaVersionAutoDetect = false
  136. }
  137. }