use of org.gradle.nativeplatform.internal.CompilerOutputFileNamingSchemeFactory in project gradle by gradle.
the class CppModelBuilder method buildAll.
@Override
public Object buildAll(String modelName, Project project) {
DefaultProjectIdentifier projectIdentifier = new DefaultProjectIdentifier(project.getRootDir(), project.getPath());
CompilerOutputFileNamingSchemeFactory namingSchemeFactory = new CompilerOutputFileNamingSchemeFactory(((ProjectInternal) project).getFileResolver());
DefaultCppComponentModel mainComponent = null;
CppApplication application = project.getComponents().withType(CppApplication.class).findByName("main");
if (application != null) {
mainComponent = new DefaultCppApplicationModel(application.getName(), application.getBaseName().get(), binariesFor(application, application.getPrivateHeaderDirs(), projectIdentifier, namingSchemeFactory));
} else {
DefaultCppLibrary library = (DefaultCppLibrary) project.getComponents().withType(CppLibrary.class).findByName("main");
if (library != null) {
mainComponent = new DefaultCppLibraryModel(library.getName(), library.getBaseName().get(), binariesFor(library, library.getAllHeaderDirs(), projectIdentifier, namingSchemeFactory));
}
}
DefaultCppComponentModel testComponent = null;
CppTestSuite testSuite = project.getComponents().withType(CppTestSuite.class).findByName("test");
if (testSuite != null) {
testComponent = new DefaultCppTestSuiteModel(testSuite.getName(), testSuite.getBaseName().get(), binariesFor(testSuite, testSuite.getPrivateHeaderDirs(), projectIdentifier, namingSchemeFactory));
}
return new DefaultCppProjectModel(projectIdentifier, mainComponent, testComponent);
}
Aggregations