Examples of ProjectSourceSet


Examples of org.gradle.language.base.ProjectSourceSet

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

        LanguageRegistry languageRegistry = project.getExtensions().create("languages", DefaultLanguageRegistry.class);
        ProjectSourceSet sources = project.getExtensions().getByType(ProjectSourceSet.class);

        DefaultComponentSpecContainer components = project.getExtensions().create("componentSpecs", DefaultComponentSpecContainer.class, instantiator);
        modelRegistry.create(
                ModelCreators.of(ModelReference.of("components", DefaultComponentSpecContainer.class), components)
                        .simpleDescriptor("Project.<init>.components()")
View Full Code Here

Examples of org.gradle.language.base.ProjectSourceSet

    }

    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));
View Full Code Here

Examples of org.gradle.language.base.ProjectSourceSet

            this.instantiator = instantiator;
        }

        public void execute(final RegistrationContext<ComponentSpec, BaseComponentSpec> context) {
            ExtensionContainer extensions = context.getExtensions();
            ProjectSourceSet projectSourceSet = extensions.getByType(ProjectSourceSet.class);
            ComponentSpecContainer componentSpecs = extensions.getByType(ComponentSpecContainer.class);
            doRegister(context.getType(), context.getImplementation(), projectSourceSet, componentSpecs, context.getProjectIdentifier());
        }
View Full Code Here

Examples of org.gradle.language.base.ProjectSourceSet

            // Ignore for now
        }

        renderer.renderComponents(components);

        ProjectSourceSet sourceSets = project.getExtensions().findByType(ProjectSourceSet.class);
        if (sourceSets != null) {
            renderer.renderSourceSets(sourceSets);
        }
        BinaryContainer binaries = project.getExtensions().findByType(BinaryContainer.class);
        if (binaries != null) {
View Full Code Here

Examples of org.gradle.language.base.ProjectSourceSet

        configureBuildDependents(project);
    }

    private void configureSourceSetDefaults(final JavaPluginConvention pluginConvention) {
        final Project project = pluginConvention.getProject();
        final ProjectSourceSet projectSourceSet = project.getExtensions().getByType(ProjectSourceSet.class);

        pluginConvention.getSourceSets().all(new Action<SourceSet>() {
            public void execute(final SourceSet sourceSet) {
                ConventionMapping outputConventionMapping = ((IConventionAware) sourceSet.getOutput()).getConventionMapping();

                ConfigurationContainer configurations = project.getConfigurations();

                Configuration compileConfiguration = configurations.findByName(sourceSet.getCompileConfigurationName());
                if (compileConfiguration == null) {
                    compileConfiguration = configurations.create(sourceSet.getCompileConfigurationName());
                }
                compileConfiguration.setVisible(false);
                compileConfiguration.setDescription(String.format("Compile classpath for %s.", sourceSet));

                Configuration runtimeConfiguration = configurations.findByName(sourceSet.getRuntimeConfigurationName());
                if (runtimeConfiguration == null) {
                    runtimeConfiguration = configurations.create(sourceSet.getRuntimeConfigurationName());
                }
                runtimeConfiguration.setVisible(false);
                runtimeConfiguration.extendsFrom(compileConfiguration);
                runtimeConfiguration.setDescription(String.format("Runtime classpath for %s.", sourceSet));

                sourceSet.setCompileClasspath(compileConfiguration);
                sourceSet.setRuntimeClasspath(sourceSet.getOutput().plus(runtimeConfiguration));

                outputConventionMapping.map("classesDir", new Callable<Object>() {
                    public Object call() throws Exception {
                        String classesDirName = String.format("classes/%s", sourceSet.getName());
                        return new File(project.getBuildDir(), classesDirName);
                    }
                });
                outputConventionMapping.map("resourcesDir", new Callable<Object>() {
                    public Object call() throws Exception {
                        String classesDirName = String.format("resources/%s", sourceSet.getName());
                        return new File(project.getBuildDir(), classesDirName);
                    }
                });

                sourceSet.getJava().srcDir(String.format("src/%s/java", sourceSet.getName()));
                sourceSet.getResources().srcDir(String.format("src/%s/resources", sourceSet.getName()));
                sourceSet.compiledBy(sourceSet.getClassesTaskName());

                FunctionalSourceSet functionalSourceSet = projectSourceSet.create(sourceSet.getName());
                Classpath compileClasspath = new SourceSetCompileClasspath(sourceSet);
                DefaultJavaSourceSet javaSourceSet = instantiator.newInstance(DefaultJavaSourceSet.class, "java", sourceSet.getJava(), compileClasspath, functionalSourceSet);
                functionalSourceSet.add(javaSourceSet);
                JvmResourceSet resourceSet = instantiator.newInstance(DefaultJvmResourceSet.class, "resources", sourceSet.getResources(), functionalSourceSet);
                functionalSourceSet.add(resourceSet);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.