use of org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention 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();
}
}
use of org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention in project build-info by JFrogDev.
the class ArtifactoryPluginUtil method getResolverHandler.
public static ArtifactoryClientConfiguration.ResolverHandler getResolverHandler(Project project) {
while (project != null) {
ArtifactoryPluginConvention acc = project.getConvention().findPlugin(ArtifactoryPluginConvention.class);
if (acc != null) {
ArtifactoryClientConfiguration.ResolverHandler resolver = acc.getClientConfig().resolver;
if (resolver.getContextUrl() != null && resolver.getRepoKey() != null) {
return resolver;
}
}
project = project.getParent();
}
return null;
}
use of org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention in project build-info by JFrogDev.
the class ArtifactoryPluginUtil method getPublisherConvention.
public static ArtifactoryPluginConvention getPublisherConvention(Project project) {
while (project != null) {
ArtifactoryPluginConvention acc = project.getConvention().findPlugin(ArtifactoryPluginConvention.class);
if (acc != null) {
ArtifactoryClientConfiguration.PublisherHandler publisher = acc.getClientConfig().publisher;
if (publisher.getContextUrl() != null && publisher.getRepoKey() != null) {
return acc;
}
}
project = project.getParent();
}
return null;
}
Aggregations