Package org.gradle.api.internal.project

Examples of org.gradle.api.internal.project.ProjectInternal


    private final DefaultTaskExecuter executer = new DefaultTaskExecuter(listener);

    @Before
    public void setUp() {
        context.checking(new Expectations(){{
            ProjectInternal project = context.mock(ProjectInternal.class);

            allowing(task).getProject();
            will(returnValue(project));

            allowing(project).getBuildScriptSource();
View Full Code Here


        // they want a specific version etc.
        Configuration antlrConfiguration = project.getConfigurations().add(ANTLR_CONFIGURATION_NAME).setVisible(false)
                .setTransitive(false).setDescription("The Antlr libraries to be used for this project.");
        project.getConfigurations().getByName(COMPILE_CONFIGURATION_NAME).extendsFrom(antlrConfiguration);

        final ProjectInternal projectInternal = (ProjectInternal) project;
        project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().allObjects(
                new Action<SourceSet>() {
                    public void execute(SourceSet sourceSet) {
                        // for each source set we will:
                        // 1) Add a new 'antlr' virtual directory mapping
                        final AntlrSourceVirtualDirectoryImpl antlrDirectoryDelegate
                                = new AntlrSourceVirtualDirectoryImpl(((DefaultSourceSet) sourceSet).getDisplayName(),
                                projectInternal.getFileResolver());
                        ((DynamicObjectAware) sourceSet).getConvention().getPlugins().put(
                                AntlrSourceVirtualDirectory.NAME, antlrDirectoryDelegate);
                        final String srcDir = String.format("src/%s/antlr", sourceSet.getName());
                        antlrDirectoryDelegate.getAntlr().srcDir(srcDir);
                        sourceSet.getAllSource().add(antlrDirectoryDelegate.getAntlr());
View Full Code Here

    private final DependencyAutoWireTaskFactory factory = new DependencyAutoWireTaskFactory(delegate);

    @Test
    public void addsDependencyOnInputFiles() {
        final TaskInternal task = context.mock(TaskInternal.class);
        final ProjectInternal project = context.mock(ProjectInternal.class);
        final TaskInputs taskInputs = context.mock(TaskInputs.class);
        final FileCollection inputFiles = context.mock(FileCollection.class);

        context.checking(new Expectations() {{
            one(delegate).createTask(project, map());
View Full Code Here

    private final SkipTaskExecuter executer = new SkipTaskExecuter(delegate);

    @Before
    public void setUp() {
        context.checking(new Expectations(){{
            ProjectInternal project = context.mock(ProjectInternal.class);

            allowing(task).getProject();
            will(returnValue(project));

            allowing(project).getBuildScriptSource();
View Full Code Here

    protected AbstractModuleDependency createDependency(String group, String name, String version) {
        return createDependency(group, name, version, null);   
    }

    protected AbstractModuleDependency createDependency(String group, String name, String version, String configuration) {
        ProjectInternal dependencyProject = context.mock(ProjectInternal.class);
        DefaultProjectDependency projectDependency;
        if (configuration != null) {
            projectDependency = new DefaultProjectDependency(dependencyProject, configuration, instruction);
        } else {
            projectDependency = new DefaultProjectDependency(dependencyProject, instruction);
View Full Code Here

        this.localComponentFactory = localComponentFactory;
        this.projectRegistry = projectRegistry;
    }

    public LocalComponentMetaData getProject(String projectPath) {
        ProjectInternal project = projectRegistry.getProject(projectPath);
        return localComponentFactory.convert(project.getConfigurations(), project.getModule());
    }
View Full Code Here

        setDidWork(result.getDidWork());
    }

    private Compiler<GroovyJavaJointCompileSpec> getCompiler(GroovyJavaJointCompileSpec spec) {
        if (compiler == null) {
            ProjectInternal projectInternal = (ProjectInternal) getProject();
            CompilerDaemonManager compilerDaemonManager = getServices().get(CompilerDaemonManager.class);
            InProcessCompilerDaemonFactory inProcessCompilerDaemonFactory = getServices().get(InProcessCompilerDaemonFactory.class);
            JavaCompilerFactory javaCompilerFactory = getServices().get(JavaCompilerFactory.class);
            GroovyCompilerFactory groovyCompilerFactory = new GroovyCompilerFactory(projectInternal, javaCompilerFactory, compilerDaemonManager, inProcessCompilerDaemonFactory);
            Compiler<GroovyJavaJointCompileSpec> delegatingCompiler = groovyCompilerFactory.newCompiler(spec);
View Full Code Here

        this.projectLocator = projectLocator;
    }

    public VisualStudioProjectConfiguration lookupProjectConfiguration(NativeBinarySpec nativeBinary) {
        // Looks in the correct project registry for this binary
        ProjectInternal componentProject = getComponentProject(nativeBinary);
        VisualStudioExtension visualStudioExtension = componentProject.getModelRegistry().get(ModelPath.path("visualStudio"), ModelType.of(VisualStudioExtension.class));
        VisualStudioProjectRegistry projectRegistry = ((VisualStudioExtensionInternal) visualStudioExtension).getProjectRegistry();
        return projectRegistry.getProjectConfiguration(nativeBinary);
    }
View Full Code Here

        BuildCancellationToken cancellationToken = gradle.getServices().get(BuildCancellationToken.class);
        if (cancellationToken.isCancellationRequested()) {
            throw new BuildCancelledException(String.format("Could not build '%s' model. Build cancelled.", modelIdentifier.getName()));
        }
        ToolingModelBuilderRegistry modelBuilderRegistry;
        ProjectInternal project;
        boolean isImplicitProject;
        if (target == null) {
            project = gradle.getDefaultProject();
            isImplicitProject = true;
        } else if (target instanceof GradleProjectIdentity) {
            GradleProjectIdentity gradleProject = (GradleProjectIdentity) target;
            project = gradle.getRootProject().project(gradleProject.getPath());
            isImplicitProject = false;
        } else {
            throw new IllegalArgumentException("Don't know how to build models for " + target);
        }
        modelBuilderRegistry = project.getServices().get(ToolingModelBuilderRegistry.class);

        ToolingModelBuilder builder;
        try {
            builder = modelBuilderRegistry.getBuilder(modelIdentifier.getName());
        } catch (UnknownModelException e) {
View Full Code Here

        if (!path.contains(Project.PATH_SEPARATOR)) {
            return findByName(path);
        }

        String projectPath = StringUtils.substringBeforeLast(path, Project.PATH_SEPARATOR);
        ProjectInternal project = this.project.findProject(!GUtil.isTrue(projectPath) ? Project.PATH_SEPARATOR : projectPath);
        if (project == null) {
            return null;
        }
        projectAccessListener.beforeRequestingTaskByPath(project);

        return project.getTasks().findByName(StringUtils.substringAfterLast(path, Project.PATH_SEPARATOR));
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.project.ProjectInternal

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.