diff --git a/libpretixnfc-android/build.gradle b/libpretixnfc-android/build.gradle index 668c9c5..f5cdd63 100644 --- a/libpretixnfc-android/build.gradle +++ b/libpretixnfc-android/build.gradle @@ -1,8 +1,6 @@ -// NOTE: update versions in settings.gradle! plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' - id 'org.jetbrains.kotlin.kapt' + alias(nfcLibs.plugins.android.library) + alias(nfcLibs.plugins.kotlin.android) } android { @@ -40,11 +38,10 @@ repositories { } dependencies { - def kotlin_version = "1.9.23" // update in settings.gradle too - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.10.0' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" + implementation nfcLibs.kotlin.stdlib + implementation nfcLibs.core.ktx + implementation nfcLibs.kotlinx.coroutines.core + implementation nfcLibs.kotlinx.coroutines.android implementation files('libs/acssmc-1.1.8.jar') @@ -54,6 +51,6 @@ dependencies { implementation(project(':libpretixsync')) { transitive = false } - implementation 'io.sentry:sentry-android:8.18.0' - implementation 'com.madgag.spongycastle:prov:1.58.0.0' + implementation nfcLibs.sentry.android + implementation nfcLibs.prov } \ No newline at end of file diff --git a/libpretixnfc-android/gradle/libs.versions.toml b/libpretixnfc-android/gradle/libs.versions.toml new file mode 100644 index 0000000..2115a4a --- /dev/null +++ b/libpretixnfc-android/gradle/libs.versions.toml @@ -0,0 +1,19 @@ +[versions] +agp = "8.13.0" +kotlin = "2.2.21" +coreKtx = "1.10.0" +kotlinxCoroutinesCore = "1.7.3" +prov = "1.58.0.0" +sentryAndroid = "8.18.0" + +[libraries] +core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesCore" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" } +prov = { module = "com.madgag.spongycastle:prov", version.ref = "prov" } +sentry-android = { module = "io.sentry:sentry-android", version.ref = "sentryAndroid" } + +[plugins] +android-library = { id = "com.android.library", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } diff --git a/libpretixnfc-android/settings.gradle b/libpretixnfc-android/settings.gradle index 8c22ba8..da2ab28 100644 --- a/libpretixnfc-android/settings.gradle +++ b/libpretixnfc-android/settings.gradle @@ -8,11 +8,12 @@ pluginManagement { } } -// workaround: plugin definition with version here, so a standalone build is possible -// but building it inside the multi module project doesn't exit with "unknown version already on classpath" error -plugins { - id 'com.android.library' version '8.4.2' apply false - id 'org.jetbrains.kotlin.android' version '1.9.23' apply false +dependencyResolutionManagement { + versionCatalogs { + nfcLibs { + from(files("gradle/libs.versions.toml")) + } + } } rootProject.name = 'eu.pretix.libpretixnfc-android' diff --git a/libpretixnfc/build.gradle b/libpretixnfc/build.gradle index 031e0f2..b92c93b 100644 --- a/libpretixnfc/build.gradle +++ b/libpretixnfc/build.gradle @@ -1,7 +1,7 @@ plugins { id "java-library" id "jacoco" - id "org.jetbrains.kotlin.jvm" + alias(nfcCoreLibs.plugins.kotlin.jvm) } repositories { @@ -28,7 +28,7 @@ jacocoTestReport { check.dependsOn jacocoTestReport dependencies { - implementation "org.bouncycastle:bcpkix-jdk15to18:1.70" - implementation "org.bouncycastle:bcprov-jdk15to18:1.70" - testImplementation "junit:junit:4.13.2" + implementation nfcCoreLibs.bcpkix.jdk15to18 + implementation nfcCoreLibs.bcprov.jdk15to18 + testImplementation nfcCoreLibs.junit } diff --git a/libpretixnfc/gradle/libs.versions.toml b/libpretixnfc/gradle/libs.versions.toml new file mode 100644 index 0000000..7dae61c --- /dev/null +++ b/libpretixnfc/gradle/libs.versions.toml @@ -0,0 +1,12 @@ +[versions] +bcpkixJdk15to18 = "1.70" +junit = "4.13.2" +kotlin = "2.2.21" + +[libraries] +bcpkix-jdk15to18 = { module = "org.bouncycastle:bcpkix-jdk15to18", version.ref = "bcpkixJdk15to18" } +bcprov-jdk15to18 = { module = "org.bouncycastle:bcprov-jdk15to18", version.ref = "bcpkixJdk15to18" } +junit = { module = "junit:junit", version.ref = "junit" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } \ No newline at end of file diff --git a/libpretixnfc/settings.gradle b/libpretixnfc/settings.gradle index 60f2447..591c8a5 100644 --- a/libpretixnfc/settings.gradle +++ b/libpretixnfc/settings.gradle @@ -10,7 +10,14 @@ pluginManagement { plugins { id "org.gradle.toolchains.foojay-resolver-convention" version "1.0.0" - id "org.jetbrains.kotlin.jvm" version "2.2.21" apply false +} + +dependencyResolutionManagement { + versionCatalogs { + nfcCoreLibs { + from(files('gradle/libs.versions.toml')) + } + } } rootProject.name = "eu.pretix.libpretixnfc"