Tag Archives: android

Provided Scope in Gradle

A few days ago, in Android Dependency Double Trouble, I needed to add something like Maven’s provided scope to a Gradle Java project. I learned how to do it from How do I best define dependencies as “provided”?, which offered two methods. The first looked like the simplest, but I couldn’t get it to work. Still, I got the second way working, and then moved on. I left myself a note to come back someday and figure out how I was messing up the simpler method.

I’d used the provided scope for a dependency from a project named TestSupport onto one named Core. Today I hit a problem when adding tests to my TestSupport project (that’s right, tests that test the code that supports my tests): the tests couldn’t find classes in the Core project. While flailing around to try and fix it, I learned more about the differences between the two methods of dealing with the provided configuration, and how to have fully working builds, with TestSupport tests, using either method. Continue reading Provided Scope in Gradle