build.gradle 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. plugins {
  2. id 'fabric-loom' version '0.2.7-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. }
  10. repositories {
  11. maven {
  12. name = 'Fabric'
  13. url = 'https://maven.fabricmc.net/'
  14. }
  15. jcenter()
  16. maven { url "https://jitpack.io" }
  17. }
  18. sourceCompatibility = targetCompatibility = 1.8
  19. group = "me.shedaniel.cloth"
  20. archivesBaseName = "config-2"
  21. version = project.mod_version
  22. minecraft {
  23. }
  24. processResources {
  25. filesMatching('fabric.mod.json') {
  26. expand 'version': project.version
  27. }
  28. inputs.property "version", project.version
  29. }
  30. dependencies {
  31. compileOnly("org.jetbrains:annotations:18.0.0")
  32. minecraft("com.mojang:minecraft:${project.minecraft_version}")
  33. mappings("net.fabricmc:yarn:${project.yarn_mappings}:v2")
  34. modApi("net.fabricmc:fabric-loader:${project.loader_version}")
  35. modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
  36. modApi("me.shedaniel.cloth:basic-math:0.5.0")
  37. include("me.shedaniel.cloth:basic-math:0.5.0")
  38. modCompileOnly("io.github.prospector:modmenu:${modmenu_version}")
  39. modRuntime("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. publish = 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. }
  65. }
  66. }
  67. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  68. // if it is present.
  69. // If you remove this task, sources will not be generated.
  70. task sourcesJar(type: Jar, dependsOn: classes) {
  71. classifier = 'sources'
  72. from sourceSets.main.allSource
  73. }
  74. task javadocs(type: Javadoc) {
  75. source = sourceSets.main.allJava
  76. }
  77. task javadocsJar(type: Jar, dependsOn: javadocs) {
  78. classifier = "javadocs"
  79. javadocs.failOnError false
  80. from javadocs.destinationDir
  81. }
  82. publishing {
  83. publications {
  84. MyPublication(MavenPublication) {
  85. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  86. builtBy remapJar
  87. }
  88. artifact(sourcesJar) {
  89. builtBy remapSourcesJar
  90. }
  91. artifact javadocsJar
  92. groupId 'me.shedaniel.cloth'
  93. artifactId 'config-2'
  94. version = project.version
  95. }
  96. }
  97. // select the repositories you want to publish to
  98. repositories {
  99. // uncomment to publish to the local maven
  100. // mavenLocal()
  101. }
  102. }
  103. curseforge {
  104. apiKey = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('CF_API_KEY')
  105. if (apiKey != null)
  106. project {
  107. id = '319057'
  108. releaseType = 'beta'
  109. addGameVersion '1.16-Snapshot'
  110. addGameVersion 'Fabric'
  111. addGameVersion 'Java 8'
  112. relations {
  113. requiredDependency 'fabric-api'
  114. }
  115. mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  116. displayName = "[Fabric ${project.supported_version}] ClothConfig2-$project.version"
  117. }
  118. addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
  119. afterEvaluate {
  120. uploadTask.dependsOn("remapJar")
  121. uploadTask.dependsOn("remapSourcesJar")
  122. }
  123. }
  124. options {
  125. forgeGradleIntegration = false
  126. javaVersionAutoDetect = false
  127. }
  128. }