Slackbot
06/22/2023, 6:52 AMephemient
06/22/2023, 6:55 AMVampire
06/22/2023, 6:56 AMVampire
06/22/2023, 6:59 AMJeff Lockhart
06/22/2023, 7:04 AMJeff Lockhart
06/22/2023, 7:06 AMephemient
06/22/2023, 7:31 AMVampire
06/22/2023, 7:34 AMephemient
06/22/2023, 7:47 AMabstract class CopyToTestWorkingDir @Inject constructor(private val files: Any) : Action<Task> {
@get:Inject
abstract val fileSystemOperations: FileSystemOperations
override fun execute(task: Task) {
fileSystemOperations.copy {
from(files)
into((task as KotlinNativeTest).workingDir)
}
}
}
kotlin.targets.withType<KotlinNativeTargetWithTests<*>> {
testRuns.all {
tasks.named("${target.name}${name.capitalized()}") {
val files = files("src/commonTest/resources")
inputs.files(files.asFileTree)
doFirst(objects.newInstance(CopyToTestWorkingDir::class, files))
}
}
}
would avoid the issues mentioned above, but you'd still have no way to get rid of stale resources in the destinationephemient
06/22/2023, 7:48 AMephemient
06/22/2023, 7:49 AMJeff Lockhart
06/22/2023, 7:52 AMassembleFrameworkWithResources that depends on the framework build task, but then copies both the binary compilation and the resources to yet another path. But then that could easily be confused and another user expect the framework build task to have created a complete useable framework.
For the test task, the task dependency has to be upstream from the task that eventually runs the tests from the location the binary was built in and those tests expect the resources to be present there at runtime.Jeff Lockhart
06/22/2023, 7:59 AMephemient
06/22/2023, 8:00 AMephemient
06/22/2023, 8:01 AMJeff Lockhart
06/22/2023, 8:04 AMVampire
06/22/2023, 9:05 AMwhen you need to add features to an existing plugin's tasksFor that you just add
doFirst or doLast actions to those tasksJeff Lockhart
06/22/2023, 5:33 PM