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.
 
 

56 lines
1.6 KiB

  1. plugins {
  2. id "java"
  3. id "idea"
  4. id "fabric-loom" version "0.4.29"
  5. }
  6. sourceCompatibility = 1.8
  7. targetCompatibility = 1.8
  8. archivesBaseName = "${project.archives_base_name}"
  9. group = "${project.maven_group}"
  10. version = "${project.mod_version}+${project.minecraft_version}"
  11. repositories {
  12. mavenCentral()
  13. maven { url "http://maven.fabricmc.net/" } // Fabric maven - home of Fabric API and ModMenu
  14. maven { url "https://jitpack.io" }
  15. }
  16. dependencies {
  17. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  18. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  19. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  20. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  21. }
  22. processResources {
  23. inputs.property "version", project.version
  24. from(sourceSets.main.resources.srcDirs) {
  25. include "fabric.mod.json"
  26. expand version: project.version
  27. }
  28. from(sourceSets.main.resources.srcDirs) {
  29. exclude "fabric.mod.json"
  30. }
  31. }
  32. // ensure that the encoding is set to UTF-8, no matter what the system default is
  33. // this fixes some edge cases with special characters not displaying correctly
  34. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  35. tasks.withType(JavaCompile) {
  36. options.encoding = "UTF-8"
  37. }
  38. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  39. // if it is present.
  40. // If you remove this task, sources will not be generated.
  41. task sourcesJar(type: Jar, dependsOn: classes) {
  42. classifier = "sources"
  43. from sourceSets.main.allSource
  44. }
  45. jar {
  46. from "LICENSE"
  47. }