include dependencies with new task

This commit is contained in:
Brandon Davis 2020-05-12 12:49:44 -05:00
parent c61c984d6f
commit e1370c8157

View File

@ -1,3 +1,5 @@
import net.fabricmc.loom.task.RemapJarTask
plugins { plugins {
id 'fabric-loom' version '0.2.7-SNAPSHOT' id 'fabric-loom' version '0.2.7-SNAPSHOT'
} }
@ -12,7 +14,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:0.8.2+build.194" modImplementation "net.fabricmc:fabric-loader:0.8.2+build.194"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.5.1+build.294-1.15" modImplementation "net.fabricmc.fabric-api:fabric-api:0.5.1+build.294-1.15"
include (project(':BlueMapCommon')) { compile (project(':BlueMapCommon')) {
//exclude dependencies provided by fabric //exclude dependencies provided by fabric
exclude group: 'com.google.guava', module: 'guava' exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.google.code.gson', module: 'gson' exclude group: 'com.google.code.gson', module: 'gson'
@ -22,19 +24,6 @@ dependencies {
} }
} }
build.dependsOn shadowJar {
destinationDir = file '../build/unsupported'
archiveFileName = "BlueMap-${version}-fabric.jar"
configurations = [project.configurations.include]
//relocate 'com.flowpowered.math', 'de.bluecolored.shadow.flowpowered.math' //DON'T relocate this, because the API depends on it
relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config'
relocate 'net.querz.nbt', 'de.bluecolored.shadow.querz.nbt'
relocate 'ninja.leaping.configurate', 'de.bluecolored.shadow.ninja.leaping.configurate'
relocate 'org.yaml.snakeyaml', 'de.bluecolored.shadow.yaml.snakeyaml'
}
processResources { processResources {
inputs.property "version", project.version inputs.property "version", project.version
@ -48,6 +37,32 @@ processResources {
} }
} }
shadowJar {
configurations = [project.configurations.compile]
dependencies {
include(dependency(':BlueMapCommon'))
include(dependency(':BlueMapCore'))
include(dependency(':BlueMapAPI'))
}
//relocate 'com.flowpowered.math', 'de.bluecolored.shadow.flowpowered.math' //DON'T relocate this, because the API depends on it
relocate 'com.typesafe.config', 'de.bluecolored.shadow.typesafe.config'
relocate 'net.querz.nbt', 'de.bluecolored.shadow.querz.nbt'
relocate 'ninja.leaping.configurate', 'de.bluecolored.shadow.ninja.leaping.configurate'
relocate 'org.yaml.snakeyaml', 'de.bluecolored.shadow.yaml.snakeyaml'
exclude '/mappings/*'
}
task ramappedShadowJar(type: RemapJarTask) {
destinationDir = file '../build/unsupported'
dependsOn tasks.shadowJar
input = tasks.shadowJar.archivePath
addNestedDependencies = true
archiveName = "BlueMap-${version}-fabric.jar"
}
task sourcesJar(type: Jar, dependsOn: classes) { task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources" classifier = "sources"
from sourceSets.main.allSource from sourceSets.main.allSource