0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Configure dependencies resolution in settings.gradle.kts

Ideally we  would use
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) to enforce
 the repositories declared in settings.gradle.kts but it currently
conflicts with a local maven repository declared in
robolectricDownloader.gradle.

The repositories lambda wasn't deleted from the AnkiDroid module as
the build failed in relation to "com.android.tools:desugar_jdk_libs"(
most likely and issue with the dependency itself) with the error:

Could not resolve all dependencies for configuration ':AnkiDroid:coreLibraryDesugaring'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/8.1.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
Could not find com.android.tools:desugar_jdk_libs:2.0.3.
Searched in the following locations:
  - file:/home/*/.m2/repository/com/android/tools/desugar_jdk_libs/2.0.3/desugar_jdk_libs-2.0.3.pom
    If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
    project :AnkiDroid
This commit is contained in:
lukstbit 2023-07-08 14:09:32 +03:00 committed by Mike Hardy
parent 6b65c45386
commit 7003e0b4d1
3 changed files with 11 additions and 9 deletions

View File

@ -7,10 +7,6 @@ plugins {
group = "com.ichi2.anki"
version = "2.0.0"
repositories {
google()
mavenCentral()
}
android {
namespace 'com.ichi2.anki.api'

View File

@ -2,11 +2,6 @@ plugins {
id 'kotlin'
}
repositories {
google()
mavenCentral()
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

View File

@ -15,4 +15,15 @@ pluginManagement {
}
}
dependencyResolutionManagement {
// TODO enforce repositories declared here, currently it clashes with robolectricDownloader.gradle
// which uses a local maven repository
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
include(":lint-rules", ":api", ":AnkiDroid")