I’m having an apparent issue with a Sync task where it logs (and presumably unzips) each file four times rather than the expected once. The main parts of the cut-down build.gradle I created are below; the real one contains 15+ dependencies and takes over 15 minutes
configurations {
thirdparty
}
dependencies {
thirdparty 'com.github:lib_jansson:2.11'
}
task syncThirdPartyFolders(type: Sync) {
from {
configurations.thirdparty.collect {
println("File: " + it)
zipTree(it)
}
}
into "ThirdParty"
}
The console output:
C:\test\TestingGradleSync>gradle syncThirdPartyFolders
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\ExternalTools\android_sdk_r24\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
Incremental java compilation is an incubating feature.
File: C:\Users\me\.gradle\caches\modules-2\files-2.1\com.github\lib_jansson\2.11\e46ccdc64bc97102df2eb55ae0639d2c1a879091\lib_jansson-2.11.zip
:syncThirdPartyFolders
File: C:\Users\me\.gradle\caches\modules-2\files-2.1\com.github\lib_jansson\2.11\e46ccdc64bc97102df2eb55ae0639d2c1a879091\lib_jansson-2.11.zip
File: C:\Users\me\.gradle\caches\modules-2\files-2.1\com.github\lib_jansson\2.11\e46ccdc64bc97102df2eb55ae0639d2c1a879091\lib_jansson-2.11.zip
File: C:\Users\me\.gradle\caches\modules-2\files-2.1\com.github\lib_jansson\2.11\e46ccdc64bc97102df2eb55ae0639d2c1a879091\lib_jansson-2.11.zip
BUILD SUCCESSFUL
Total time: 9.75 secs
I’m curious as to whether this is some gross misuse of Sync tasks, and/or whether there’s a straightforward solution to get this task to process each dependency only once.