From cfa753cb12fd933800d25152a1172f3dc23894b8 Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:53:29 -0400 Subject: [PATCH] [PM-19013] Create core module (#4836) --- core/.gitignore | 1 + core/README.md | 13 +++++++++++++ core/build.gradle.kts | 37 +++++++++++++++++++++++++++++++++++++ core/consumer-rules.pro | 0 core/proguard-rules.pro | 21 +++++++++++++++++++++ settings.gradle.kts | 9 ++++++--- 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 core/.gitignore create mode 100644 core/README.md create mode 100644 core/build.gradle.kts create mode 100644 core/consumer-rules.pro create mode 100644 core/proguard-rules.pro diff --git a/core/.gitignore b/core/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/core/.gitignore @@ -0,0 +1 @@ +/build diff --git a/core/README.md b/core/README.md new file mode 100644 index 0000000000..8a9a3043c1 --- /dev/null +++ b/core/README.md @@ -0,0 +1,13 @@ +# Core module + +A collection of platform specific objects and extensions used by other Bitwarden applications and +libraries. + +## Contents + +- [Compatibility](#compatibility) + +## Compatibility + +- **Minimum SDK**: 28 +- **Target SDK**: 35 diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 0000000000..e505eb4afc --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,37 @@ +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.bitwarden.core" + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + // Set the minimum SDK version to the SDK version used by Authenticator, which is the lowest + // universally supported SDK version. + 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()) + } + kotlinOptions { + jvmTarget = libs.versions.jvmTarget.get() + } +} + +dependencies { } diff --git a/core/consumer-rules.pro b/core/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/proguard-rules.pro b/core/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/core/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 1acc154d2c..25d7352fb4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -48,6 +48,9 @@ buildCache { } rootProject.name = "Bitwarden" -include(":app") -include(":authenticatorbridge") -include(":authenticator") +include( + ":app", + ":authenticator", + ":authenticatorbridge", + ":core", +)