build.gradle 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. pkg {
  33. repo = "ClothConfig"
  34. name = "ClothConfig2"
  35. userOrg = "shedaniel"
  36. licenses = ["Unlicense"]
  37. vcsUrl = "https://github.com/shedaniel/ClothConfig.git"
  38. version {
  39. name = project.version
  40. vcsTag = project.version
  41. released = new Date()
  42. gpg {
  43. sign = true
  44. }
  45. mavenCentralSync {
  46. sync = true //[Default: true] Determines whether to sync the version to Maven Central.
  47. user = project.hasProperty('ossToken') ? project.property('ossToken') : System.getenv('OSS_TOKEN')
  48. //OSS user token: mandatory
  49. password = project.hasProperty('ossPass') ? project.property('ossPass') : System.getenv('OSS_PASS')
  50. //OSS user password: mandatory
  51. close = '1'
  52. //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.
  53. }
  54. }
  55. }
  56. }
  57. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  58. // if it is present.
  59. // If you remove this task, sources will not be generated.
  60. task sourcesJar(type: Jar, dependsOn: classes) {
  61. classifier = 'sources'
  62. from sourceSets.main.allSource
  63. }
  64. publishing {
  65. publications {
  66. MyPublication(MavenPublication) {
  67. artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
  68. builtBy remapJar
  69. }
  70. artifact(sourcesJar) {
  71. builtBy remapSourcesJar
  72. }
  73. }
  74. }
  75. // select the repositories you want to publish to
  76. repositories {
  77. // uncomment to publish to the local maven
  78. // mavenLocal()
  79. }
  80. }