@Finalize public void configureGoogleTestTestSuiteSources( TestSuiteContainer testSuites, @Path("buildDir") File buildDir) { for (final GoogleTestTestSuiteSpec suite : testSuites.withType(GoogleTestTestSuiteSpec.class)) { FunctionalSourceSet suiteSourceSet = ((ComponentSpecInternal) suite).getSources(); CppSourceSet testSources = suiteSourceSet.maybeCreate("cpp", CppSourceSet.class); testSources.getSource().srcDir(String.format("src/%s/%s", suite.getName(), "cpp")); testSources.getExportedHeaders().srcDir(String.format("src/%s/headers", suite.getName())); } }