singleOutputFile() method used Task.getProject() and that's not allowed with CC

Required for KTI-1553
This commit is contained in:
cristiangarcia
2024-02-08 22:10:29 +01:00
committed by Space Team
parent 21fff5634e
commit cb0d78d443
6 changed files with 13 additions and 12 deletions
@@ -83,7 +83,7 @@ val relocatedJar by task<ShadowJar> {
val normalizeComponentsXmlEndings by tasks.registering {
dependsOn(relocatedJar)
val outputFile = layout.buildDirectory.file("$name/${ComponentsXmlResourceTransformer.COMPONENTS_XML_PATH}")
val relocatedJarFile = project.provider { relocatedJar.get().singleOutputFile() }
val relocatedJarFile = relocatedJar.map { it.singleOutputFile(layout) }
val archiveOperations = serviceOf<ArchiveOperations>()
outputs.file(outputFile)
@@ -105,14 +105,14 @@ val normalizedJar by task<Jar> {
archiveClassifier.set("normalized")
from {
zipTree(relocatedJar.get().singleOutputFile()).matching {
zipTree(relocatedJar.get().singleOutputFile(layout)).matching {
exclude(ComponentsXmlResourceTransformer.COMPONENTS_XML_PATH)
}
}
into(ComponentsXmlResourceTransformer.COMPONENTS_XML_PATH.substringBeforeLast("/")) {
from {
normalizeComponentsXmlEndings.get().singleOutputFile()
normalizeComponentsXmlEndings.map { it.singleOutputFile(layout) }
}
}
}
@@ -156,7 +156,7 @@ val resultJar by task<Jar> {
dependsOn(pack)
setupPublicJar(jarBaseName)
from {
zipTree(pack.get().singleOutputFile())
zipTree(pack.map { it.singleOutputFile(layout) })
}
}