From b6dc58d141324cfe9da9ac422f11f0f46e0009f3 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Mon, 21 Aug 2023 12:01:05 +0200 Subject: [PATCH] Add billing client library and billing module --- .../buildSrc/src/main/kotlin/Dependencies.kt | 1 + android/buildSrc/src/main/kotlin/Versions.kt | 1 + android/gradle/verification-metadata.xml | 40 +++++++++++++++++++ android/lib/billing/build.gradle.kts | 33 +++++++++++++++ .../lib/billing/src/main/AndroidManifest.xml | 4 ++ android/settings.gradle.kts | 3 +- 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 android/lib/billing/build.gradle.kts create mode 100644 android/lib/billing/src/main/AndroidManifest.xml diff --git a/android/buildSrc/src/main/kotlin/Dependencies.kt b/android/buildSrc/src/main/kotlin/Dependencies.kt index 2aa2db27d61e..879abbb4f4ea 100644 --- a/android/buildSrc/src/main/kotlin/Dependencies.kt +++ b/android/buildSrc/src/main/kotlin/Dependencies.kt @@ -7,6 +7,7 @@ object Dependencies { const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}" const val turbine = "app.cash.turbine:turbine:${Versions.turbine}" const val mockkWebserver = "com.squareup.okhttp3:mockwebserver:${Versions.mockWebserver}" + const val billingClient = "com.android.billingclient:billing-ktx:${Versions.billingClient}" object AndroidX { const val appcompat = "androidx.appcompat:appcompat:${Versions.AndroidX.appcompat}" diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index 589ab841eb69..120712d2f72c 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -12,6 +12,7 @@ object Versions { const val mockk = "1.13.3" const val mockWebserver = "4.11.0" const val turbine = "1.0.0" + const val billingClient = "6.0.1" object Android { const val compileSdkVersion = 33 diff --git a/android/gradle/verification-metadata.xml b/android/gradle/verification-metadata.xml index 43dca635c26e..4eb045c06a8b 100644 --- a/android/gradle/verification-metadata.xml +++ b/android/gradle/verification-metadata.xml @@ -1483,6 +1483,16 @@ + + + + + + + + + + @@ -1986,6 +1996,21 @@ + + + + + + + + + + + + + + + @@ -2077,6 +2102,21 @@ + + + + + + + + + + + + + + + diff --git a/android/lib/billing/build.gradle.kts b/android/lib/billing/build.gradle.kts new file mode 100644 index 000000000000..91dd56506623 --- /dev/null +++ b/android/lib/billing/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id(Dependencies.Plugin.androidLibraryId) + id(Dependencies.Plugin.kotlinAndroidId) +} + +android { + namespace = "net.mullvad.mullvadvpn.lib.billing" + compileSdk = Versions.Android.compileSdkVersion + + defaultConfig { + minSdk = Versions.Android.minSdkVersion + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = Versions.jvmTarget + } + + lint { + lintConfig = file("${rootProject.projectDir}/config/lint.xml") + abortOnError = true + warningsAsErrors = true + } +} + +dependencies { + //Billing library + implementation(Dependencies.billingClient) +} diff --git a/android/lib/billing/src/main/AndroidManifest.xml b/android/lib/billing/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..8bdb7e14b389 --- /dev/null +++ b/android/lib/billing/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 03bb8c781c94..0e77b19272e2 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -11,7 +11,8 @@ include( ":lib:resource", ":lib:talpid", ":lib:theme", - ":lib:common-test" + ":lib:common-test", + ":lib:billing" ) include( ":test",