# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\work\hudson\hudson\plugins\tasks\src
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: main/java/hudson/plugins/tasks/parser/TaskScanner.java
--- main/java/hudson/plugins/tasks/parser/TaskScanner.java Base (BASE)
+++ main/java/hudson/plugins/tasks/parser/TaskScanner.java Locally Modified (Based On LOCAL)
@@ -31,7 +31,7 @@
* Creates a new instance of TaskScanner
.
*/
public TaskScanner() {
- this("FIXME", "TODO", "@deprecated");
+ this("FIXME", "TODO", "@deprecated", false);
}
/**
@@ -43,16 +43,19 @@
* tag identifiers indicating normal priority
* @param low
* tag identifiers indicating low priority
+ * @param ignoreCase
+ * if case should be ignored during matching
*/
- public TaskScanner(final String high, final String normal, final String low) {
+ public TaskScanner(final String high, final String normal, final String low,
+ final boolean ignoreCase ) {
if (StringUtils.isNotBlank(high)) {
- patterns.put(Priority.HIGH, compile(high));
+ patterns.put(Priority.HIGH, compile(high, ignoreCase));
}
if (StringUtils.isNotBlank(normal)) {
- patterns.put(Priority.NORMAL, compile(normal));
+ patterns.put(Priority.NORMAL, compile(normal, ignoreCase));
}
if (StringUtils.isNotBlank(low)) {
- patterns.put(Priority.LOW, compile(low));
+ patterns.put(Priority.LOW, compile(low, ignoreCase));
}
}
@@ -61,9 +64,11 @@
*
* @param tagIdentifiers
* the identifiers to scan for
+ * @param ignoreCase
+ * specifies if case should be ignored
* @return the compiled pattern
*/
- private Pattern compile(final String tagIdentifiers) {
+ private Pattern compile(final String tagIdentifiers, final boolean ignoreCase) {
try {
String[] tags;
if (tagIdentifiers.indexOf(',') == -1) {
@@ -84,8 +89,13 @@
}
}
}
- return Pattern.compile("^.*(?:" + StringUtils.join(regexps.iterator(), "|") + ")(.*)$");
+ int flags = 0;
+ if( ignoreCase ) {
+ flags |= Pattern.CASE_INSENSITIVE;
}
+ return Pattern.compile("^.*(?:" + StringUtils.join(regexps.iterator(), "|") + ")(.*)$",
+ flags);
+ }
catch (PatternSyntaxException exception) {
throw new AbortException("Invalid identifiers in a regular expression: " + tagIdentifiers + "\n", exception);
}
Index: main/java/hudson/plugins/tasks/parser/WorkspaceScanner.java
--- main/java/hudson/plugins/tasks/parser/WorkspaceScanner.java Base (BASE)
+++ main/java/hudson/plugins/tasks/parser/WorkspaceScanner.java Locally Modified (Based On LOCAL)
@@ -41,11 +41,14 @@
private final String normal;
/** Tag identifiers indicating low priority. */
private final String low;
+ /** Tag identifiers indicating case sensitive parsing. */
+ private boolean ignoreCase;
/** Prefix of path. */
private String prefix;
/** The default encoding to be used when reading and parsing files. */
private final String defaultEncoding;
+
/**
* Creates a new instance of WorkspaceScanner
.
*
@@ -61,14 +64,18 @@
* tag identifiers indicating normal priority
* @param low
* tag identifiers indicating low priority
+ * @param ignoreCase
+ * if case should be ignored during matching
*/
- public WorkspaceScanner(final String filePattern, final String excludeFilePattern, final String defaultEncoding, final String high, final String normal, final String low) {
+ public WorkspaceScanner(final String filePattern, final String excludeFilePattern, final String defaultEncoding,
+ final String high, final String normal, final String low, final boolean ignoreCase) {
this.filePattern = filePattern;
this.excludeFilePattern = excludeFilePattern;
this.defaultEncoding = defaultEncoding;
this.high = high;
this.normal = normal;
this.low = low;
+ this.ignoreCase = ignoreCase;
}
/**
@@ -89,8 +96,10 @@
* @param low
* tag identifiers indicating low priority
*/
- public WorkspaceScanner(final String filePattern, final String excludeFilePattern, final String defaultEncoding, final String high, final String normal, final String low, final String moduleName) {
- this(filePattern, excludeFilePattern, defaultEncoding, high, normal, low);
+ public WorkspaceScanner(final String filePattern, final String excludeFilePattern, final String defaultEncoding,
+ final String high, final String normal, final String low, final boolean caseSensitive,
+ final String moduleName) {
+ this(filePattern, excludeFilePattern, defaultEncoding, high, normal, low, caseSensitive);
this.moduleName = moduleName;
}
@@ -120,7 +129,7 @@
detectors.add(new JavaPackageDetector());
detectors.add(new CsharpNamespaceDetector());
- TaskScanner taskScanner = new TaskScanner(high, normal, low);
\ No newline at end of file
+ TaskScanner taskScanner = new TaskScanner(high, normal, low, ignoreCase);
\ No newline at end of file
TasksParserResult javaProject = new TasksParserResult(files.length);
ModuleDetector moduleDetector = new ModuleDetector(workspace);
Index: main/java/hudson/plugins/tasks/TasksPublisher.java
--- main/java/hudson/plugins/tasks/TasksPublisher.java Base (BASE)
+++ main/java/hudson/plugins/tasks/TasksPublisher.java Locally Modified (Based On LOCAL)
@@ -34,6 +34,8 @@
private final String normal;
/** Tag identifiers indicating low priority. */
private final String low;
+ /** Tag identifiers indicating case sensitivity. */
+ private final boolean ignoreCase;
/** Ant file-set pattern of files to work with. */
private final String pattern;
/** Ant file-set pattern of files to exclude from work. */
@@ -66,6 +68,8 @@
* tag identifiers indicating normal priority
* @param low
* tag identifiers indicating low priority
+ * @param ignoreCase
+ * if case should be ignored during matching
* @param defaultEncoding
* the default encoding to be used when reading and parsing files
*/
@@ -74,13 +78,15 @@
@DataBoundConstructor
public TasksPublisher(final String pattern, final String excludePattern, final String threshold,
final String healthy, final String unHealthy, final String height, final Priority minimumPriority,
- final String high, final String normal, final String low, final String defaultEncoding) {
+ final String high, final String normal, final String low,
+ final boolean ignoreCase, final String defaultEncoding) {
super(threshold, healthy, unHealthy, height, minimumPriority, defaultEncoding, "TASKS");
this.pattern = pattern;
this.excludePattern = excludePattern;
this.high = high;
this.normal = normal;
+ this.ignoreCase = ignoreCase;
this.low = low;
}
// CHECKSTYLE:ON
@@ -142,7 +148,8 @@
TasksParserResult project;
log(logger, "Scanning workspace files for tasks...");
project = build.getProject().getWorkspace().act(
- new WorkspaceScanner(StringUtils.defaultIfEmpty(getPattern(), DEFAULT_PATTERN), getExcludePattern(), getDefaultEncoding(), high, normal, low));
+ new WorkspaceScanner(StringUtils.defaultIfEmpty(getPattern(), DEFAULT_PATTERN),
+ getExcludePattern(), getDefaultEncoding(), high, normal, low, ignoreCase) );
TasksResult result = new TasksResultBuilder().build(build, project, getDefaultEncoding(), high, normal, low);
build.getActions().add(new TasksResultAction(build, this, result));
Index: main/java/hudson/plugins/tasks/TasksReporter.java
--- main/java/hudson/plugins/tasks/TasksReporter.java Base (BASE)
+++ main/java/hudson/plugins/tasks/TasksReporter.java Locally Modified (Based On LOCAL)
@@ -46,6 +46,8 @@
private final String normal;
/** Tag identifiers indicating low priority. */
private final String low;
+ /** Tag identifiers indicating case sensitivity. */
+ private final boolean ignoreCase;
/** The is threshold enabled. */
@SuppressWarnings("all")
@@ -93,19 +95,22 @@
* tag identifiers indicating normal priority
* @param low
* tag identifiers indicating low priority
+ * @param ignoreCase
+ * if case should be ignored during matching
*/
// CHECKSTYLE:OFF
@SuppressWarnings("PMD.ExcessiveParameterList")
@DataBoundConstructor
public TasksReporter(final String pattern, final String excludePattern, final String threshold, final String healthy, final String unHealthy,
final String height, final Priority minimumPriority,
- final String high, final String normal, final String low) {
+ final String high, final String normal, final String low, final boolean ignoreCase) {
super(threshold, healthy, unHealthy, height, minimumPriority, "TASKS");
this.pattern = pattern;
this.excludePattern = excludePattern;
this.high = high;
this.normal = normal;
this.low = low;
+ this.ignoreCase = ignoreCase;
}
// CHECKSTYLE:ON
@@ -154,6 +159,13 @@
return low;
}
+ /**
+ * Returns if case should be ignored
+ */
+ public boolean getIgnoreCase() {
+ return ignoreCase;
+ }
+
/** {@inheritDoc} */
@Override
protected boolean acceptGoal(final String goal) {
@@ -179,7 +191,7 @@
if (filePath.exists()) {
log(logger, String.format("Scanning folder '%s' for tasks ... ", sourcePath));
WorkspaceScanner workspaceScanner = new WorkspaceScanner(StringUtils.defaultIfEmpty(pattern, DEFAULT_PATTERN),
- excludePattern, getDefaultEncoding(), high, normal, low, pom.getName());
+ excludePattern, getDefaultEncoding(), high, normal, low, ignoreCase, pom.getName());
workspaceScanner.setPrefix(sourcePath);
TasksParserResult subProject = filePath.act(workspaceScanner);
project.addAnnotations(subProject.getAnnotations());
Index: main/resources/hudson/plugins/tasks/config/tasks.jelly
--- main/resources/hudson/plugins/tasks/config/tasks.jelly Base (BASE)
+++ main/resources/hudson/plugins/tasks/config/tasks.jelly Locally Modified (Based On LOCAL)
@@ -21,6 +21,7 @@