Advertisement
GeradesoLukas

Untitled

Nov 25th, 2023
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 2.45 KB | None | 0 0
  1. plugins {
  2.     id "com.github.johnrengelman.shadow" version "7.1.2"
  3. }
  4.  
  5. architectury {
  6.     platformSetupLoomIde()
  7.     fabric()
  8. }
  9.  
  10. loom {
  11.     accessWidenerPath = project(":common").loom.accessWidenerPath
  12. }
  13.  
  14. configurations {
  15.     common
  16.     shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files.
  17.     compileClasspath.extendsFrom common
  18.     runtimeClasspath.extendsFrom common
  19.     developmentFabric.extendsFrom common
  20. }
  21.  
  22. dependencies {
  23.     modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
  24.     modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
  25.     // Remove the next line if you don't want to depend on the API
  26.     modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
  27.     implementation("org.reflections:reflections:0.10.2")
  28.  
  29.     common(project(path: ":common", configuration: "namedElements")) { transitive false }
  30.     shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
  31.  
  32.     modImplementation "curse.maven:backpacked-fabric-667380:4728986"
  33.  
  34.     //modImplementation "com.mrcrayfish:framework-fabric:${minecraft_version}-${framework_version}"
  35.     modImplementation "curse.maven:framework-fabric-667391:4718252"
  36.     //modImplementation "dev.emi:trinkets:${trinkets_version}"
  37. }
  38.  
  39. processResources {
  40.     inputs.property "version", project.version
  41.  
  42.     filesMatching("fabric.mod.json") {
  43.         expand "version": project.version
  44.     }
  45. }
  46.  
  47. shadowJar {
  48.     exclude "architectury.common.json"
  49.  
  50.     configurations = [project.configurations.shadowCommon]
  51.     archiveClassifier = "dev-shadow"
  52. }
  53.  
  54. remapJar {
  55.     injectAccessWidener = true
  56.     input.set shadowJar.archiveFile
  57.     dependsOn shadowJar
  58. }
  59.  
  60. sourcesJar {
  61.     def commonSources = project(":common").sourcesJar
  62.     dependsOn commonSources
  63.     from commonSources.archiveFile.map { zipTree(it) }
  64. }
  65.  
  66. components.java {
  67.     withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
  68.         skip()
  69.     }
  70. }
  71.  
  72. publishing {
  73.     publications {
  74.         mavenFabric(MavenPublication) {
  75.             artifactId = rootProject.archives_base_name + "-" + project.name
  76.             from components.java
  77.         }
  78.     }
  79.  
  80.     // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  81.     repositories {
  82.         // Add repositories to publish to here.
  83.     }
  84. }
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement