File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
docs/configuration/dependencies
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,14 @@ Any of the individual fields can be safely absent and will function as though a
229229
230230The above code snippet is functionally equivalent to the previous example.
231231
232- This same pattern can be used for any of the dependency notation fields.
232+ This same pattern can be used for any of the dependency notation fields. e.g.
233+
234+ - ` org.apache.logging.log4j:.* `
235+ - ` org.apache.logging.log4j:log4j.* `
236+ - ` org.apache.logging.log4j:log4j-core:.* `
237+ - ` org.apache.logging.*:log4j-core:.* `
238+ - ` .*:log4j-core:.* `
239+ - ...
233240
234241=== "Kotlin"
235242
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import org.junit.jupiter.api.BeforeAll
88import org.junit.jupiter.api.BeforeEach
99import org.junit.jupiter.api.Test
1010import org.junit.jupiter.params.ParameterizedTest
11+ import org.junit.jupiter.params.provider.MethodSource
1112import org.junit.jupiter.params.provider.ValueSource
1213
1314class FilteringTest : BasePluginTest () {
@@ -73,16 +74,17 @@ class FilteringTest : BasePluginTest() {
7374 commonAssertions()
7475 }
7576
76- @Test
77- fun excludeDependencyUsingWildcardSyntax () {
77+ @ParameterizedTest
78+ @MethodSource(" wildcardDepProvider" )
79+ fun excludeDependencyUsingWildcardSyntax (wildcard : String ) {
7880 projectScriptPath.appendText(
7981 """
8082 dependencies {
8183 implementation 'my:d:1.0'
8284 }
8385 $shadowJar {
8486 dependencies {
85- exclude(dependency('my:d:.* '))
87+ exclude(dependency('$wildcard '))
8688 }
8789 }
8890 """ .trimIndent(),
@@ -240,4 +242,16 @@ class FilteringTest : BasePluginTest() {
240242 )
241243 }
242244 }
245+
246+ private companion object {
247+ @JvmStatic
248+ fun wildcardDepProvider () = listOf (
249+ " my:d" ,
250+ " m.*:d" ,
251+ " my:d:.*" ,
252+ " m.*:d:.*" ,
253+ " m.*:d.*:.*" ,
254+ " .*:d:.*" ,
255+ )
256+ }
243257}
You can’t perform that action at this time.
0 commit comments