We are using gradle 2.1 and deleting files in buildSrc can cause subsequent build to fail.
The scenario is: 1. Add groovy and groovy test to buildSrc 2. run assemble (we are using android) 3. Delete the test files 4. run assemble again. 5. Notice buildSrc:test will still be run again even though there is no test anymore.
The workaround is to manually remove buildSrc/build folder