shadow yaml lib

This commit is contained in:
Flemmli97 2021-06-13 23:07:10 +02:00
parent 5210abf70f
commit 3c578b8cc7
3 changed files with 33 additions and 15 deletions

View File

@ -1,15 +1,39 @@
plugins {
id "com.github.johnrengelman.shadow" version "5.0.0"
}
configurations {
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
}
dependencies { dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader // Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}" modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.25' implementation group: 'org.yaml', name: 'snakeyaml', version: '1.25'
include group: 'org.yaml', name: 'snakeyaml', version: '1.25' shadowCommon group: 'org.yaml', name: 'snakeyaml', version: '1.25'
} }
architectury { architectury {
common() common()
} }
shadowJar {
configurations = [project.configurations.shadowCommon]
}
// Use the shadow jar instead of normal jar to shadow yaml lib properly into fabric builds
transformProductionFabric {
dependsOn shadowJar
input.set shadowJar.archiveFile
}
// Use the shadow jar instead of normal jar to shadow yaml lib properly into forge builds
transformProductionForge {
dependsOn shadowJar
input.set shadowJar.archiveFile
}
java { java {
withSourcesJar() withSourcesJar()
} }

View File

@ -1,9 +1,3 @@
buildscript {
dependencies {
classpath group: 'com.diluv.schoomp', name: 'Schoomp', version: '1.1.0'
}
}
plugins { plugins {
id "com.github.johnrengelman.shadow" version "5.0.0" id "com.github.johnrengelman.shadow" version "5.0.0"
} }
@ -89,6 +83,7 @@ sourcesJar {
def commonSources = project(":common").sourcesJar def commonSources = project(":common").sourcesJar
dependsOn commonSources dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) } from commonSources.archiveFile.map { zipTree(it) }
classifier "fabric-source"
} }
publishing { publishing {
@ -102,13 +97,12 @@ publishing {
builtBy remapSourcesJar builtBy remapSourcesJar
} }
artifactId project.archives_base_name artifactId project.archives_base_name
version project.version + "-fabric" version project.version
} }
} }
repositories { repositories {
mavenLocal() maven {
/*maven {
url "https://gitlab.com/api/v4/projects/21830712/packages/maven" url "https://gitlab.com/api/v4/projects/21830712/packages/maven"
//url "https://maven.pkg.github.com/flemmli97/<>" //url "https://maven.pkg.github.com/flemmli97/<>"
credentials { credentials {
@ -116,6 +110,6 @@ publishing {
password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN") password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN")
//password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN") //password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN")
} }
}*/ }
} }
} }

View File

@ -63,6 +63,7 @@ sourcesJar {
def commonSources = project(":common").sourcesJar def commonSources = project(":common").sourcesJar
dependsOn commonSources dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) } from commonSources.archiveFile.map { zipTree(it) }
classifier "forge-sources"
} }
publishing { publishing {
@ -76,13 +77,12 @@ publishing {
builtBy remapSourcesJar builtBy remapSourcesJar
} }
artifactId project.archives_base_name artifactId project.archives_base_name
version project.version + "-forge" version project.version
} }
} }
repositories { repositories {
mavenLocal() maven {
/*maven {
url "https://gitlab.com/api/v4/projects/21830712/packages/maven" url "https://gitlab.com/api/v4/projects/21830712/packages/maven"
//url "https://maven.pkg.github.com/flemmli97/<>" //url "https://maven.pkg.github.com/flemmli97/<>"
credentials { credentials {
@ -90,6 +90,6 @@ publishing {
password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN") password = project.findProperty("gpr.gitlab.token") ?: System.getenv("GPR_GITLAB_TOKEN")
//password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN") //password = project.findProperty("gpr.github.token") ?: System.getenv("GPR_TOKEN")
} }
}*/ }
} }
} }