This message was deleted.
# android
s
This message was deleted.
t
IIUC you should migrate to using the block in settings so that you can get away from using
allProjects
which is doing cross project configuration that breaks/blocks configuration caching. assuming you are on an android project using kts scripts. should look something like this
Copy code
rootProject.name = "Your Project"
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
    repositories {
        mavenLocal()
        mavenCentral()
        google()
        gradlePluginPortal()
        // TODO: Any other custom plugin sources here
    }
}

plugins {
    id("com.gradle.enterprise").version("3.10")
}

// TODO: all the scan configuration

dependencyResolutionManagement {
    repositories {
        mavenLocal()
        mavenCentral()
        google()
        maven {
            name = "Microsoft Duo SDK"
            setUrl("<https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1>")
        }
        maven {
            name = "vsts-maven-adal-android"
            setUrl("<https://identitydivision.pkgs.visualstudio.com/_packaging/AndroidADAL/maven/v1>")
            credentials {
                val vstsUsername: String? by settings
                val vstsMavenAccessToken: String? by settings
                username = System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") ?: vstsUsername
                password = System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") ?: vstsMavenAccessToken
            }
        }
    }
}

val localSettings = file("local.settings.gradle.kts")
if (localSettings.exists()) apply(from = localSettings)
else localSettings.createNewFile().also {
    localSettings.appendText("// Gradle's includeBuild() is Awesome!")
    localSettings.appendText("// <https://publicobject.com/2021/03/11/includebuild/>")
}

include(":all-the-projects")
s
so in my android project, we include other projects, and one of the projects is a gradle plugin project, and when I add the repositories in the settings, it starts complaining that we're declaring repos in these other projects. not sure the best way to handle it.
t
oh I just move everything up into the settings file
you can spec out what groups or artifacts can come from a repo so gradle doesn't search the wrong places for something it would never find
s
not sure i totally follow. I can't remove the repos from the submodule/subprojects that we include in the main app. is there a repository mode that will make it not complain about the sub project repos?
t
I can't remove the repos from the submodule/subprojects
why not
s
the subprojects are used elsewhere
t
hmm sounds like a structuring issue for sure. prob best to just go with the pre gradle 6.0 instructions to unblock yourself. but also start considering solutions to decoupling the projects so that you can migrate things up into settings
s
hmmm...easier said than done
t
"all you gatta do is"
s
so i was trying to explore what would happen if we moved all of the repo references to the settings in the subprojects and stuff, but one of the issues is that we have custom gradle plugins that add repositories to the project. any ideas on how that could be refactored (like can the plugins add the repos another way)?
t
I am not aware of a way to do that no.