build.gradle 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. plugins {
  2. id 'fabric-loom' version '0.4-SNAPSHOT'
  3. id 'maven-publish'
  4. }
  5. sourceCompatibility = JavaVersion.VERSION_1_8
  6. targetCompatibility = JavaVersion.VERSION_1_8
  7. archivesBaseName = project.archives_base_name
  8. version = project.mod_version
  9. group = project.maven_group
  10. minecraft {
  11. }
  12. repositories {
  13. maven {
  14. name "CottonMC"
  15. url "https://server.bbkr.space/artifactory/libs-release"
  16. }
  17. maven {
  18. url "https://maven.fabricmc.net/io/github/prospector/modmenu/"
  19. }
  20. }
  21. dependencies {
  22. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  23. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  24. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  25. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  26. modImplementation "io.github.cottonmc:cotton-client-commands:${project.clientcommands_version}"
  27. include "io.github.cottonmc:cotton-client-commands:${project.clientcommands_version}"
  28. modApi "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  29. include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
  30. modApi "me.shedaniel.cloth:config-2:${project.clothconfig_version}"
  31. include "me.shedaniel.cloth:config-2:${project.clothconfig_version}"
  32. modImplementation "io.github.prospector:modmenu:${project.modmenu_version}"
  33. }
  34. processResources {
  35. inputs.property "version", project.version
  36. from(sourceSets.main.resources.srcDirs) {
  37. include "fabric.mod.json"
  38. expand "version": project.version
  39. }
  40. from(sourceSets.main.resources.srcDirs) {
  41. exclude "fabric.mod.json"
  42. }
  43. }
  44. // ensure that the encoding is set to UTF-8, no matter what the system default is
  45. // this fixes some edge cases with special characters not displaying correctly
  46. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  47. tasks.withType(JavaCompile) {
  48. options.encoding = "UTF-8"
  49. }
  50. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  51. // if it is present.
  52. // If you remove this task, sources will not be generated.
  53. task sourcesJar(type: Jar, dependsOn: classes) {
  54. classifier = "sources"
  55. from sourceSets.main.allSource
  56. }
  57. jar {
  58. from "LICENSE"
  59. }
  60. // configure the maven publication
  61. publishing {
  62. publications {
  63. mavenJava(MavenPublication) {
  64. // add all the jars that should be included when publishing to maven
  65. artifact(jar) {
  66. builtBy remapJar
  67. }
  68. artifact(sourcesJar) {
  69. builtBy remapSourcesJar
  70. }
  71. }
  72. }
  73. // select the repositories you want to publish to
  74. repositories {
  75. // uncomment to publish to the local maven
  76. // mavenLocal()
  77. }
  78. }