void () { compileModules("project.main"); setFileContent(implFile, IMPL_JAVA_WITH_NEW_METHOD, false); clearOutputs(); compileModules("project.main"); List<String> expected = new ArrayList<>(); if (isGradleOlderThan("3.5")) { expected.add(implJar); } if (isGradleNewerOrSameAs("7.1")) { expected.add("impl/build/tmp/compileJava/previous-compilation-data.bin"); } assertThat(dirtyOutputRoots).as("Dirty output roots").containsExactlyInAnyOrderElementsOf(expected); // note that the "implJar" is not marked as a generated file // this is jar itself is marked as dirty root assertThat(generatedFiles).as("Generated files").containsOnly( Map.entry(implMainRoot, Set.of("my/pack/Impl.class")) ); }