[native] copy files into all install directories

Hi Ralf,

I think this will do what you want. It adds an action to the end of the install task for each binary to copy your runtime files. It also adds those files as inputs to the task so if you change those files the up-to-date check will fail and cause the task to run again.

binaries.withType(NativeExecutableBinarySpec) { bin ->
    bin.tasks.withType(InstallExecutable) { installTask ->
        def runtimeFiles = myRuntimeFiles()
        installTask.inputs.files runtimeFiles
        installTask << {
            fileOperations.copy(new Action<CopySpec>() {
                void execute(CopySpec copySpec) {
                    copySpec.into(installTask.destinationDir)
                    copySpec.from(runtimeFiles)
                }   
            })  
        }   
    }   
}
1 Like