use of org.apache.tools.ant.filters.LineContainsRegExp in project ant-ivy by apache.
the class IvyExtractFromSources method configureConcat.
private void configureConcat() {
concat.setProject(getProject());
concat.setTaskName(getTaskName());
FilterChain filterChain = new FilterChain();
LineContainsRegExp lcre = new LineContainsRegExp();
RegularExpression regexp = new RegularExpression();
regexp.setPattern("^import .+;");
lcre.addConfiguredRegexp(regexp);
filterChain.add(lcre);
TokenFilter tf = new TokenFilter();
TokenFilter.ReplaceRegex rre = new TokenFilter.ReplaceRegex();
rre.setPattern("import (.+);.*");
rre.setReplace("\\1");
tf.add(rre);
filterChain.add(tf);
concat.addFilterChain(filterChain);
}
use of org.apache.tools.ant.filters.LineContainsRegExp in project ant by apache.
the class AbstractJarSignerTask method createRedirector.
/**
* Create the redirector to use, if any.
*
* @return a configured RedirectorElement.
*/
private RedirectorElement createRedirector() {
RedirectorElement result = new RedirectorElement();
if (storepass != null) {
StringBuilder input = new StringBuilder(storepass).append('\n');
if (keypass != null) {
input.append(keypass).append('\n');
}
result.setInputString(input.toString());
result.setLogInputString(false);
// Try to avoid showing password prompts on log output, as they would be confusing.
LineContainsRegExp filter = new LineContainsRegExp();
RegularExpression rx = new RegularExpression();
// TODO only handles English locale, not ja or zh_CN
rx.setPattern("^(Enter Passphrase for keystore: |Enter key password for .+: )$");
filter.addConfiguredRegexp(rx);
filter.setNegate(true);
result.createErrorFilterChain().addLineContainsRegExp(filter);
}
return result;
}
Aggregations