summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-11-16 00:48:29 +0100
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2023-11-16 09:11:58 +0100
commitcdd0b8e0d55de25fd6d2fef975cc7dab26ec324d (patch)
tree35d1aaf0965ff8d26ef146976c3d8ed9d85635be /android
parent67710f3e2ef57ecbe60c1bcb444ab047f11f79a5 (diff)
downloadmullvadvpn-cdd0b8e0d55de25fd6d2fef975cc7dab26ec324d.tar.xz
mullvadvpn-cdd0b8e0d55de25fd6d2fef975cc7dab26ec324d.zip
Add billing client library and billing module
Diffstat (limited to 'android')
-rw-r--r--android/buildSrc/src/main/kotlin/Dependencies.kt1
-rw-r--r--android/buildSrc/src/main/kotlin/Versions.kt1
-rw-r--r--android/lib/billing/build.gradle.kts73
-rw-r--r--android/lib/billing/src/main/AndroidManifest.xml2
-rw-r--r--android/settings.gradle.kts3
5 files changed, 79 insertions, 1 deletions
diff --git a/android/buildSrc/src/main/kotlin/Dependencies.kt b/android/buildSrc/src/main/kotlin/Dependencies.kt
index d0748afc0a..b72ae8f758 100644
--- a/android/buildSrc/src/main/kotlin/Dependencies.kt
+++ b/android/buildSrc/src/main/kotlin/Dependencies.kt
@@ -8,6 +8,7 @@ object Dependencies {
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
const val mockkWebserver = "com.squareup.okhttp3:mockwebserver:${Versions.mockWebserver}"
const val turbine = "app.cash.turbine:turbine:${Versions.turbine}"
+ 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 b9cab543a9..4ceb4f787f 100644
--- a/android/buildSrc/src/main/kotlin/Versions.kt
+++ b/android/buildSrc/src/main/kotlin/Versions.kt
@@ -11,6 +11,7 @@ object Versions {
const val mockk = "1.13.8"
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/lib/billing/build.gradle.kts b/android/lib/billing/build.gradle.kts
new file mode 100644
index 0000000000..a010534085
--- /dev/null
+++ b/android/lib/billing/build.gradle.kts
@@ -0,0 +1,73 @@
+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
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ 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
+ }
+
+ packaging {
+ resources {
+ pickFirsts += setOf(
+ // Fixes packaging error caused by: jetified-junit-*
+ "META-INF/LICENSE.md",
+ "META-INF/LICENSE-notice.md"
+ )
+ }
+ }
+}
+
+dependencies {
+ implementation(Dependencies.Kotlin.stdlib)
+ implementation(Dependencies.KotlinX.coroutinesAndroid)
+
+ implementation(Dependencies.Koin.core)
+ implementation(Dependencies.Koin.android)
+
+ //Billing library
+ implementation(Dependencies.billingClient)
+
+ //Model
+ implementation(project(Dependencies.Mullvad.modelLib))
+
+ //IPC
+ implementation(project(Dependencies.Mullvad.ipcLib))
+
+ // Test dependencies
+ testImplementation(project(Dependencies.Mullvad.commonTestLib))
+ testImplementation(Dependencies.Kotlin.test)
+ testImplementation(Dependencies.KotlinX.coroutinesTest)
+ testImplementation(Dependencies.MockK.core)
+ testImplementation(Dependencies.junit)
+ testImplementation(Dependencies.turbine)
+
+ androidTestImplementation(project(Dependencies.Mullvad.commonTestLib))
+ androidTestImplementation(Dependencies.MockK.android)
+ androidTestImplementation(Dependencies.Kotlin.test)
+ androidTestImplementation(Dependencies.KotlinX.coroutinesTest)
+ androidTestImplementation(Dependencies.turbine)
+ androidTestImplementation(Dependencies.junit)
+ androidTestImplementation(Dependencies.AndroidX.espressoContrib)
+ androidTestImplementation(Dependencies.AndroidX.espressoCore)
+}
diff --git a/android/lib/billing/src/main/AndroidManifest.xml b/android/lib/billing/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..b2d3ea1235
--- /dev/null
+++ b/android/lib/billing/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
index e47f3c08f9..53f385bae1 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",