A Collection of Tweaks for Vanilla Minecraft
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.

104 lines
3.0 KiB

1 year ago
11 months ago
1 year ago
1 year ago
  1. plugins {
  2. id 'fabric-loom' version '0.4-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. url "https://dl.bintray.com/shedaniel/autoconfig1u/"
  19. }
  20. }
  21. dependencies {
  22. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  23. mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
  24. modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
  25. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
  26. modImplementation "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
  27. include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
  28. modImplementation "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  29. include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  30. modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
  31. }
  32. processResources {
  33. inputs.property 'version', project.version
  34. inputs.property 'name', rootProject.name
  35. from(sourceSets.main.resources.srcDirs) {
  36. include 'fabric.mod.json'
  37. expand 'version': project.version, 'name': rootProject.name
  38. }
  39. from(sourceSets.main.resources.srcDirs) {
  40. exclude 'fabric.mod.json'
  41. }
  42. }
  43. // ensure that the encoding is set to UTF-8, no matter what the system default is
  44. // this fixes some edge cases with special characters not displaying correctly
  45. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  46. tasks.withType(JavaCompile) {
  47. options.encoding = 'UTF-8'
  48. }
  49. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  50. // if it is present.
  51. // If you remove this task, sources will not be generated.
  52. task sourcesJar(type: Jar, dependsOn: classes) {
  53. classifier 'sources'
  54. from sourceSets.main.allSource
  55. }
  56. task javadocJar(type: Jar, dependsOn: javadoc) {
  57. classifier 'javadoc'
  58. from javadoc.destinationDir
  59. }
  60. artifacts {
  61. archives sourcesJar
  62. archives javadocJar
  63. }
  64. jar {
  65. from "LICENSE"
  66. }
  67. if (project.hasProperty('curseforge.api_key')) {
  68. curseforge {
  69. apiKey = project.getProperty('curseforge.api_key')
  70. project {
  71. id = project.curseforge_id
  72. changelog = 'A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/SlightlyVanilla/src/branch/master/CHANGELOG.md'
  73. releaseType = 'release'
  74. addGameVersion project.simple_minecraft_version
  75. addGameVersion 'Fabric'
  76. mainArtifact(remapJar) {
  77. displayName = "SlightlyVanilla v${mod_version} for ${project.minecraft_version}"
  78. }
  79. afterEvaluate {
  80. uploadTask.dependsOn('remapJar')
  81. }
  82. relations {
  83. requiredDependency 'fabric-api'
  84. }
  85. }
  86. options {
  87. forgeGradleIntegration = false
  88. }
  89. }
  90. }