summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Kosiba <mkosiba@google.com>2014-06-17 10:04:59 +0100
committerMarcin Kosiba <mkosiba@google.com>2014-06-20 11:55:26 +0100
commit83503c4f883e1ea9790509d7e477ea87b74a64ed (patch)
tree25b5710c75c1cfeba347885a850b8d4bdd406bb4
parentab61347a2cb3254688c42c993278cefd43e5d99d (diff)
downloadplatform_external_jarjar-83503c4f883e1ea9790509d7e477ea87b74a64ed.tar.gz
platform_external_jarjar-83503c4f883e1ea9790509d7e477ea87b74a64ed.tar.bz2
platform_external_jarjar-83503c4f883e1ea9790509d7e477ea87b74a64ed.zip
Add support for using the dollar sign in rules.
Change-Id: I613c1527657d67680b044ef9ca79e74ada4da905
-rw-r--r--src/main/com/tonicsystems/jarjar/Wildcard.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/com/tonicsystems/jarjar/Wildcard.java b/src/main/com/tonicsystems/jarjar/Wildcard.java
index 723c6f5..5cc486f 100644
--- a/src/main/com/tonicsystems/jarjar/Wildcard.java
+++ b/src/main/com/tonicsystems/jarjar/Wildcard.java
@@ -26,6 +26,7 @@ class Wildcard
private static Pattern dstar = Pattern.compile("\\*\\*");
private static Pattern star = Pattern.compile("\\*");
private static Pattern estar = Pattern.compile("\\+\\??\\)\\Z");
+ private static Pattern dollar = Pattern.compile("\\$");
private final Pattern pattern;
private final int count;
@@ -45,6 +46,7 @@ class Wildcard
regex = replaceAllLiteral(dstar, regex, "(.+?)");
regex = replaceAllLiteral(star, regex, "([^/]+)");
regex = replaceAllLiteral(estar, regex, "*)");
+ regex = replaceAllLiteral(dollar, regex, "\\$");
this.pattern = Pattern.compile("\\A" + regex + "\\Z");
this.count = this.pattern.matcher("foo").groupCount();