org.gradle.api.internal.tasks.TaskDependencyResolveContext Java Examples

The following examples show how to use org.gradle.api.internal.tasks.TaskDependencyResolveContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TasksFromDependentProjects.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    Project thisProject = context.getTask().getProject();
    Set<Task> tasksWithName = thisProject.getRootProject().getTasksByName(taskName, true);
    for (Task nextTask : tasksWithName) {
        boolean isDependency = checker.isDependent(thisProject, configurationName, nextTask.getProject());
        if (isDependency) {
            context.add(nextTask);
        }
    }
}
 
Example #2
Source File: CompositeFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Allows subclasses to add additional dependencies
 * @param context The context to add dependencies to.
 */
protected void addDependencies(TaskDependencyResolveContext context) {
    BuildDependenciesOnlyFileCollectionResolveContext fileContext = new BuildDependenciesOnlyFileCollectionResolveContext();
    resolve(fileContext);
    for (Buildable buildable : fileContext.resolveAsBuildables()) {
        context.add(buildable);
    }
}
 
Example #3
Source File: CompositeFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public TaskDependency getBuildDependencies() {
    return new AbstractTaskDependency() {
        public void resolve(TaskDependencyResolveContext context) {
            addDependencies(context);
        }
    };
}
 
Example #4
Source File: DefaultProjectDependency.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    if (!buildProjectDependencies) {
        return;
    }
    projectAccessListener.beforeResolvingProjectDependency(dependencyProject);

    Configuration configuration = getProjectConfiguration();
    context.add(configuration);
    context.add(configuration.getAllArtifacts());
}
 
Example #5
Source File: CompositeFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Allows subclasses to add additional dependencies
 * @param context The context to add dependencies to.
 */
protected void addDependencies(TaskDependencyResolveContext context) {
    BuildDependenciesOnlyFileCollectionResolveContext fileContext = new BuildDependenciesOnlyFileCollectionResolveContext();
    resolve(fileContext);
    for (Buildable buildable : fileContext.resolveAsBuildables()) {
        context.add(buildable);
    }
}
 
Example #6
Source File: CompositeFileCollection.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public TaskDependency getBuildDependencies() {
    return new AbstractTaskDependency() {
        public void resolve(TaskDependencyResolveContext context) {
            addDependencies(context);
        }
    };
}
 
Example #7
Source File: DefaultProjectDependency.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    if (!buildProjectDependencies) {
        return;
    }
    projectAccessListener.beforeResolvingProjectDependency(dependencyProject);

    Configuration configuration = getProjectConfiguration();
    context.add(configuration);
    context.add(configuration.getAllArtifacts());
}
 
Example #8
Source File: TasksFromProjectDependencies.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
void resolveProjectDependencies(TaskDependencyResolveContext context, Set<ProjectDependency> projectDependencies) {
    for (ProjectDependency projectDependency : projectDependencies) {
        //in configure-on-demand we don't know if the project was configured, hence explicit evaluate.
        // Not especially tidy, we should clean this up while working on new configuration model.
        ((ProjectInternal) projectDependency.getDependencyProject()).evaluate();

        Task nextTask = projectDependency.getDependencyProject().getTasks().findByName(taskName);
        if (nextTask != null) {
            context.add(nextTask);
        }
    }
}
 
Example #9
Source File: TasksFromDependentProjects.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    Project thisProject = context.getTask().getProject();
    Set<Task> tasksWithName = thisProject.getRootProject().getTasksByName(taskName, true);
    for (Task nextTask : tasksWithName) {
        boolean isDependency = checker.isDependent(thisProject, configurationName, nextTask.getProject());
        if (isDependency) {
            context.add(nextTask);
        }
    }
}
 
Example #10
Source File: CompositeFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Allows subclasses to add additional dependencies
 * @param context The context to add dependencies to.
 */
protected void addDependencies(TaskDependencyResolveContext context) {
    BuildDependenciesOnlyFileCollectionResolveContext fileContext = new BuildDependenciesOnlyFileCollectionResolveContext();
    resolve(fileContext);
    for (Buildable buildable : fileContext.resolveAsBuildables()) {
        context.add(buildable);
    }
}
 
Example #11
Source File: CompositeFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public TaskDependency getBuildDependencies() {
    return new AbstractTaskDependency() {
        public void resolve(TaskDependencyResolveContext context) {
            addDependencies(context);
        }
    };
}
 
Example #12
Source File: DefaultProjectDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    if (!buildProjectDependencies) {
        return;
    }
    projectAccessListener.beforeResolvingProjectDependency(dependencyProject);

    Configuration configuration = getProjectConfiguration();
    context.add(configuration);
    context.add(configuration.getAllArtifacts());
}
 
Example #13
Source File: TasksFromProjectDependencies.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
void resolveProjectDependencies(TaskDependencyResolveContext context, Set<ProjectDependency> projectDependencies) {
    for (ProjectDependency projectDependency : projectDependencies) {
        //in configure-on-demand we don't know if the project was configured, hence explicit evaluate.
        // Not especially tidy, we should clean this up while working on new configuration model.
        ((ProjectInternal) projectDependency.getDependencyProject()).evaluate();

        Task nextTask = projectDependency.getDependencyProject().getTasks().findByName(taskName);
        if (nextTask != null) {
            context.add(nextTask);
        }
    }
}
 
Example #14
Source File: CompositeFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Allows subclasses to add additional dependencies
 * @param context The context to add dependencies to.
 */
protected void addDependencies(TaskDependencyResolveContext context) {
    BuildDependenciesOnlyFileCollectionResolveContext fileContext = new BuildDependenciesOnlyFileCollectionResolveContext();
    resolve(fileContext);
    for (Buildable buildable : fileContext.resolveAsBuildables()) {
        context.add(buildable);
    }
}
 
Example #15
Source File: CompositeFileCollection.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public TaskDependency getBuildDependencies() {
    return new AbstractTaskDependency() {
        public void resolve(TaskDependencyResolveContext context) {
            addDependencies(context);
        }
    };
}
 
Example #16
Source File: DefaultProjectDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    if (!buildProjectDependencies) {
        return;
    }
    projectAccessListener.beforeResolvingProjectDependency(dependencyProject);

    Configuration configuration = getProjectConfiguration();
    context.add(configuration);
    context.add(configuration.getAllArtifacts());
}
 
Example #17
Source File: DefaultDependencySet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (SelfResolvingDependency dependency : DefaultDependencySet.this.withType(SelfResolvingDependency.class)) {
        context.add(dependency);
    }
}
 
Example #18
Source File: DefaultMavenArtifactSet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (MavenArtifact mavenArtifact : DefaultMavenArtifactSet.this) {
        context.add(mavenArtifact);
    }
}
 
Example #19
Source File: TasksFromProjectDependencies.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    resolveProjectDependencies(context, dependencies.withType(ProjectDependency.class));
}
 
Example #20
Source File: DefaultPublishArtifactSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (PublishArtifact publishArtifact : DefaultPublishArtifactSet.this) {
        context.add(publishArtifact);
    }
}
 
Example #21
Source File: DefaultDependencySet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (SelfResolvingDependency dependency : DefaultDependencySet.this.withType(SelfResolvingDependency.class)) {
        context.add(dependency);
    }
}
 
Example #22
Source File: DefaultIvyArtifactSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (IvyArtifact ivyArtifact : DefaultIvyArtifactSet.this) {
        context.add(ivyArtifact);
    }
}
 
Example #23
Source File: DefaultMavenArtifactSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (MavenArtifact mavenArtifact : DefaultMavenArtifactSet.this) {
        context.add(mavenArtifact);
    }
}
 
Example #24
Source File: DefaultIvyArtifactSet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (IvyArtifact ivyArtifact : DefaultIvyArtifactSet.this) {
        context.add(ivyArtifact);
    }
}
 
Example #25
Source File: DefaultDependencySet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (SelfResolvingDependency dependency : DefaultDependencySet.this.withType(SelfResolvingDependency.class)) {
        context.add(dependency);
    }
}
 
Example #26
Source File: DefaultPublishArtifactSet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (PublishArtifact publishArtifact : DefaultPublishArtifactSet.this) {
        context.add(publishArtifact);
    }
}
 
Example #27
Source File: DefaultPublishArtifactSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (PublishArtifact publishArtifact : DefaultPublishArtifactSet.this) {
        context.add(publishArtifact);
    }
}
 
Example #28
Source File: DefaultDependencySet.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (SelfResolvingDependency dependency : DefaultDependencySet.this.withType(SelfResolvingDependency.class)) {
        context.add(dependency);
    }
}
 
Example #29
Source File: DefaultIvyArtifactSet.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    for (IvyArtifact ivyArtifact : DefaultIvyArtifactSet.this) {
        context.add(ivyArtifact);
    }
}
 
Example #30
Source File: TasksFromProjectDependencies.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void resolve(TaskDependencyResolveContext context) {
    resolveProjectDependencies(context, dependencies.withType(ProjectDependency.class));
}