mikehearn
10/28/2021, 4:27 PMval linkJars by tasks.registering {
dependsOn("jar")
val jar: Jar by tasks
doLast {
val archiveFile = jar.archiveFile.get().asFile
println("JAR outputs: $archiveFile")
val o = mkdir("$buildDir/all-libs")
o.listFiles().forEach { it.delete() }
for (file in sourceSets.named("main").get().runtimeClasspath.files + archiveFile) {
if (!file.exists() || file.isDirectory) continue
val dest = o.resolve(file.name).toPath()
Files.createLink(dest, file.toPath())
}
}
}