Advertisement
supersaiyansubtlety

build.gradle

Oct 23rd, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. plugins {
  2. id 'fabric-loom' version '0.2.7-SNAPSHOT'
  3. id 'maven-publish'
  4. }
  5.  
  6. sourceCompatibility = JavaVersion.VERSION_1_8
  7. targetCompatibility = JavaVersion.VERSION_1_8
  8.  
  9. archivesBaseName = project.archives_base_name
  10. version = project.mod_version + "+" + project.minecraft_version
  11. group = project.maven_group
  12.  
  13. repositories {
  14. mavenCentral()
  15. maven { url "https://server.bbkr.space/artifactory/libs-release" }
  16.  
  17. maven {
  18. name = "CurseMaven"
  19. url = "https://www.cursemaven.com"
  20. }
  21.  
  22. //JITPACK MUST BE LAST!
  23. maven {
  24. name "jitpack"
  25. url "https://jitpack.io"
  26. }
  27. }
  28.  
  29. dependencies {
  30. //to change the versions see the gradle.properties file
  31. minecraft "com.mojang:minecraft:" + project.minecraft_version
  32. mappings "net.fabricmc:yarn:" + project.yarn_mappings
  33. modImplementation "net.fabricmc:fabric-loader:" + project.loader_version
  34.  
  35. // Fabric API. This is technically optional, but you probably want it anyway.
  36. modImplementation "net.fabricmc.fabric-api:fabric-api:" + project.fabric_api_version
  37.  
  38. // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
  39. // You may need to force-disable transitiveness on them.
  40. }
  41.  
  42. minecraft {
  43. accessWidener file("src/main/resources/${project.mod_id}.accesswidener")
  44. }
  45.  
  46. processResources {
  47. inputs.property "version", project.version
  48. inputs.property "mod_id", project.mod_id
  49.  
  50. from(sourceSets.main.resources.srcDirs) {
  51. include "fabric.mod.json"
  52. expand ([
  53. "minecraft_version": project.minecraft_version,
  54. "min_minecraft_version": project.min_minecraft_version,
  55. "loader_version": project.loader_version,
  56.  
  57. "mod_id": project.mod_id,
  58. "InitClass": project.InitClass,
  59. "mod_version": project.version,
  60. "maven_group": project.maven_group,
  61. "archives_base_name": project.archives_base_name,
  62. "authors": project.authors,
  63.  
  64. "fabric_api_version": project.fabric_api_version
  65. ])
  66. }
  67.  
  68. from(sourceSets.main.resources.srcDirs) {
  69. exclude "fabric.mod.json"
  70. }
  71. }
  72.  
  73. // ensure that the encoding is set to UTF-8, no matter what the system default is
  74. // this fixes some edge cases with special characters not displaying correctly
  75. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  76. tasks.withType(JavaCompile) {
  77. options.encoding = "UTF-8"
  78. }
  79.  
  80. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  81. // if it is present.
  82. // If you remove this task, sources will not be generated.
  83. task sourcesJar(type: Jar, dependsOn: classes) {
  84. classifier = "sources"
  85. from sourceSets.main.allSource
  86. }
  87.  
  88. jar {
  89. from "LICENSE"
  90. }
  91.  
  92. // configure the maven publication
  93. publishing {
  94. publications {
  95. mavenJava(MavenPublication) {
  96. // add all the jars that should be included when publishing to maven
  97. artifact(remapJar) {
  98. builtBy remapJar
  99. }
  100. artifact(sourcesJar) {
  101. builtBy remapSourcesJar
  102. }
  103. }
  104. }
  105.  
  106. // select the repositories you want to publish to
  107. repositories {
  108. // uncomment to publish to the local maven
  109. // mavenLocal()
  110. }
  111. }
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement