Skip to content

Instantly share code, notes, and snippets.

@PabloProta
Last active March 26, 2023 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PabloProta/aade6abfa009bfe1f54405da279df0d9 to your computer and use it in GitHub Desktop.
Save PabloProta/aade6abfa009bfe1f54405da279df0d9 to your computer and use it in GitHub Desktop.
project/settings.gradle.kts
pluginManagement {
/**
* The pluginManagement {repositories {...}} block configures the
* repositories Gradle uses to search or download the Gradle plugins and
* their transitive dependencies. Gradle pre-configures support for remote
* repositories such as JCenter, Maven Central, and Ivy. You can also use
* local repositories or define your own remote repositories. The code below
* defines the Gradle Plugin Portal, Google's Maven repository,
* and the Maven Central Repository as the repositories Gradle should use to look for its
* dependencies.
*/
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
/**
* The dependencyResolutionManagement {repositories {...}}
* block is where you configure the repositories and dependencies used by
* all modules in your project, such as libraries that you are using to
* create your application. However, you should configure module-specific
* dependencies in each module-level build.gradle file. For new projects,
* Android Studio includes Google's Maven repository and the Maven Central
* Repository by default, but it does not configure any dependencies (unless
* you select a template that requires some).
*/
/**
* This part tell to the gradle that the project will acept only inject the
* repositories dependencies from here, otherwise, in case that you try to add
* in a any gradle build file on module level the build will crash.
*/
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
/*
* These are the repositories in the examples that i'm using
* to download de dependencies for all modules. e.g:
* i need in a module the "com.android.application" depdendencie
* that comes from the maven central repository, so for use it
* without any problems we need to declare it here and not in the
* module level build file.
*/
repositories {
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include(":app")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment