Search in sources :

Example 1 with IssueFinder

use of org.apache.sling.tooling.lc.jira.IssueFinder in project sling by apache.

the class LaunchpadComparer method outputFormatted.

private static void outputFormatted(Map.Entry<ArtifactKey, VersionChange> e) {
    ArtifactKey artifact = e.getKey();
    VersionChange versionChange = e.getValue();
    System.out.format("    %-30s : %-55s : %s -> %s%n", artifact.getGroupId(), artifact.getArtifactId(), versionChange.getFrom(), versionChange.getTo());
    if (!artifact.getGroupId().equals("org.apache.sling")) {
        return;
    }
    SvnChangeLogFinder svn = new SvnChangeLogFinder();
    String fromTag = artifact.getArtifactId() + "-" + versionChange.getFrom();
    String toTag = artifact.getArtifactId() + "-" + versionChange.getTo();
    try {
        List<String> issues = svn.getChanges(fromTag, toTag).stream().map(LaunchpadComparer::toJiraKey).filter(k -> k != null).collect(Collectors.toList());
        IssueFinder issueFinder = new IssueFinder();
        issueFinder.findIssues(issues).forEach(i -> System.out.format("        %-10s - %s%n", i.getKey(), i.getSummary()));
    } catch (SVNException | IOException e1) {
        System.err.println("Failed retrieving changes : " + e1.getMessage());
    }
}
Also used : IssueFinder(org.apache.sling.tooling.lc.jira.IssueFinder) AetherSetup(org.apache.sling.tooling.lc.aether.AetherSetup) ArtifactKey(org.apache.sling.tooling.lc.aether.ArtifactKey) BundleList(org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList) Function(java.util.function.Function) BundleListUtils(org.apache.sling.maven.projectsupport.BundleListUtils) Artifact(org.apache.sling.provisioning.model.Artifact) Matcher(java.util.regex.Matcher) Map(java.util.Map) StreamSupport(java.util.stream.StreamSupport) VersionChange(org.apache.sling.tooling.lc.aether.VersionChange) Files(java.nio.file.Files) SVNException(org.tmatesoft.svn.core.SVNException) Set(java.util.Set) IOException(java.io.IOException) Artifacts(org.apache.sling.tooling.lc.aether.Artifacts) Collectors(java.util.stream.Collectors) File(java.io.File) Sets(com.google.common.collect.Sets) Objects(java.util.Objects) List(java.util.List) ModelUtility(org.apache.sling.provisioning.model.ModelUtility) SvnChangeLogFinder(org.apache.sling.tooling.lc.svn.SvnChangeLogFinder) Model(org.apache.sling.provisioning.model.Model) BufferedReader(java.io.BufferedReader) Pattern(java.util.regex.Pattern) Bundle(org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle) ModelReader(org.apache.sling.provisioning.model.io.ModelReader) IssueFinder(org.apache.sling.tooling.lc.jira.IssueFinder) ArtifactKey(org.apache.sling.tooling.lc.aether.ArtifactKey) VersionChange(org.apache.sling.tooling.lc.aether.VersionChange) SvnChangeLogFinder(org.apache.sling.tooling.lc.svn.SvnChangeLogFinder) SVNException(org.tmatesoft.svn.core.SVNException) IOException(java.io.IOException)

Aggregations

Sets (com.google.common.collect.Sets)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 IOException (java.io.IOException)1 Files (java.nio.file.Files)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Set (java.util.Set)1 Function (java.util.function.Function)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 StreamSupport (java.util.stream.StreamSupport)1 BundleListUtils (org.apache.sling.maven.projectsupport.BundleListUtils)1 Bundle (org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle)1 BundleList (org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList)1 Artifact (org.apache.sling.provisioning.model.Artifact)1 Model (org.apache.sling.provisioning.model.Model)1 ModelUtility (org.apache.sling.provisioning.model.ModelUtility)1