-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efe625c
commit de4a89a
Showing
4 changed files
with
16 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ class FilteringSpec extends PluginSpecification { | |
doesNotContain(output, ['a2.properties']) | ||
} | ||
|
||
def "exclude dependency and its transitives"() { | ||
def "exclude dependency"() { | ||
given: | ||
repo.module('shadow', 'c', '1.0') | ||
.insertFile('c.properties', 'c') | ||
|
@@ -101,50 +101,14 @@ class FilteringSpec extends PluginSpecification { | |
then: | ||
success(result) | ||
|
||
and: | ||
contains(output, ['a.properties', 'a2.properties', 'b.properties']) | ||
|
||
and: | ||
doesNotContain(output, ['c.properties', 'd.properties']) | ||
} | ||
|
||
def "exclude dependency but retain transitives"() { | ||
given: | ||
repo.module('shadow', 'c', '1.0') | ||
.insertFile('c.properties', 'c') | ||
.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'), false) | ||
| } | ||
|} | ||
'''.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']) | ||
} | ||
|
||
def "include dependency and transitives, excluding all others"() { | ||
def "include dependency, excluding all others"() { | ||
given: | ||
repo.module('shadow', 'c', '1.0') | ||
.insertFile('c.properties', 'c') | ||
|
@@ -179,10 +143,10 @@ class FilteringSpec extends PluginSpecification { | |
success(result) | ||
|
||
and: | ||
contains(output, ['c.properties', 'd.properties', 'shadow/Passed.class']) | ||
contains(output, ['d.properties', 'shadow/Passed.class']) | ||
|
||
and: | ||
doesNotContain(output, ['a.properties', 'a2.properties', 'b.properties']) | ||
doesNotContain(output, ['a.properties', 'a2.properties', 'b.properties', 'c.properties']) | ||
} | ||
|
||
def 'filter project dependencies'() { | ||
|
@@ -236,11 +200,10 @@ class FilteringSpec extends PluginSpecification { | |
and: | ||
doesNotContain(serverOutput, [ | ||
'client/Client.class', | ||
'junit/framework/Test.class' | ||
]) | ||
|
||
and: | ||
contains(serverOutput, ['server/Server.class']) | ||
contains(serverOutput, ['server/Server.class', 'junit/framework/Test.class']) | ||
} | ||
|
||
def 'exclude a transitive project dependency'() { | ||
|
@@ -304,48 +267,6 @@ class FilteringSpec extends PluginSpecification { | |
'server/Server.class']) | ||
} | ||
|
||
@Ignore('need to figure out best way to do nested filtering') | ||
def 'exclude a dependency but include one of its dependencies'() { | ||
given: | ||
repo.module('shadow', 'c', '1.0') | ||
.insertFile('c.properties', 'c') | ||
.publish() | ||
repo.module('shadow', 'd', '1.0') | ||
.insertFile('d.properties', 'd') | ||
.publish() | ||
repo.module('shadow', 'e', '1.0') | ||
.insertFile('e.properties', 'e') | ||
.dependsOn('c', 'd') | ||
.publish() | ||
|
||
buildFile << ''' | ||
|dependencies { | ||
| compile 'shadow:e:1.0' | ||
|} | ||
| | ||
|shadowJar { | ||
| dependencies { | ||
| exclude(dependency('shadow:e:1.0')) { | ||
| include(dependency('shadow:a: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', 'e.properties']) | ||
} | ||
|
||
//http://mail-archives.apache.org/mod_mbox/ant-user/200506.mbox/%[email protected]%3E | ||
def 'verify exclude precedence over include'() { | ||
given: | ||
|