I'd like to freely modify artifact names of dependencies in my build.gradle
file as part of an Android project. To do so I'm starting off with a custom configuration as show here, but instead of filtering I'd like to search and replace / map names:
configurations {
mymodule
}
dependencies {
mymodule 'mygroup:mymodule:1.1.1'
// How to do something with configurations.mymodule to map e.g.
// 'some-name-1.0.jar' to 'some-other-name-1.0.jar' instead of filtering?
compile configurations.mymodule.filter { it.name == 'mymodule-client-1.1.1.jar' }
}
According to this answer configurations are just (lazy) FileCollections, but being new to Gradle / Groovy I simply cannot figure out the syntax.
I've tried
compile configurations.mymodule.collect { new File(it.path, it.name.replaceAll('some-name', 'some-other-name') ) }
but that does not seem to change anything WRT the file names.