Search in sources :

Example 6 with ChangeLogSet

use of org.apache.maven.scm.command.changelog.ChangeLogSet in project maven-plugins by apache.

the class FileActivityReport method doGenerateReport.

/**
     * {@inheritDoc}
     */
protected void doGenerateReport(List<ChangeLogSet> changeLogSets, ResourceBundle bundle, Sink sink) {
    sink.head();
    sink.title();
    sink.text(bundle.getString("report.file-activity.header"));
    sink.title_();
    sink.head_();
    sink.body();
    sink.section1();
    sink.sectionTitle1();
    sink.text(bundle.getString("report.file-activity.mainTitle"));
    sink.sectionTitle1_();
    for (ChangeLogSet set : changeLogSets) {
        doChangedSets(set, bundle, sink);
    }
    sink.section1_();
    sink.body_();
    sink.flush();
    sink.close();
}
Also used : ChangeLogSet(org.apache.maven.scm.command.changelog.ChangeLogSet)

Example 7 with ChangeLogSet

use of org.apache.maven.scm.command.changelog.ChangeLogSet in project maven-plugins by apache.

the class DeveloperActivityReport method doGenerateReport.

/**
     * {@inheritDoc}
     */
protected void doGenerateReport(List<ChangeLogSet> changeLogSets, ResourceBundle bundle, Sink sink) {
    sink.head();
    sink.title();
    sink.text(bundle.getString("report.dev-activity.header"));
    sink.title_();
    sink.head_();
    sink.body();
    sink.section1();
    sink.sectionTitle1();
    sink.text(bundle.getString("report.dev-activity.mainTitle"));
    sink.sectionTitle1_();
    if (developers.isEmpty()) {
        sink.paragraph();
        sink.text(bundle.getString("report.dev-activity.noDevelopers"));
        sink.paragraph_();
    } else {
        for (ChangeLogSet set : changeLogSets) {
            doChangedSets(set, bundle, sink);
        }
    }
    sink.section1_();
    sink.body_();
    sink.flush();
    sink.close();
}
Also used : ChangeLogSet(org.apache.maven.scm.command.changelog.ChangeLogSet)

Example 8 with ChangeLogSet

use of org.apache.maven.scm.command.changelog.ChangeLogSet in project maven-plugins by apache.

the class ChangeLog method loadChangedSets.

public static List<ChangeLogSet> loadChangedSets(Reader reader) throws ParserConfigurationException, SAXException, IOException {
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    List<ChangeLogSet> changeLogSets = new ArrayList<ChangeLogSet>();
    // CHECKSTYLE_OFF: MagicNumber
    BufferedReader br = new BufferedReader(reader, 8192);
    // CHECKSTYLE_ON: MagicNumber
    parser.parse(new InputSource(br), new ChangeLogHandler(changeLogSets));
    return changeLogSets;
}
Also used : InputSource(org.xml.sax.InputSource) ChangeLogSet(org.apache.maven.scm.command.changelog.ChangeLogSet) ArrayList(java.util.ArrayList) BufferedReader(java.io.BufferedReader) SAXParser(javax.xml.parsers.SAXParser)

Example 9 with ChangeLogSet

use of org.apache.maven.scm.command.changelog.ChangeLogSet in project maven-plugins by apache.

the class ChangeLog method loadChangedSets.

/**
     * parses a previously generated changelog xml document and return its changed sets
     *
     * @param stream the changelog xml document
     * @return changelog sets parsed from the xml document
     * @throws ParserConfigurationException when instantiation of the SAX parser failed
     * @throws SAXException                 when an error occurred while parsing the xml document
     * @throws IOException                  when an error occurred while accessing the xml document
     */
public static List<ChangeLogSet> loadChangedSets(InputStream stream) throws ParserConfigurationException, SAXException, IOException {
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    List<ChangeLogSet> changeLogSets = new ArrayList<ChangeLogSet>();
    parser.parse(stream, new ChangeLogHandler(changeLogSets));
    return changeLogSets;
}
Also used : ChangeLogSet(org.apache.maven.scm.command.changelog.ChangeLogSet) ArrayList(java.util.ArrayList) SAXParser(javax.xml.parsers.SAXParser)

Example 10 with ChangeLogSet

use of org.apache.maven.scm.command.changelog.ChangeLogSet in project maven-plugins by apache.

the class ChangeLogReport method filter.

/**
     * filters out unwanted files from the changesets
     */
private void filter(List<ChangeLogSet> changeSets) {
    List<Pattern> include = compilePatterns(includes);
    List<Pattern> exclude = compilePatterns(excludes);
    if (includes == null && excludes == null) {
        return;
    }
    for (ChangeLogSet changeLogSet : changeSets) {
        List<ChangeSet> set = changeLogSet.getChangeSets();
        filter(set, include, exclude);
    }
}
Also used : Pattern(java.util.regex.Pattern) ChangeLogSet(org.apache.maven.scm.command.changelog.ChangeLogSet) ChangeSet(org.apache.maven.scm.ChangeSet)

Aggregations

ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)11 ArrayList (java.util.ArrayList)3 ChangeFile (org.apache.maven.scm.ChangeFile)3 ChangeSet (org.apache.maven.scm.ChangeSet)3 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 SAXParser (javax.xml.parsers.SAXParser)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 MavenReportException (org.apache.maven.reporting.MavenReportException)2 ScmException (org.apache.maven.scm.ScmException)2 BufferedOutputStream (java.io.BufferedOutputStream)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Writer (java.io.Writer)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1