Find magical relics throughout the world! https://www.curseforge.com/minecraft/mc-mods/reliccraft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.3 KiB

  1. plugins {
  2. id 'fabric-loom' version '0.2.7-SNAPSHOT'
  3. id 'com.matthewprenger.cursegradle' version '1.4.0'
  4. }
  5. compileJava {
  6. sourceCompatibility = JavaVersion.VERSION_1_8
  7. targetCompatibility = JavaVersion.VERSION_1_8
  8. }
  9. archivesBaseName = project.archives_base_name
  10. def mod_version = project.mod_version as Object
  11. version = "${mod_version}+${project.minecraft_version}"
  12. group = project.maven_group as Object
  13. minecraft {
  14. }
  15. repositories {
  16. jcenter()
  17. maven {
  18. name = 'Earthcomputer Mods'
  19. url = 'https://dl.bintray.com/earthcomputer/mods'
  20. }
  21. }
  22. configurations {
  23. includeTransitive {
  24. transitive = true
  25. }
  26. }
  27. dependencies {
  28. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  29. mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
  30. modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
  31. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
  32. implementation "com.squareup.moshi:moshi:${project.moshi_version}"
  33. includeTransitive "com.squareup.moshi:moshi:${project.moshi_version}"
  34. modImplementation "net.earthcomputer:libstructure:${project.libstructure_version}"
  35. include "net.earthcomputer:libstructure:${project.libstructure_version}"
  36. }
  37. project.afterEvaluate {
  38. configurations.includeTransitive.incoming.resolutionResult.allComponents {
  39. if (it.id instanceof ModuleComponentIdentifier) {
  40. def that = it
  41. dependencies {
  42. include group: that.id.getGroup(), name: that.id.getModule(), version: that.id.getVersion()
  43. }
  44. }
  45. }
  46. }
  47. processResources {
  48. inputs.property 'version', project.version
  49. inputs.property 'name', rootProject.name
  50. from(sourceSets.main.resources.srcDirs) {
  51. include 'fabric.mod.json'
  52. expand 'version': project.version, 'name': rootProject.name
  53. }
  54. from(sourceSets.main.resources.srcDirs) {
  55. exclude 'fabric.mod.json'
  56. }
  57. }
  58. // ensure that the encoding is set to UTF-8, no matter what the system default is
  59. // this fixes some edge cases with special characters not displaying correctly
  60. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  61. tasks.withType(JavaCompile) {
  62. options.encoding = 'UTF-8'
  63. }
  64. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  65. // if it is present.
  66. // If you remove this task, sources will not be generated.
  67. task sourcesJar(type: Jar, dependsOn: classes) {
  68. classifier 'sources'
  69. from sourceSets.main.allSource
  70. from sourceSets.main.resources
  71. }
  72. task javadocJar(type: Jar, dependsOn: javadoc) {
  73. classifier 'javadoc'
  74. from javadoc.destinationDir
  75. }
  76. artifacts {
  77. archives sourcesJar
  78. archives javadocJar
  79. }
  80. jar {
  81. from "LICENSE"
  82. }
  83. if (project.hasProperty('curseforge.api_key')) {
  84. curseforge {
  85. apiKey = project.getProperty('curseforge.api_key')
  86. project {
  87. id = project.curseforge_id
  88. changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/RelicCraft/src/branch/master/CHANGELOG.md'
  89. releaseType = 'release'
  90. addGameVersion project.simple_minecraft_version
  91. addGameVersion 'Fabric'
  92. mainArtifact(remapJar) {
  93. displayName = "RelicCraft v${mod_version} for ${project.minecraft_version}"
  94. }
  95. afterEvaluate {
  96. uploadTask.dependsOn('remapJar')
  97. }
  98. relations {
  99. requiredDependency 'fabric-api'
  100. }
  101. }
  102. options {
  103. forgeGradleIntegration = false
  104. }
  105. }
  106. }