build.gradle 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. plugins {
  2. id 'fabric-loom' version '0.2.6-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. }
  18. dependencies {
  19. //to change the versions see the gradle.properties file
  20. minecraft "com.mojang:minecraft:${project.minecraft_version}"
  21. mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
  22. modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
  23. // Fabric API. This is technically optional, but you probably want it anyway.
  24. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
  25. modImplementation "io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2"
  26. include "io.github.cottonmc:cotton-client-commands:1.0.0+1.15.2"
  27. implementation 'com.google.code.gson:gson:2.8.6'
  28. }
  29. processResources {
  30. inputs.property "version", project.version
  31. from(sourceSets.main.resources.srcDirs) {
  32. include "fabric.mod.json"
  33. expand "version": project.version
  34. }
  35. from(sourceSets.main.resources.srcDirs) {
  36. exclude "fabric.mod.json"
  37. }
  38. }
  39. // ensure that the encoding is set to UTF-8, no matter what the system default is
  40. // this fixes some edge cases with special characters not displaying correctly
  41. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  42. tasks.withType(JavaCompile) {
  43. options.encoding = "UTF-8"
  44. }
  45. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  46. // if it is present.
  47. // If you remove this task, sources will not be generated.
  48. task sourcesJar(type: Jar, dependsOn: classes) {
  49. classifier = "sources"
  50. from sourceSets.main.allSource
  51. }
  52. jar {
  53. from "LICENSE"
  54. }
  55. // configure the maven publication
  56. publishing {
  57. publications {
  58. mavenJava(MavenPublication) {
  59. // add all the jars that should be included when publishing to maven
  60. artifact(jar) {
  61. builtBy remapJar
  62. }
  63. artifact(sourcesJar) {
  64. builtBy remapSourcesJar
  65. }
  66. }
  67. }
  68. // select the repositories you want to publish to
  69. repositories {
  70. // uncomment to publish to the local maven
  71. // mavenLocal()
  72. }
  73. }