forked from phoedos/pmd
CPD Ant Task: Add ignoreUsings option
This commit is contained in:
@ -47,6 +47,7 @@ public class CPDTask extends Task {
|
|||||||
private boolean ignoreLiterals;
|
private boolean ignoreLiterals;
|
||||||
private boolean ignoreIdentifiers;
|
private boolean ignoreIdentifiers;
|
||||||
private boolean ignoreAnnotations;
|
private boolean ignoreAnnotations;
|
||||||
|
private boolean ignoreUsings;
|
||||||
private boolean skipLexicalErrors;
|
private boolean skipLexicalErrors;
|
||||||
private boolean skipDuplicateFiles;
|
private boolean skipDuplicateFiles;
|
||||||
private boolean skipBlocks = true;
|
private boolean skipBlocks = true;
|
||||||
@ -104,6 +105,9 @@ public class CPDTask extends Task {
|
|||||||
if (ignoreAnnotations) {
|
if (ignoreAnnotations) {
|
||||||
p.setProperty(Tokenizer.IGNORE_ANNOTATIONS, "true");
|
p.setProperty(Tokenizer.IGNORE_ANNOTATIONS, "true");
|
||||||
}
|
}
|
||||||
|
if (ignoreUsings) {
|
||||||
|
p.setProperty(Tokenizer.IGNORE_USINGS, "true");
|
||||||
|
}
|
||||||
p.setProperty(Tokenizer.OPTION_SKIP_BLOCKS, Boolean.toString(skipBlocks));
|
p.setProperty(Tokenizer.OPTION_SKIP_BLOCKS, Boolean.toString(skipBlocks));
|
||||||
p.setProperty(Tokenizer.OPTION_SKIP_BLOCKS_PATTERN, skipBlocksPattern);
|
p.setProperty(Tokenizer.OPTION_SKIP_BLOCKS_PATTERN, skipBlocksPattern);
|
||||||
return LanguageFactory.createLanguage(language, p);
|
return LanguageFactory.createLanguage(language, p);
|
||||||
@ -188,6 +192,10 @@ public class CPDTask extends Task {
|
|||||||
this.ignoreAnnotations = value;
|
this.ignoreAnnotations = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setIgnoreUsings(boolean value) {
|
||||||
|
this.ignoreUsings = value;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSkipLexicalErrors(boolean skipLexicalErrors) {
|
public void setSkipLexicalErrors(boolean skipLexicalErrors) {
|
||||||
this.skipLexicalErrors = skipLexicalErrors;
|
this.skipLexicalErrors = skipLexicalErrors;
|
||||||
}
|
}
|
||||||
|
@ -331,6 +331,14 @@ Andy Glover wrote an Ant task for CPD; here's how to use it:
|
|||||||
<td valign="top">java</td>
|
<td valign="top">java</td>
|
||||||
<td valign="top" align="center">No</td>
|
<td valign="top" align="center">No</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">ignoreUsings</td>
|
||||||
|
<td valign="top">
|
||||||
|
Ignore using directives in C#.
|
||||||
|
</td>
|
||||||
|
<td valign="top">C#</td>
|
||||||
|
<td valign="top" align="center">No</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top">skipDuplicateFiles</td>
|
<td valign="top">skipDuplicateFiles</td>
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
|
Reference in New Issue
Block a user