Skip to content

Commit

Permalink
Update dependency resolution management (#2000)
Browse files Browse the repository at this point in the history
## Changes
* get rid of the JCenter repository
* centralize repository declaration for all projects in project settings
* refactor `build.gradle` and `settings.gradle` from Groovy syntax to
Kotlin DSL (thus replacing those files with `build.gradle.kts` and
`settings.gradle.kts` respectively)

The remaining `build.gradle` files are refactored in:
#2022
  • Loading branch information
adamszewe committed Jan 3, 2024
1 parent 58e0230 commit 5c249ae
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
25 changes: 10 additions & 15 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
extra.apply {
// Cannot be called "ndkVersion" as that leads to naming collision
// Changes to this value must be reflected in `./docker/Dockerfile`
ndkVersionShared = '25.2.9519653'
set("ndkVersionShared", "25.2.9519653")

}

repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.36.0'
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.github.ben-manes:gradle-versions-plugin:0.36.0")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
maven { url = "https://jitpack.io" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}
1 change: 0 additions & 1 deletion settings.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = java.net.URI("https://jitpack.io") }
}
}

include(
":app",
":syncthing"
)

0 comments on commit 5c249ae

Please sign in to comment.