This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git
The following commit(s) were added to refs/heads/main by this push: new b698c2b Allow to match excludes against path name b698c2b is described below commit b698c2b831aafe343c8bba0b670f7302fa6a524a Author: RĂ©da Housni Alaoui <reda-ala...@hey.com> AuthorDate: Tue Nov 22 18:05:15 2022 +0100 Allow to match excludes against path name --- src/main/java/org/apache/tomcat/jakartaee/Migration.java | 14 +++++++++++++- .../java/org/apache/tomcat/jakartaee/MigrationTask.java | 10 ++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/tomcat/jakartaee/Migration.java b/src/main/java/org/apache/tomcat/jakartaee/Migration.java index 62660dd..950ce23 100644 --- a/src/main/java/org/apache/tomcat/jakartaee/Migration.java +++ b/src/main/java/org/apache/tomcat/jakartaee/Migration.java @@ -94,6 +94,7 @@ public class Migration { private EESpecProfile profile = EESpecProfiles.TOMCAT; private boolean enableDefaultExcludes = true; + private boolean matchExcludesAgainstPathName; private boolean zipInMemory; private boolean converted; private State state = State.NOT_STARTED; @@ -161,6 +162,14 @@ public class Migration { this.enableDefaultExcludes = enableDefaultExcludes; } + /** + * Enable exclude matching against the path name. + * @param matchExcludesAgainstPathName true to match excludes against the path name instead of the file name + */ + public void setMatchExcludesAgainstPathName(boolean matchExcludesAgainstPathName) { + this.matchExcludesAgainstPathName = matchExcludesAgainstPathName; + } + /** * Buffer all conversion operations for compressed archives in memory. * @param zipInMemory true to buffer in memory @@ -403,7 +412,10 @@ public class Migration { return true; } - if (GlobMatcher.matchName(excludes, filename, true)) { + if (!matchExcludesAgainstPathName && GlobMatcher.matchName(excludes, filename, true)) { + return true; + } + if (matchExcludesAgainstPathName && GlobMatcher.matchName(excludes, name, true)) { return true; } diff --git a/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java b/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java index 24a9b1f..244f196 100644 --- a/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java +++ b/src/main/java/org/apache/tomcat/jakartaee/MigrationTask.java @@ -39,6 +39,7 @@ public class MigrationTask extends Task { private String profile = EESpecProfiles.TOMCAT.toString(); private boolean zipInMemory = false; private String excludes; + private boolean matchExcludesAgainstPathName; /** * Set the source file. @@ -82,6 +83,14 @@ public class MigrationTask extends Task { this.excludes = excludes; } + /** + * Enable exclude matching against the path name. + * @param matchExcludesAgainstPathName true to match excludes against the path name instead of the file name + */ + public void setMatchExcludesAgainstPathName(boolean matchExcludesAgainstPathName) { + this.matchExcludesAgainstPathName = matchExcludesAgainstPathName; + } + @Override public void execute() throws BuildException { // redirect the log messages to Ant @@ -105,6 +114,7 @@ public class MigrationTask extends Task { migration.setDestination(dest); migration.setEESpecProfile(profile); migration.setZipInMemory(zipInMemory); + migration.setMatchExcludesAgainstPathName(matchExcludesAgainstPathName); if (this.excludes != null) { String[] excludes= this.excludes.split(","); for (String exclude : excludes) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org