0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-19 11:32:27 +02:00

Use gradle catalog to align project dependencies across modules/gradle files

This commit is contained in:
conorsmith 2023-09-03 16:40:59 +02:00 committed by Arne Schwabe
parent 29e3cc3727
commit 5719f6dc6b
6 changed files with 84 additions and 55 deletions

View File

@ -3,25 +3,7 @@
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
buildscript {
var kotlin_version: String by extra
kotlin_version = "1.9.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
}

40
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,40 @@
[versions]
kotlin = "1.9.0"
constraintlayout = "2.1.4"
cardview = "1.0.0"
recyclerview = "1.3.0"
appcompat = "1.6.1"
mpandroidchart = "v3.1.0"
okhttp = "4.10.0"
core-ktx = "1.10.1"
fragment-ktx = "1.6.0"
preference-ktx = "1.2.0"
material = "1.7.0"
androidx-webkit = "1.7.0"
androidx-lifecycle-viewmodel-ktx = "2.6.1"
androidx-lifecycle-runtime-ktx = "2.6.1"
androidx-security-crypto = "1.1.0-alpha06"
androidx-annotation = "1.6.0"
android-gradle-plugin = "8.1.1"
[libraries]
kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
androidx-cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardview" }
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
mpandroidchart = { group = "com.github.PhilJay", name = "MPAndroidChart", version.ref = "mpandroidchart" }
square-okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
androidx-core-ktx = { group = "androidx.core", name = "core", version.ref = "core-ktx" }
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment-ktx" }
androidx-preference-ktx = { group = "androidx.preference", name = "preference-ktx", version.ref = "preference-ktx" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-webkit = { group = "androidx.webkit", name = "webkit", version.ref = "androidx-webkit" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-viewmodel-ktx" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "androidx-lifecycle-runtime-ktx" }
androidx-security-crypto = { group = "androidx.security", name = "security-crypto", version.ref = "androidx-security-crypto" }
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" }
[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

View File

@ -6,10 +6,9 @@ import com.android.build.gradle.api.ApplicationVariant
*/
plugins {
id("com.android.application")
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("checkstyle")
id("kotlin-android")
}
android {
@ -232,36 +231,25 @@ android.applicationVariants.all(object : Action<ApplicationVariant> {
dependencies {
// https://maven.google.com/web/index.html
// https://developer.android.com/jetpack/androidx/releases/core
val preferenceVersion = "1.2.0"
val coreVersion = "1.10.1"
val materialVersion = "1.7.0"
val fragment_version = "1.6.0"
implementation("androidx.annotation:annotation:1.6.0")
implementation("androidx.core:core:$coreVersion")
implementation(libs.androidx.annotation)
// Is there a nicer way to do this?
dependencies.add("uiImplementation", "androidx.constraintlayout:constraintlayout:2.1.4")
dependencies.add("uiImplementation", "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.22")
dependencies.add("uiImplementation", "androidx.cardview:cardview:1.0.0")
dependencies.add("uiImplementation", "androidx.recyclerview:recyclerview:1.3.0")
dependencies.add("uiImplementation", "androidx.appcompat:appcompat:1.6.1")
dependencies.add("uiImplementation", "com.github.PhilJay:MPAndroidChart:v3.1.0")
dependencies.add("uiImplementation", "com.squareup.okhttp3:okhttp:4.10.0")
dependencies.add("uiImplementation", "androidx.core:core:$coreVersion")
dependencies.add("uiImplementation", "androidx.core:core-ktx:$coreVersion")
dependencies.add("uiImplementation", "androidx.fragment:fragment-ktx:$fragment_version")
dependencies.add("uiImplementation", "androidx.preference:preference:$preferenceVersion")
dependencies.add("uiImplementation", "androidx.preference:preference-ktx:$preferenceVersion")
dependencies.add("uiImplementation", "com.google.android.material:material:$materialVersion")
dependencies.add("uiImplementation", "androidx.webkit:webkit:1.7.0")
dependencies.add("uiImplementation", "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
dependencies.add("uiImplementation", "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
dependencies.add("uiImplementation","androidx.security:security-crypto:1.1.0-alpha06")
dependencies.add("uiImplementation", libs.kotlin)
dependencies.add("uiImplementation", libs.androidx.appcompat)
dependencies.add("uiImplementation", libs.androidx.constraintlayout)
dependencies.add("uiImplementation", libs.androidx.cardview)
dependencies.add("uiImplementation", libs.androidx.recyclerview)
dependencies.add("uiImplementation", libs.androidx.core.ktx)
dependencies.add("uiImplementation", libs.androidx.fragment.ktx)
dependencies.add("uiImplementation", libs.androidx.preference.ktx)
dependencies.add("uiImplementation", libs.androidx.webkit)
dependencies.add("uiImplementation", libs.androidx.lifecycle.viewmodel.ktx)
dependencies.add("uiImplementation", libs.androidx.lifecycle.runtime.ktx)
dependencies.add("uiImplementation", libs.androidx.security.crypto)
dependencies.add("uiImplementation", libs.mpandroidchart)
dependencies.add("uiImplementation", libs.square.okhttp)
dependencies.add("uiImplementation", libs.material)
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21")
testImplementation("junit:junit:4.13.2")

View File

@ -3,8 +3,9 @@
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
apply plugin: 'com.android.application'
plugins {
alias libs.plugins.android.application
}
android {
compileSdkVersion 33

View File

@ -2,6 +2,22 @@
* Copyright (c) 2012-2016 Arne Schwabe
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
include(":main")
include(":tlsexternalcertprovider")

View File

@ -3,7 +3,9 @@
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
apply plugin: 'com.android.application'
plugins {
alias libs.plugins.android.application
}
ext {
bouncycastleVersion = '1.49'