void () { compileModules("project.main"); List<String> expected = new ArrayList<>(asList(apiJar)); if (isGradleOlderThan("3.5")) { expected.add(implJar); } if (isGradleNewerOrSameAs("7.1")) { expected.addAll(asList("build/tmp/compileJava/previous-compilation-data.bin", "api/build/tmp/compileJava/previous-compilation-data.bin", "impl/build/tmp/compileJava/previous-compilation-data.bin")); } assertThat(dirtyOutputRoots).containsExactlyInAnyOrderElementsOf(expected); assertThat(generatedFiles).containsOnly( Map.entry(mainRoot, Set.of("my/pack/App.class", "my/pack/Other.class")), Map.entry(apiMainRoot, Set.of("my/pack/Api.class")), Map.entry(implMainRoot, Set.of("my/pack/Impl.class")) ); assertCopied(mainRoot + "/my/pack/App.class"); assertNotCopied(testRoot + "/my/pack/AppTest.class"); assertCopied(apiMainRoot + "/my/pack/Api.class"); assertNotCopied(apiTestRoot + "my/pack/ApiTest.class"); assertCopied(implMainRoot + "/my/pack/Impl.class"); assertNotCopied(implTestRoot + "/my/pack/ImplTest.class"); }