use of org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig in project build-info by JFrogDev.
the class ArtifactoryTask method projectEvaluated.
public void projectEvaluated() {
Project project = getProject();
if (isSkip()) {
log.debug("artifactoryPublish task '{}' skipped for project '{}'.", this.getPath(), project.getName());
} else {
ArtifactoryPluginConvention convention = ArtifactoryPluginUtil.getPublisherConvention(project);
if (convention != null) {
ArtifactoryClientConfiguration acc = convention.getClientConfig();
artifactSpecs.clear();
artifactSpecs.addAll(acc.publisher.getArtifactSpecs());
// Configure the task using the "defaults" closure (delegate to the task)
PublisherConfig config = convention.getPublisherConfig();
if (config != null) {
Closure defaultsClosure = config.getDefaultsClosure();
ConfigureUtil.configure(defaultsClosure, this);
}
}
Task deployTask = project.getRootProject().getTasks().findByName(DEPLOY_TASK_NAME);
if (deployTask == null) {
throw new IllegalStateException(String.format("Could not find %s in the root project", DEPLOY_TASK_NAME));
}
finalizedBy(deployTask);
// Depend on buildInfo task in sub-projects
for (Project sub : project.getSubprojects()) {
Task subArtifactoryTask = sub.getTasks().findByName(ARTIFACTORY_PUBLISH_TASK_NAME);
if (subArtifactoryTask != null) {
dependsOn(subArtifactoryTask);
}
}
checkDependsOnArtifactsToPublish();
}
}
Aggregations