Github user jtulach commented on a diff in the pull request:

    https://github.com/apache/incubator-netbeans/pull/70#discussion_r144094565
  
    --- Diff: nbbuild/antsrc/org/netbeans/nbbuild/RatReportTask.java ---
    @@ -0,0 +1,319 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.netbeans.nbbuild;
    +
    +import java.io.BufferedReader;
    +import java.io.File;
    +import java.io.FileNotFoundException;
    +import java.io.FileReader;
    +import java.io.IOException;
    +import java.io.InputStreamReader;
    +import java.util.ArrayList;
    +import java.util.HashSet;
    +import java.util.LinkedHashMap;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.TreeMap;
    +import java.util.TreeSet;
    +import java.util.logging.Level;
    +import java.util.logging.Logger;
    +import javax.xml.parsers.DocumentBuilder;
    +import javax.xml.parsers.DocumentBuilderFactory;
    +import javax.xml.parsers.ParserConfigurationException;
    +import javax.xml.xpath.XPath;
    +import javax.xml.xpath.XPathConstants;
    +import javax.xml.xpath.XPathExpressionException;
    +import javax.xml.xpath.XPathFactory;
    +import org.apache.tools.ant.BuildException;
    +import org.apache.tools.ant.Task;
    +import org.w3c.dom.Document;
    +import org.w3c.dom.Element;
    +import org.w3c.dom.NodeList;
    +import org.xml.sax.SAXException;
    +
    +/**
    + * Build JUnit report from Apache Ant Report XXX
    + *
    + * @author skygo
    + */
    +public class RatReportTask extends Task {
    +
    +    private File sourceFile;
    +    private File root;
    +    // not nice but to be last
    +    private static final String OTHERS_AREA = "not cluster";
    +    private static final String NOT_CLUSTER = "not under cluster";
    +    private File reportFile;
    +
    +    /**
    +     * source file Apache Rat xml report
    +     *
    +     * @param sourceFile
    +     */
    +    public void setSource(File sourceFile) {
    +        this.sourceFile = sourceFile;
    +    }
    +
    +    /**
    +     * Folder to put the rat reports in
    +     *
    +     * @param report
    +     */
    +    public void setReport(File report) {
    +        this.reportFile = report;
    +    }
    +
    +    @Override
    +    public void execute() throws BuildException {
    +        super.execute();
    +        root = sourceFile.getParentFile().getParentFile().getParentFile();
    +        File[] modulesFolder = root.listFiles();
    +        String repository = "";
    +        // get repository information from git
    +        try {
    +            List<String> commandAndArgs = new ArrayList<String>();
    +            commandAndArgs.add("git");
    +            commandAndArgs.add("config");
    +            commandAndArgs.add("--get");
    +            commandAndArgs.add("remote.origin.url");
    +            Process p = new 
ProcessBuilder(commandAndArgs).directory(root).start();
    --- End diff --
    
    R is never closed 


---

Reply via email to