Does HtmlReporter --sourcepath take multiple sourcepaths?

I tried the semicolon-separated sourcepaths based on your previous reply on https://answers.atlassian.com/questions/251117, but it doesn't seem working. Could you please verify that?

Thanks,

1 answer

0 vote

Yes, of course, it supports multiple source paths. In my comment posted here I had a spelling mistake (quotes were missing for -p; I just updated it).

Please check if you put your source paths in quotes, otherwise a semicolon between paths will be treated as a separator of a unix command. 

Correct (Windows):

java ... HtmlReporter --sourcepath "path1;path2;path3"

Correct (Linux):

java ... HtmlReporter --sourcepath "path1:path2:path3"

Wrong (on Linux the ';' will separate a command):

java ... HtmlReporter --sourcepath path1;path2;path3

 

I have tried HtmlReporter --sourcepath "path1" and HtmlReporter --sourcepath "path2", and both worked. But HtmlReporter --sourcepath "path1;path2" didn't.

 

I reviewed the source code of com/atlassian/clover/reporters/CommandLineArgProcessors.java. It doesn't seem taking semicolon-separated paths.

-----------------------------------

cfg.setSourcepath(new Path(args[++i]));

-----------------------------------

I'm using clover-4.0.6.jar.

Could you please check?

Thanks,

Path.java:

/**
 * Constructs a chain of paths from <pre>osPathString</pre> using a default platform path separator
 * (i.e. the File.pathSeparator value). All file separators within a path are being normalized to
 * have unix-style endings.
 * @see #Path(String, String)
 */
public Path(String osPathString) {
    this(osPathString, File.pathSeparator);
}

/**
 * Constructs a chain of paths from <pre>osPathString</pre> using a specified <pre>pathSep</pre>
 * path separator. All file separators within a path are being normalized to have unix-style endings.
 *
 * Example:
 * <pre>
 *    new Path("/my/path1:\my\path2", ":")
 * will internally keep
 *      /my/path1
 *      /my/path2
 * </pre>
 */
public Path(String osPathString, String pathSep) {
    for (StringTokenizer pt = new StringTokenizer(osPathString, pathSep); pt.hasMoreTokens();) {
        elements.add(FileUtils.getNormalizedPath(pt.nextToken()));
    }
}

 

Did you use a proper path separator? On Windows it is ';', on Linux it is ':'.


This is it. Colon ':' works.

HtmlReporter --sourcepath "path1:path2"

Thanks!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Posted 9 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

33 views 0 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you