How to Access Code From Included Build Within Composite Project

I have an Android project where I define dependencies on aar files hosted in maven. In my settings.gradle file I use dependency substitution to replace the aar with an includeBuild since I have the modules it relies on in the same project. However, when I make a change to one of these modules it is dependent on, the composite does not see this new code (can’t auto complete through IDE) and the build fails. When the build fails it shows that it is still referencing the aar rather than the included build. When I run androidDependencies gradle task though, I can verify that the aar is being replaced with the local build.

Do I need to set up some sort of task hook here? Meaning, do I need to make my composite build somehow substitute and build its dependencies first before building itself? If so, how would I go about that?

My Settings.gradle file for the project that is trying to use and includedBuild looks like this:

def integrationDependency = "example.company.test:api"

// Boolean toggle that is set by the build system
if(isIntegrationBuild.toBoolean()) {
    println "Using integration build for: " + integrationDependency
    includeBuild('../../example-base/example-api') {
        dependencySubstitution {
            substitute module(integrationDependency) using project(':api')
        }
    }
}

Again, I have confirmed there is no error in this definition above, running androidDependencies lists all dependencies for the given module and it shows that it is in fact using :api rather than the downloaded aar.

In my module level build.gradle where I am looking to sub the dependency, I have tried something like this:

preBuild.dependsOn gradle.includedBuild('example-api').task(':api:build')

but no luck, I think I am on the right track, I am just missing something. Any help would be appreciated.