[PM-19738] Create network module

Create a library module responsible for communicating with the Bitwarden network API.

Additionally, the following changes were made to checks and workflows:
- Updated `build.gradle.kts` to include Kover for the `network` module.
- Updated `Fastfile` to include lint, test and kover report generation tasks for the `network` module.
This commit is contained in:
Patrick Honkonen 2025-03-28 16:12:24 -04:00
parent 5d5bc25a45
commit a2f4e4f3b5
No known key found for this signature in database
GPG Key ID: B63AF42A5531C877
10 changed files with 80 additions and 1 deletions

View File

@ -85,6 +85,7 @@ jobs:
authenticator/build/reports/tests/
authenticatorbridge/build/reports/tests/
core/build/reports/tests/
network/build/reports/tests/
- name: Upload to codecov.io
id: upload-to-codecov

View File

@ -20,6 +20,7 @@ dependencies {
kover(project(":authenticator"))
kover(project(":authenticatorbridge"))
kover(project(":core"))
kover(project(":network"))
}
detekt {
@ -30,6 +31,7 @@ detekt {
"authenticator/src",
"authenticatorbridge/src",
"core/src",
"network/src",
)
}

View File

@ -105,7 +105,7 @@ platform :android do
)
end
desc "Runs lint, tests and generates Kover reports for all project modules"
desc "Runs lint, tests, and generates Kover reports for all project modules"
lane :check do
gradle(
tasks: [

1
network/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

12
network/README.md Normal file
View File

@ -0,0 +1,12 @@
# Network module
A client library for communicating with the Bitwarden web API.
## Contents
- [Compatibility](#compatibility)
## Compatibility
- **Minimum SDK**: 28
- **Target SDK**: 35

36
network/build.gradle.kts Normal file
View File

@ -0,0 +1,36 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "com.bitwarden.network"
compileSdk = libs.versions.compileSdk.get().toInt()
defaultConfig {
minSdk = libs.versions.minSdk.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 {
}

View File

21
network/proguard-rules.pro vendored Normal file
View File

@ -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

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@ -53,4 +53,5 @@ include(
":authenticator",
":authenticatorbridge",
":core",
":network",
)