From 5f475c56b7bfa0ea2a5b8484d29fa363f465177a Mon Sep 17 00:00:00 2001 From: LoveSy Date: Tue, 27 Jun 2023 15:52:48 +0800 Subject: [PATCH] Use version category --- .github/dependabot.yml | 20 ++++++++++++++++++++ gradle/libs.versions.toml | 14 ++++++++++++++ lsplant/build.gradle.kts | 4 ++-- settings.gradle.kts | 4 ---- test/build.gradle.kts | 10 +++++----- 5 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 gradle/libs.versions.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..611a52d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + - package-ecosystem: gradle + directory: "/" + schedule: + interval: daily + time: "21:00" + open-pull-requests-limit: 10 + target-branch: master + registries: + - maven-google + - gralde-plugin + +registries: + maven-google: + type: maven-repository + url: "https://dl.google.com/dl/android/maven2/" + gralde-plugin: + type: maven-repository + url: "https://plugins.gradle.org/m2/" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..34cefeb --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,14 @@ +[versions] +agp = "8.0.2" + +[plugins] +agp-app = { id = "com.android.application", version.ref = "agp" } +agp-lib = { id = "com.android.library", version.ref = "agp" } + +[libraries] +cxx = { module = "dev.rikka.ndk.thirdparty:cxx", version = "1.2.0" } +dobby = { module = "io.github.vvb2060.ndk:dobby", version = "1.2" } +test-ext-junit = { module = "androidx.test.ext:junit", version = "1.1.5" } +test-runner = { module = "androidx.test:runner", version = "1.5.2" } +test-espresso = { module = "androidx.test.espresso:espresso-core", version = "3.5.1" } + diff --git a/lsplant/build.gradle.kts b/lsplant/build.gradle.kts index a553488..e99b1a1 100644 --- a/lsplant/build.gradle.kts +++ b/lsplant/build.gradle.kts @@ -3,7 +3,7 @@ import org.eclipse.jgit.api.Git import org.eclipse.jgit.storage.file.FileRepositoryBuilder plugins { - id("com.android.library") + alias(libs.plugins.agp.lib) id("maven-publish") id("signing") } @@ -253,7 +253,7 @@ publishing { } } dependencies { - "standaloneCompileOnly"("dev.rikka.ndk.thirdparty:cxx:1.2.0") + "standaloneCompileOnly"(libs.cxx) } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 769fc89..4272745 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,10 +4,6 @@ pluginManagement { google() mavenCentral() } - plugins { - id("com.android.application") version "8.0.2" - id("com.android.library") version "8.0.2" - } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) diff --git a/test/build.gradle.kts b/test/build.gradle.kts index 1644d37..be5b51e 100644 --- a/test/build.gradle.kts +++ b/test/build.gradle.kts @@ -1,7 +1,7 @@ import com.android.build.api.dsl.ManagedVirtualDevice plugins { - id("com.android.application") + alias(libs.plugins.agp.app) } val androidTargetSdkVersion: Int by rootProject.extra @@ -90,10 +90,10 @@ android { dependencies { implementation(project(":lsplant")) - implementation("io.github.vvb2060.ndk:dobby:1.2") + implementation(libs.dobby) - androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test:runner:1.5.2") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + androidTestImplementation(libs.test.ext.junit) + androidTestImplementation(libs.test.runner) + androidTestImplementation(libs.test.espresso) }