Build: Drop unused fromEmbeddedComponents helper
This commit is contained in:
@@ -121,7 +121,6 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
|
|||||||
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the regex
|
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the regex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = File(this.property("JDK_18") as String)): File? =
|
fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = File(this.property("JDK_18") as String)): File? =
|
||||||
paths.map { File(jdkHome, it) }.firstOrNull { it.exists() }.also {
|
paths.map { File(jdkHome, it) }.firstOrNull { it.exists() }.also {
|
||||||
if (it == null)
|
if (it == null)
|
||||||
@@ -137,20 +136,3 @@ val compilerManifestClassPath
|
|||||||
object EmbeddedComponents {
|
object EmbeddedComponents {
|
||||||
val CONFIGURATION_NAME = "embedded"
|
val CONFIGURATION_NAME = "embedded"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AbstractCopyTask.fromEmbeddedComponents() {
|
|
||||||
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
|
|
||||||
if (this is ShadowJar) {
|
|
||||||
from(embeddedComponents)
|
|
||||||
} else {
|
|
||||||
dependsOn(embeddedComponents)
|
|
||||||
from {
|
|
||||||
embeddedComponents.map { file ->
|
|
||||||
if (file.isDirectory)
|
|
||||||
project.files(file)
|
|
||||||
else
|
|
||||||
project.zipTree(file)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user