build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. plugins {
  2. id 'fabric-loom' version '0.2.7-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. implementation 'com.google.code.gson:gson:2.8.6'
  29. }
  30. processResources {
  31. inputs.property "version", project.version
  32. from(sourceSets.main.resources.srcDirs) {
  33. include "fabric.mod.json"
  34. expand "version": project.version
  35. }
  36. from(sourceSets.main.resources.srcDirs) {
  37. exclude "fabric.mod.json"
  38. }
  39. }
  40. // ensure that the encoding is set to UTF-8, no matter what the system default is
  41. // this fixes some edge cases with special characters not displaying correctly
  42. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  43. tasks.withType(JavaCompile) {
  44. options.encoding = "UTF-8"
  45. }
  46. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  47. // if it is present.
  48. // If you remove this task, sources will not be generated.
  49. task sourcesJar(type: Jar, dependsOn: classes) {
  50. classifier = "sources"
  51. from sourceSets.main.allSource
  52. }
  53. jar {
  54. from "LICENSE"
  55. }
  56. // configure the maven publication
  57. publishing {
  58. publications {
  59. mavenJava(MavenPublication) {
  60. // add all the jars that should be included when publishing to maven
  61. artifact(jar) {
  62. builtBy remapJar
  63. }
  64. artifact(sourcesJar) {
  65. builtBy remapSourcesJar
  66. }
  67. }
  68. }
  69. // select the repositories you want to publish to
  70. repositories {
  71. // uncomment to publish to the local maven
  72. // mavenLocal()
  73. }
  74. }