Abandoned Fabric mod - mid-April 2019
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.

build.gradle 1.9KB

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