From 7938c8c2bb0d15306185a8bc3a2c8a71f35f27f6 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:42:12 -0400 Subject: [PATCH] [PM-19832] Create `data` module (#4973) --- .github/workflows/test.yml | 1 + build.gradle.kts | 2 ++ data/.gitignore | 1 + data/README.md | 12 ++++++++++++ data/build.gradle.kts | 40 ++++++++++++++++++++++++++++++++++++++ data/consumer-rules.pro | 0 data/proguard-rules.pro | 21 ++++++++++++++++++++ settings.gradle.kts | 1 + 8 files changed, 78 insertions(+) create mode 100644 data/.gitignore create mode 100644 data/README.md create mode 100644 data/build.gradle.kts create mode 100644 data/consumer-rules.pro create mode 100644 data/proguard-rules.pro diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee8c4897e5..5bebcaac40 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,6 +85,7 @@ jobs: authenticator/build/reports/tests/ authenticatorbridge/build/reports/tests/ core/build/reports/tests/ + data/build/reports/tests/ network/build/reports/tests/ - name: Upload to codecov.io diff --git a/build.gradle.kts b/build.gradle.kts index d755b30740..599dbb0f5e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { kover(project(":authenticator")) kover(project(":authenticatorbridge")) kover(project(":core")) + kover(project(":data")) kover(project(":network")) } @@ -31,6 +32,7 @@ detekt { "authenticator/src", "authenticatorbridge/src", "core/src", + "data/src", "network/src", ) } diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1 @@ +/build diff --git a/data/README.md b/data/README.md new file mode 100644 index 0000000000..344beea720 --- /dev/null +++ b/data/README.md @@ -0,0 +1,12 @@ +# Data module + +An Android library containing common data sources, types, and utilities. + +## Contents + +- [Compatibility](#compatibility) + +## Compatibility + +- **Minimum SDK**: 28 +- **Target SDK**: 35 diff --git a/data/build.gradle.kts b/data/build.gradle.kts new file mode 100644 index 0000000000..601fb4bbc4 --- /dev/null +++ b/data/build.gradle.kts @@ -0,0 +1,40 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.bitwarden.data" + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + minSdk = libs.versions.minSdkBwa.get().toInt() + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } + compileOptions { + sourceCompatibility(libs.versions.jvmTarget.get()) + targetCompatibility(libs.versions.jvmTarget.get()) + } +} + +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get())) + } +} + +dependencies { } diff --git a/data/consumer-rules.pro b/data/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/data/proguard-rules.pro b/data/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/data/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/settings.gradle.kts b/settings.gradle.kts index b57dd37567..212655dd8b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -53,5 +53,6 @@ include( ":authenticator", ":authenticatorbridge", ":core", + ":data", ":network", )