build.gradle 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. }
  8. sourceCompatibility = 1.8
  9. targetCompatibility = 1.8
  10. group = "me.shedaniel"
  11. archivesBaseName = "cloth-config-2"
  12. version = project.mod_version
  13. minecraft {
  14. }
  15. processResources {
  16. filesMatching('fabric.mod.json') {
  17. expand 'version': project.version
  18. }
  19. inputs.property "version", project.version
  20. }
  21. dependencies {
  22. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  23. mappings "net.fabricmc:yarn:${project.yarn_version}"
  24. modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
  25. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  26. modApi "io.github.prospector.modmenu:ModMenu:${modmenu_version}"
  27. }
  28. bintray {
  29. user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
  30. key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
  31. publications = ["MyPublication"]
  32. override = true
  33. pkg {
  34. repo = "cloth-config-2"
  35. name = "cloth-config-2"
  36. userOrg = "shedaniel"
  37. licenses = ["Unlicense"]
  38. version {
  39. name = project.version
  40. vcsTag = project.version
  41. released = new Date()
  42. desc = "Cloth Config API for Minecraft"
  43. githubRepo = 'shedaniel/ClothConfig'
  44. websiteUrl = 'https://github.com/shedaniel/ClothConfig'
  45. issueTrackerUrl = 'https://github.com/shedaniel/ClothConfig/issues'
  46. vcsUrl = 'https://github.com/shedaniel/ClothConfig.git'
  47. gpg {
  48. sign = true
  49. }
  50. mavenCentralSync {
  51. sync = true //[Default: true] Determines whether to sync the version to Maven Central.
  52. user = project.hasProperty('ossToken') ? project.property('ossToken') : System.getenv('OSS_TOKEN')
  53. //OSS user token: mandatory
  54. password = project.hasProperty('ossPass') ? project.property('ossPass') : System.getenv('OSS_PASS')
  55. //OSS user password: mandatory
  56. close = '1'
  57. //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.
  58. }
  59. }
  60. }
  61. }
  62. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  63. // if it is present.
  64. // If you remove this task, sources will not be generated.
  65. task sourcesJar(type: Jar, dependsOn: classes) {
  66. classifier = 'sources'
  67. from sourceSets.main.allSource
  68. }
  69. task javadocs(type: Javadoc) {
  70. source = sourceSets.main.allJava
  71. }
  72. task javadocsJar(type: Jar, dependsOn: javadocs) {
  73. classifier = "javadocs"
  74. from javadocs.destinationDir
  75. }
  76. publishing {
  77. publications {
  78. MyPublication(MavenPublication) {
  79. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  80. builtBy remapJar
  81. }
  82. artifact(sourcesJar) {
  83. builtBy remapSourcesJar
  84. }
  85. artifact javadocsJar
  86. groupId 'me.shedaniel'
  87. artifactId 'cloth-config-2'
  88. version = project.version
  89. pom.withXml {
  90. def root = asNode()
  91. root.appendNode('description', 'Cloth Config API for Minecraft')
  92. root.appendNode('name', 'cloth-config-2')
  93. root.appendNode('url', 'https://github.com/shedaniel/ClothConfig')
  94. root.appendNode('packaging', 'jar')
  95. def license = root.appendNode('licenses').appendNode('license')
  96. license.appendNode('name', 'Unlicense')
  97. license.appendNode('url', 'http://unlicense.org')
  98. license.appendNode('distribution', 'repo')
  99. def developers = root.appendNode('developers')
  100. def shedaniel = developers.appendNode('developer')
  101. shedaniel.appendNode('id', 'shedaniel')
  102. shedaniel.appendNode('name', 'shedaniel')
  103. shedaniel.appendNode('email', 'daniel@shedaniel.me')
  104. def scm = root.appendNode('scm')
  105. scm.appendNode('url', "https://github.com/shedaniel/ClothConfig")
  106. scm.appendNode('connection', "scm:git:git://github.com/shedaniel/ClothConfig.git")
  107. scm.appendNode('developerConnection', "scm:git:ssh://github.com:shedaniel/ClothConfig.git")
  108. }
  109. }
  110. }
  111. // select the repositories you want to publish to
  112. repositories {
  113. // uncomment to publish to the local maven
  114. // mavenLocal()
  115. }
  116. }