build.gradle 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import net.fabricmc.loom.task.RemapJar
  2. plugins {
  3. id 'fabric-loom' version '0.2.0-SNAPSHOT'
  4. id "com.github.johnrengelman.shadow" version "4.0.3"
  5. id "com.matthewprenger.cursegradle" version "1.1.2"
  6. }
  7. sourceCompatibility = 1.8
  8. targetCompatibility = 1.8
  9. group = "me.shedaniel"
  10. archivesBaseName = "RoughlyEnoughItems"
  11. version = project.mod_version
  12. minecraft {
  13. }
  14. repositories {
  15. maven { url "https://tehnut.info/maven/" }
  16. maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  17. maven { url "https://maven.jamieswhiteshirt.com/libs-release/" }
  18. maven { url "https://minecraft.curseforge.com/api/maven" }
  19. }
  20. processResources {
  21. filesMatching('fabric.mod.json') {
  22. expand 'version': project.version
  23. }
  24. inputs.property "version", project.version
  25. }
  26. configurations {
  27. contained {
  28. transitive = false
  29. }
  30. }
  31. shadowJar {
  32. configurations = [project.configurations.contained]
  33. }
  34. task remapShadowJar(type: RemapJar) {
  35. jar = shadowJar.archivePath
  36. }
  37. tasks.remapShadowJar.dependsOn tasks.shadowJar
  38. dependencies {
  39. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  40. mappings "net.fabricmc:yarn:${project.yarn_version}"
  41. modCompile "net.fabricmc:fabric-loader:${project.fabricloader_version}"
  42. // modCompile "com.jamieswhiteshirt:developer-mode:${project.developermode_version}"
  43. modCompile "info.tehnut.pluginloader:plugin-loader:${project.pluginloader_version}"
  44. modCompile "net.fabricmc:fabric:${project.fabric_version}"
  45. modCompile "cloth:Cloth:${cloth_version}"
  46. compile "blue.endless:jankson:${project.jankson_version}"
  47. contained "blue.endless:jankson:${project.jankson_version}"
  48. }
  49. curseforge {
  50. if (project.hasProperty("curseForgeApiKey")) {
  51. apiKey = project.properties.curseForgeApiKey
  52. }
  53. project {
  54. id = "310111"
  55. changelogType = "markdown"
  56. changelog = file("CHANGELOG.md")
  57. releaseType = "release"
  58. addGameVersion "1.14-Snapshot"
  59. mainArtifact(remapShadowJar.jar) {
  60. displayName = "[Fabric $project.minecraft_version] v$project.version"
  61. relations {
  62. requiredDependency "fabric"
  63. optionalDependency "pluginloader"
  64. tool "rei-addons"
  65. }
  66. }
  67. }
  68. options {
  69. forgeGradleIntegration = false
  70. }
  71. }
  72. afterEvaluate {
  73. // CurseGradle generates tasks in afterEvaluate for each project
  74. // There isn't really any other way to make it depend on a task unless it is an AbstractArchiveTask
  75. tasks.curseforge310111.dependsOn remapShadowJar
  76. }