use of org.gradle.ide.visualstudio.internal.CppSharedLibraryVisualStudioTargetBinary in project gradle by gradle.
the class VisualStudioPlugin method applyVisualStudioCurrentModelRules.
private void applyVisualStudioCurrentModelRules(final VisualStudioExtensionInternal extension) {
project.getComponents().withType(CppApplication.class).all(cppApplication -> {
DefaultVisualStudioProject vsProject = extension.getProjectRegistry().createProject(project.getName(), cppApplication.getName());
vsProject.getSourceFiles().from(cppApplication.getCppSource());
vsProject.getHeaderFiles().from(cppApplication.getHeaderFiles());
cppApplication.getBinaries().whenElementFinalized(CppExecutable.class, executable -> {
extension.getProjectRegistry().addProjectConfiguration(new CppApplicationVisualStudioTargetBinary(project.getName(), project.getPath(), cppApplication, executable, project.getLayout()));
});
});
project.afterEvaluate(proj -> {
project.getComponents().withType(CppLibrary.class).all(cppLibrary -> {
for (Linkage linkage : cppLibrary.getLinkage().get()) {
VisualStudioTargetBinary.ProjectType projectType = VisualStudioTargetBinary.ProjectType.DLL;
if (Linkage.STATIC.equals(linkage)) {
projectType = VisualStudioTargetBinary.ProjectType.LIB;
}
DefaultVisualStudioProject vsProject = extension.getProjectRegistry().createProject(project.getName() + projectType.getSuffix(), cppLibrary.getName());
vsProject.getSourceFiles().from(cppLibrary.getCppSource());
vsProject.getHeaderFiles().from(cppLibrary.getHeaderFiles());
}
cppLibrary.getBinaries().whenElementFinalized(CppSharedLibrary.class, library -> {
extension.getProjectRegistry().addProjectConfiguration(new CppSharedLibraryVisualStudioTargetBinary(project.getName(), project.getPath(), cppLibrary, library, project.getLayout()));
});
cppLibrary.getBinaries().whenElementFinalized(CppStaticLibrary.class, library -> {
extension.getProjectRegistry().addProjectConfiguration(new CppStaticLibraryVisualStudioTargetBinary(project.getName(), project.getPath(), cppLibrary, library, project.getLayout()));
});
});
});
}
Aggregations