diff options
| author | Kalle Lindström <karl.lindstrom@mullvad.net> | 2024-12-19 13:19:26 +0100 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2024-12-19 13:29:41 +0100 |
| commit | 32e72469d5287af2e38231d69f078b98fb651bf4 (patch) | |
| tree | 221c91dfa86c2aadcabbdc78e4059e2be4092476 /android | |
| parent | 83b08bf485a753f63d8dbe6101740f42efda6bc4 (diff) | |
| download | mullvadvpn-32e72469d5287af2e38231d69f078b98fb651bf4.tar.xz mullvadvpn-32e72469d5287af2e38231d69f078b98fb651bf4.zip | |
Add proto datastore dependency
Diffstat (limited to 'android')
| -rw-r--r-- | android/app/build.gradle.kts | 28 | ||||
| -rw-r--r-- | android/app/src/main/proto/user_prefs.proto | 6 | ||||
| -rw-r--r-- | android/gradle/libs.versions.toml | 14 | ||||
| -rw-r--r-- | android/lib/daemon-grpc/build.gradle.kts | 2 |
4 files changed, 36 insertions, 14 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index cb5737e3ff..5fed7575d4 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -12,6 +12,7 @@ plugins { alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.ksp) alias(libs.plugins.compose) + alias(libs.plugins.protobuf.core) id(Dependencies.junit5AndroidPluginId) version Versions.junit5Plugin } @@ -55,11 +56,7 @@ android { } } - playConfigs { - register("playStagemoleRelease") { - enabled = true - } - } + playConfigs { register("playStagemoleRelease") { enabled = true } } androidResources { @Suppress("UnstableApiUsage") @@ -222,8 +219,7 @@ android { } val variantName = name - val capitalizedVariantName = - variantName.toString().capitalized() + val capitalizedVariantName = variantName.toString().capitalized() val artifactName = "MullvadVPN-${versionName}${artifactSuffix}" tasks.register<Copy>("create${capitalizedVariantName}DistApk") { @@ -316,7 +312,8 @@ tasks.create("printVersion") { play { serviceAccountCredentials.set(file("$credentialsPath/play-api-key.json")) - // Disable for all flavors by default. Only specific flavors should be enabled using PlayConfigs. + // Disable for all flavors by default. Only specific flavors should be enabled using + // PlayConfigs. enabled = false // This property refers to the Publishing API (not git). commit = true @@ -326,6 +323,19 @@ play { userFraction = 1.0 } +protobuf { + protoc { artifact = libs.plugins.protobuf.protoc.get().toString() } + plugins { + create("java") { artifact = libs.plugins.grpc.protoc.gen.grpc.java.get().toString() } + } + generateProtoTasks { + all().forEach { + it.plugins { create("java") { option("lite") } } + it.builtins { create("kotlin") { option("lite") } } + } + } +} + dependencies { implementation(projects.lib.common) implementation(projects.lib.daemonGrpc) @@ -345,6 +355,7 @@ dependencies { implementation(libs.commons.validator) implementation(libs.androidx.activity.compose) + implementation(libs.androidx.datastore) implementation(libs.androidx.ktx) implementation(libs.androidx.coresplashscreen) implementation(libs.androidx.lifecycle.runtime) @@ -370,6 +381,7 @@ dependencies { implementation(libs.kotlin.reflect) implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) + implementation(libs.protobuf.kotlin.lite) // UI tooling implementation(libs.compose.ui.tooling.preview) diff --git a/android/app/src/main/proto/user_prefs.proto b/android/app/src/main/proto/user_prefs.proto new file mode 100644 index 0000000000..3a7e79285f --- /dev/null +++ b/android/app/src/main/proto/user_prefs.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; + +option java_package = "net.mullvad.mullvadvpn.repository"; +option java_multiple_files = true; + +message UserPreferences { bool is_privacy_disclosure_accepted = 1; } diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 0a4b42d804..16a900284e 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -13,6 +13,7 @@ androidx-activitycompose = "1.9.3" androidx-appcompat = "1.7.0" androidx-ktx = "1.15.0" androidx-coresplashscreen = "1.1.0-rc01" +androidx-datastore = "1.1.1" androidx-espresso = "3.6.1" androidx-lifecycle = "2.8.7" androidx-test = "1.6.1" @@ -33,7 +34,6 @@ compose-material3 = "1.3.1" grpc = "1.69.0" grpc-kotlin = "1.4.1" grpc-kotlin-jar = "1.4.1:jdk8@jar" -grpc-protobuf = "4.29.1" # Koin koin = "4.0.0" @@ -51,7 +51,8 @@ kotlinx = "1.9.0" kotlinx-serialization = "2.1.0" # Protobuf -protobuf = "0.9.4" +protobuf-gradle-plugin = "0.9.4" +protobuf = "4.29.1" # Misc commonsvalidator = "1.9.0" @@ -81,6 +82,7 @@ android-volley = { module = "com.android.volley:volley", version.ref = "android- androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activitycompose" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } androidx-coresplashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-coresplashscreen" } +androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidx-datastore" } androidx-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" } androidx-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-ktx" } androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } @@ -119,7 +121,9 @@ grpc-okhttp = { module = "io.grpc:grpc-okhttp", version.ref = "grpc" } grpc-android = { module = "io.grpc:grpc-android", version.ref = "grpc" } grpc-kotlin-stub = { module = "io.grpc:grpc-kotlin-stub", version.ref = "grpc-kotlin" } grpc-protobuf-lite = { module = "io.grpc:grpc-protobuf-lite", version.ref = "grpc" } -grpc-protobuf-kotlin-lite = { module = "com.google.protobuf:protobuf-kotlin-lite", version.ref = "grpc-protobuf" } + +# Protobuf +protobuf-kotlin-lite = { module = "com.google.protobuf:protobuf-kotlin-lite", version.ref = "protobuf" } # Koin koin = { module = "io.insert-koin:koin-core", version.ref = "koin" } @@ -177,8 +181,8 @@ kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp" } kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinx-serialization" } # Protobuf -protobuf-core = { id = "com.google.protobuf", version.ref = "protobuf" } -protobuf-protoc = { id = "com.google.protobuf:protoc", version.ref = "grpc-protobuf" } +protobuf-core = { id = "com.google.protobuf", version.ref = "protobuf-gradle-plugin" } +protobuf-protoc = { id = "com.google.protobuf:protoc", version.ref = "protobuf" } # gRPC grpc-protoc-gen-grpc-java = { id = "io.grpc:protoc-gen-grpc-java", version.ref = "grpc" } diff --git a/android/lib/daemon-grpc/build.gradle.kts b/android/lib/daemon-grpc/build.gradle.kts index e1807c9d34..9383121547 100644 --- a/android/lib/daemon-grpc/build.gradle.kts +++ b/android/lib/daemon-grpc/build.gradle.kts @@ -73,7 +73,7 @@ dependencies { implementation(libs.grpc.android) implementation(libs.grpc.kotlin.stub) implementation(libs.grpc.protobuf.lite) - implementation(libs.grpc.protobuf.kotlin.lite) + implementation(libs.protobuf.kotlin.lite) implementation(libs.arrow) implementation(libs.arrow.optics) |
