Skip to content

Instantly share code, notes, and snippets.

@digitalbuddha
Created August 30, 2017 20:15
Show Gist options
  • Select an option

  • Save digitalbuddha/a1c27a33da6dedb287123cffb50fdf6a to your computer and use it in GitHub Desktop.

Select an option

Save digitalbuddha/a1c27a33da6dedb287123cffb50fdf6a to your computer and use it in GitHub Desktop.
//MIKE: I am sorry for following code, the reason we need this is that slf4j adds the impl in our compile tasks
//test tasks then add no-op slf4j but the impl one stil gets chosen as it is first on the classpath
def testConfig = false
configurations.all { configInner ->
if (configInner.name.contains("Unit"))
testConfig = true
}
configurations.all { config ->
if (testConfig && (config.name.contains("Unit") || config.name.contains('googleDebugCompile'))) {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name.contains('slf4j')) {
details.useTarget libraries.slf4jNoOp
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment