Package org.gradle.platform.base

Examples of org.gradle.platform.base.ComponentSpecContainer


    public void apply(final ProjectInternal project) {
        project.apply(Collections.singletonMap("plugin", ComponentModelBasePlugin.class));

        ProjectSourceSet sources = project.getExtensions().getByType(ProjectSourceSet.class);
        ComponentSpecContainer components = project.getExtensions().getByType(ComponentSpecContainer.class);
        components.registerFactory(NativeExecutableSpec.class, new NativeExecutableSpecFactory(instantiator, sources, project));
        NamedDomainObjectContainer<NativeExecutableSpec> nativeExecutables = components.containerWithType(NativeExecutableSpec.class);

        components.registerFactory(NativeLibrarySpec.class, new NativeLibrarySpecFactory(instantiator, sources, project));
        NamedDomainObjectContainer<NativeLibrarySpec> nativeLibraries = components.containerWithType(NativeLibrarySpec.class);

        project.getExtensions().create("nativeRuntime", DefaultNativeComponentExtension.class, nativeExecutables, nativeLibraries);

        // TODO:DAZ Remove these: should not pollute the global namespace
        project.getExtensions().add("nativeComponents", components.withType(NativeComponentSpec.class));
        project.getExtensions().add("executables", nativeExecutables);
        project.getExtensions().add("libraries", nativeLibraries);

        instantiateDefaultPlatforms();
    }
View Full Code Here


    }

    // Converts the binaries of a project library into regular binary instances
    public DomainObjectSet<NativeLibraryBinary> getBinaries(NativeLibraryRequirement requirement) {
        Project project = findProject(requirement);
        ComponentSpecContainer componentSpecContainer = project.getExtensions().findByType(ComponentSpecContainer.class);
        if (componentSpecContainer == null) {
            throw new LibraryResolveException(String.format("Project does not have a libraries container: '%s'", project.getPath()));
        }
        DomainObjectSet<NativeBinarySpec> projectBinaries = componentSpecContainer.withType(NativeLibrarySpec.class).getByName(requirement.getLibraryName()).getNativeBinaries();
        DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
        // TODO:DAZ Convert, don't cast
        for (NativeBinarySpec nativeBinarySpec : projectBinaries) {
            binaries.add((NativeLibraryBinary) nativeBinarySpec);
        }
View Full Code Here

        renderer.setOutput(textOutput);

        renderer.startProject(project);

        Collection<ComponentSpec> components = new ArrayList<ComponentSpec>();
        ComponentSpecContainer componentSpecs = project.getExtensions().findByType(ComponentSpecContainer.class);
        if (componentSpecs != null) {
            components.addAll(componentSpecs);
        }

        try {
View Full Code Here

TOP

Related Classes of org.gradle.platform.base.ComponentSpecContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.