build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.modVersion
  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. }
  19. processResources {
  20. filesMatching('fabric.mod.json') {
  21. expand 'version': project.version
  22. }
  23. inputs.property "version", project.version
  24. }
  25. configurations {
  26. contained {
  27. transitive = false
  28. }
  29. }
  30. shadowJar {
  31. configurations = [project.configurations.contained]
  32. }
  33. task remapShadowJar(type: RemapJar) {
  34. jar = shadowJar.archivePath
  35. }
  36. tasks.remapShadowJar.dependsOn tasks.shadowJar
  37. dependencies {
  38. minecraft "com.mojang:minecraft:${project.minecraftVersion}"
  39. mappings "net.fabricmc:yarn:${project.yarnVersion}"
  40. modCompile "net.fabricmc:fabric-loader:${project.fabricLoaderVersion}"
  41. modCompile "com.jamieswhiteshirt:developer-mode:${project.developerModeVersion}"
  42. modCompile "info.tehnut.pluginloader:plugin-loader:${project.pluginLoaderVersion}"
  43. modCompile "net.fabricmc:fabric:${project.fabricVersion}"
  44. compile "blue.endless:jankson:${project.janksonVersion}"
  45. contained "blue.endless:jankson:${project.janksonVersion}"
  46. }
  47. curseforge {
  48. if (project.hasProperty("curseForgeApiKey")) {
  49. apiKey = project.properties.curseForgeApiKey
  50. }
  51. project {
  52. id = "310111"
  53. changelogType = "markdown"
  54. changelog = file("CHANGELOG.md")
  55. releaseType = "release"
  56. addGameVersion "1.14-Snapshot"
  57. mainArtifact(remapShadowJar.jar) {
  58. displayName = "[Fabric $project.minecraftVersion] v$project.version"
  59. relations {
  60. requiredDependency "fabric"
  61. optionalDependency "pluginloader"
  62. tool "rei-addons"
  63. }
  64. }
  65. }
  66. options {
  67. forgeGradleIntegration = false
  68. }
  69. }
  70. afterEvaluate {
  71. // CurseGradle generates tasks in afterEvaluate for each project
  72. // There isn't really any other way to make it depend on a task unless it is an AbstractArchiveTask
  73. tasks.curseforge310111.dependsOn remapShadowJar
  74. }