Merge branch '1.1.x'
This commit is contained in:
commit
16cb44f890
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2014 the original author or authors.
|
* Copyright 2012-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -308,18 +308,19 @@ public class JarCommand extends OptionParsingCommand {
|
||||||
// We only need to do it at most once
|
// We only need to do it at most once
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Remove GrabReolvers because all the dependencies are local now
|
// Disable the addition of a static initializer that calls Grape.addResolver
|
||||||
removeGrabResolver(module.getClasses());
|
// because all the dependencies are local now
|
||||||
removeGrabResolver(module.getImports());
|
disableGrabResolvers(module.getClasses());
|
||||||
|
disableGrabResolvers(module.getImports());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeGrabResolver(List<? extends AnnotatedNode> nodes) {
|
private void disableGrabResolvers(List<? extends AnnotatedNode> nodes) {
|
||||||
for (AnnotatedNode classNode : nodes) {
|
for (AnnotatedNode classNode : nodes) {
|
||||||
List<AnnotationNode> annotations = classNode.getAnnotations();
|
List<AnnotationNode> annotations = classNode.getAnnotations();
|
||||||
for (AnnotationNode node : new ArrayList<AnnotationNode>(annotations)) {
|
for (AnnotationNode node : new ArrayList<AnnotationNode>(annotations)) {
|
||||||
if (node.getClassNode().getNameWithoutPackage()
|
if (node.getClassNode().getNameWithoutPackage()
|
||||||
.equals("GrabResolver")) {
|
.equals("GrabResolver")) {
|
||||||
annotations.remove(node);
|
node.setMember("initClass", new ConstantExpression(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue