@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())); } }
public void source(FunctionalSourceSet sourceSet) { sourceSet.all( new Action<LanguageSourceSet>() { public void execute(LanguageSourceSet languageSourceSet) { source(languageSourceSet); } }); }
private FunctionalSourceSet createGoogleTestSources( final Instantiator instantiator, final String suiteName, ProjectSourceSet projectSourceSet, final FileResolver fileResolver) { final FunctionalSourceSet functionalSourceSet = instantiator.newInstance( DefaultFunctionalSourceSet.class, suiteName, instantiator, projectSourceSet); functionalSourceSet.registerFactory( CppSourceSet.class, new NamedDomainObjectFactory<CppSourceSet>() { public CppSourceSet create(String name) { return BaseLanguageSourceSet.create( DefaultCppSourceSet.class, name, suiteName, fileResolver, instantiator); } }); return functionalSourceSet; }