-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed StackOverflow when adding exclusions #69
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Apr 29 12:45:22 CDT 2014 | ||
#Sat Jul 05 17:55:58 CDT 2014 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -406,4 +406,43 @@ class FilteringSpec extends PluginSpecification { | |
and: | ||
doesNotContain(output, ['a2.properties']) | ||
} | ||
|
||
@Issue("SHADOW-69") | ||
def "handle exclude with circular dependency"() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there actual example of this out in the wild (i.e. circular dependencies in the POM files)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming you ran into one and that's what revealed this problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the original bug had my stacktrace from real code in the wild. The dependencies where pretty messy, so it wasn't as clean as the simple unit test. |
||
given: | ||
repo.module('shadow', 'c', '1.0') | ||
.insertFile('c.properties', 'c') | ||
.dependsOn('d') | ||
.publish() | ||
repo.module('shadow', 'd', '1.0') | ||
.insertFile('d.properties', 'd') | ||
.dependsOn('c') | ||
.publish() | ||
|
||
buildFile << ''' | ||
|dependencies { | ||
| compile 'shadow:d:1.0' | ||
|} | ||
| | ||
|shadowJar { | ||
| dependencies { | ||
| exclude(dependency('shadow:d:1.0')) | ||
| } | ||
|} | ||
'''.stripMargin() | ||
|
||
when: | ||
runner.arguments << 'shadowJar' | ||
ExecutionResult result = runner.run() | ||
|
||
then: | ||
success(result) | ||
|
||
and: | ||
contains(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties']) | ||
|
||
and: | ||
doesNotContain(output, ['d.properties']) | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to split this out into a separate method. You could rely on the behavior of
Set
that it returns aboolean
only if the item is added to the Set. So something like,There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this would work, but you still need to recurse into the children, even if it doesn't match