build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. plugins {
  2. id 'fabric-loom' version '0.2.2-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 "http://server.bbkr.space:8081/artifactory/libs-snapshot"
  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}"
  22. modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
  23. // Fabric API. This is technically optional, but you probably want it anyway.
  24. modCompile "net.fabricmc:fabric:${project.fabric_version}"
  25. modCompile("io.github.cottonmc:client-commands:${clientcommands_version}") {
  26. transitive = false
  27. }
  28. include("io.github.cottonmc:client-commands:${clientcommands_version}") {
  29. transitive = false
  30. }
  31. implementation 'com.google.code.gson:gson:2.8.5'
  32. }
  33. processResources {
  34. inputs.property "version", project.version
  35. from(sourceSets.main.resources.srcDirs) {
  36. include "fabric.mod.json"
  37. expand "version": project.version
  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. jar {
  57. from "LICENSE"
  58. }
  59. // configure the maven publication
  60. publishing {
  61. publications {
  62. mavenJava(MavenPublication) {
  63. // add all the jars that should be included when publishing to maven
  64. artifact(jar) {
  65. builtBy remapJar
  66. }
  67. artifact(sourcesJar) {
  68. builtBy remapSourcesJar
  69. }
  70. }
  71. }
  72. // select the repositories you want to publish to
  73. repositories {
  74. // uncomment to publish to the local maven
  75. // mavenLocal()
  76. }
  77. }