Java 类org.gradle.api.artifacts.ResolvableDependencies 实例源码

项目:Pushjet-Android    文件:SonarRunnerPlugin.java   
private void addConfiguration(final Project project, final SonarRunnerRootExtension rootExtension) {
    final Configuration configuration = project.getConfigurations().create(SonarRunnerExtension.SONAR_RUNNER_CONFIGURATION_NAME);
    configuration
            .setVisible(false)
            .setTransitive(false)
            .setDescription("The SonarRunner configuration to use to run analysis")
            .getIncoming()
            .beforeResolve(new Action<ResolvableDependencies>() {
                public void execute(ResolvableDependencies resolvableDependencies) {
                    DependencySet dependencies = resolvableDependencies.getDependencies();
                    if (dependencies.isEmpty()) {
                        String toolVersion = rootExtension.getToolVersion();
                        DependencyHandler dependencyHandler = project.getDependencies();
                        Dependency dependency = dependencyHandler.create("org.codehaus.sonar.runner:sonar-runner-dist:" + toolVersion);
                        configuration.getDependencies().add(dependency);
                    }
                }
            });
}
项目:Reer    文件:DefaultConfiguration.java   
private void resolveGraphIfRequired(final InternalState requestedState) {
    if (resolvedState == ARTIFACTS_RESOLVED) {
        if (dependenciesModified) {
            throw new InvalidUserDataException(String.format("Attempted to resolve %s that has been resolved previously.", getDisplayName()));
        }
        return;
    }
    if (resolvedState == GRAPH_RESOLVED) {
        if (!dependenciesModified) {
            return;
        }
        throw new InvalidUserDataException(String.format("Resolved %s again after modification", getDisplayName()));
    }
    if (resolvedState != UNRESOLVED) {
        throw new IllegalStateException("Graph resolution already performed");
    }

    buildOperationExecutor.run("Resolve dependencies " + identityPath, new Action<BuildOperationContext>() {
        @Override
        public void execute(BuildOperationContext buildOperationContext) {
            ResolvableDependencies incoming = getIncoming();
            performPreResolveActions(incoming);

            cachedResolverResults = new DefaultResolverResults();
            resolver.resolveGraph(DefaultConfiguration.this, cachedResolverResults);
            dependenciesModified = false;
            resolvedState = GRAPH_RESOLVED;

            // Mark all affected configurations as observed
            markParentsObserved(requestedState);
            markReferencedProjectConfigurationsObserved(requestedState);

            dependencyResolutionListeners.getSource().afterResolve(incoming);
            // Discard listeners
            dependencyResolutionListeners.removeAll();
        }
    });
}
项目:Reer    文件:DefaultConfiguration.java   
private void performPreResolveActions(ResolvableDependencies incoming) {
    DependencyResolutionListener dependencyResolutionListener = dependencyResolutionListeners.getSource();
    insideBeforeResolve = true;
    try {
        dependencyResolutionListener.beforeResolve(incoming);
    } finally {
        insideBeforeResolve = false;
    }
    triggerWhenEmptyActionsIfNecessary();
}
项目:Reer    文件:DependencyResolutionLogger.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    progressLoggers.set(loggers);
    ProgressLogger logger = loggerFactory.newOperation(DependencyResolutionLogger.class);
    logger.start("Resolve " + dependencies, "Resolving " + dependencies);
    loggers.add(logger);
}
项目:Reer    文件:DependencyResolutionLogger.java   
public void afterResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    if (loggers.isEmpty()) {
        throw new IllegalStateException("Logging operation was not started or it has already completed.");
    }
    ProgressLogger logger = loggers.removeLast();
    logger.completed();
    if (loggers.isEmpty()) {
        progressLoggers.remove();
    }
}
项目:Pushjet-Android    文件:DependencyResolutionLogger.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    progressLoggers.set(loggers);
    ProgressLogger logger = loggerFactory.newOperation(DependencyResolutionLogger.class);
    logger.start(String.format("Resolve %s", dependencies), String.format("Resolving %s", dependencies));
    loggers.add(logger);
}
项目:Pushjet-Android    文件:DependencyResolutionLogger.java   
public void afterResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    if (loggers.isEmpty()) {
        throw new IllegalStateException("Logging operation was not started or it has already completed.");
    }
    ProgressLogger logger = loggers.removeLast();
    logger.completed();
    if (loggers.isEmpty()) {
        progressLoggers.remove();
    }
}
项目:Pushjet-Android    文件:DependencyResolutionLogger.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    progressLoggers.set(loggers);
    ProgressLogger logger = loggerFactory.newOperation(DependencyResolutionLogger.class);
    logger.start(String.format("Resolve %s", dependencies), String.format("Resolving %s", dependencies));
    loggers.add(logger);
}
项目:Pushjet-Android    文件:DependencyResolutionLogger.java   
public void afterResolve(ResolvableDependencies dependencies) {
    LinkedList<ProgressLogger> loggers = progressLoggers.get();
    if (loggers.isEmpty()) {
        throw new IllegalStateException("Logging operation was not started or it has already completed.");
    }
    ProgressLogger logger = loggers.removeLast();
    logger.completed();
    if (loggers.isEmpty()) {
        progressLoggers.remove();
    }
}
项目:Reer    文件:DefaultConfiguration.java   
public ResolvableDependencies getIncoming() {
    return resolvableDependencies;
}
项目:Reer    文件:DefaultConfiguration.java   
public void beforeResolve(Action<? super ResolvableDependencies> action) {
    dependencyResolutionListeners.add("beforeResolve", action);
}
项目:Reer    文件:DefaultConfiguration.java   
public void afterResolve(Action<? super ResolvableDependencies> action) {
    dependencyResolutionListeners.add("afterResolve", action);
}
项目:Reer    文件:ProfileEventAdapter.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setStart(now);
}
项目:Reer    文件:ProfileEventAdapter.java   
public void afterResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setFinish(now);
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setStart(now);
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
public void afterResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setFinish(now);
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
public void beforeResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setStart(now);
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
public void afterResolve(ResolvableDependencies dependencies) {
    long now = timeProvider.getCurrentTime();
    buildProfile.getDependencySetProfile(dependencies.getPath()).setFinish(now);
}