Search in sources :

Example 1 with CppApplicationVisualStudioTargetBinary

use of org.gradle.ide.visualstudio.internal.CppApplicationVisualStudioTargetBinary in project gradle by gradle.

the class VisualStudioPlugin method applyVisualStudioCurrentModelRules.

private void applyVisualStudioCurrentModelRules(final VisualStudioExtensionInternal extension) {
    project.getComponents().withType(CppApplication.class).all(new Action<CppApplication>() {

        @Override
        public void execute(final CppApplication cppApplication) {
            cppApplication.getBinaries().whenElementFinalized(CppExecutable.class, new Action<CppExecutable>() {

                @Override
                public void execute(CppExecutable executable) {
                    extension.getProjectRegistry().addProjectConfiguration(new CppApplicationVisualStudioTargetBinary(project.getName(), project.getPath(), cppApplication, executable));
                }
            });
        }
    });
    project.getComponents().withType(CppLibrary.class).all(new Action<CppLibrary>() {

        @Override
        public void execute(final CppLibrary cppLibrary) {
            cppLibrary.getBinaries().whenElementFinalized(CppSharedLibrary.class, new Action<CppSharedLibrary>() {

                @Override
                public void execute(CppSharedLibrary library) {
                    extension.getProjectRegistry().addProjectConfiguration(new CppSharedLibraryVisualStudioTargetBinary(project.getName(), project.getPath(), cppLibrary, library));
                }
            });
            cppLibrary.getBinaries().whenElementFinalized(CppStaticLibrary.class, new Action<CppStaticLibrary>() {

                @Override
                public void execute(CppStaticLibrary library) {
                    extension.getProjectRegistry().addProjectConfiguration(new CppStaticLibraryVisualStudioTargetBinary(project.getName(), project.getPath(), cppLibrary, library));
                }
            });
        }
    });
}
Also used : CppApplicationVisualStudioTargetBinary(org.gradle.ide.visualstudio.internal.CppApplicationVisualStudioTargetBinary) Action(org.gradle.api.Action) CppLibrary(org.gradle.language.cpp.CppLibrary) CppStaticLibraryVisualStudioTargetBinary(org.gradle.ide.visualstudio.internal.CppStaticLibraryVisualStudioTargetBinary) CppApplication(org.gradle.language.cpp.CppApplication) CppSharedLibraryVisualStudioTargetBinary(org.gradle.ide.visualstudio.internal.CppSharedLibraryVisualStudioTargetBinary) CppStaticLibrary(org.gradle.language.cpp.CppStaticLibrary) CppExecutable(org.gradle.language.cpp.CppExecutable) CppSharedLibrary(org.gradle.language.cpp.CppSharedLibrary)

Aggregations

Action (org.gradle.api.Action)1 CppApplicationVisualStudioTargetBinary (org.gradle.ide.visualstudio.internal.CppApplicationVisualStudioTargetBinary)1 CppSharedLibraryVisualStudioTargetBinary (org.gradle.ide.visualstudio.internal.CppSharedLibraryVisualStudioTargetBinary)1 CppStaticLibraryVisualStudioTargetBinary (org.gradle.ide.visualstudio.internal.CppStaticLibraryVisualStudioTargetBinary)1 CppApplication (org.gradle.language.cpp.CppApplication)1 CppExecutable (org.gradle.language.cpp.CppExecutable)1 CppLibrary (org.gradle.language.cpp.CppLibrary)1 CppSharedLibrary (org.gradle.language.cpp.CppSharedLibrary)1 CppStaticLibrary (org.gradle.language.cpp.CppStaticLibrary)1