Discard derived data directory when on non-incremental change
lacasseio opened this issue · comments
As an Apple developer using Xcode/Gradle, I want the Xcode target build to provide accurate up-to-date information when the plugin is built adapter upgraded so that I can trust the build result.
When upgrading the build adapter plugin, we have a technical gap where changes to the plugin or task may result in executing an incremental build to the eye of xcodebuild
instead of a full rebuild. We can't trust the intermediate state of the target build task; hence we needs discard it. Technically, we should clear the derived data directory on non-incremental change, i.e. when the build classpath change.
Although we answered the original question of what happens to task incrementality, we can't act on this issue just yet because we don't have a technical solution to the problem, which is how we can detect a build classpath change.
Working on #799 shows that this is so solvable with Gradle APIs. Unfortunately, Gradle doesn't expose the correct API to differentiate what kind of input changes between output files vs build classpath. In our case, adding new input files will automatically add new output files, which causes a non-incremental change. There doesn't seems to be a way to surgically sync files from one folder to another without triggering non-incremental change upon adding files.