diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e6b478aa3..ee8c4897e5 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/ + network/build/reports/tests/ - name: Upload to codecov.io id: upload-to-codecov diff --git a/build.gradle.kts b/build.gradle.kts index da31dd913e..d755b30740 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(":network")) } detekt { @@ -30,6 +31,7 @@ detekt { "authenticator/src", "authenticatorbridge/src", "core/src", + "network/src", ) } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 082d810057..3b708483df 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -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: [ diff --git a/network/.gitignore b/network/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/network/.gitignore @@ -0,0 +1 @@ +/build diff --git a/network/README.md b/network/README.md new file mode 100644 index 0000000000..0699aa758d --- /dev/null +++ b/network/README.md @@ -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 diff --git a/network/build.gradle.kts b/network/build.gradle.kts new file mode 100644 index 0000000000..de987a8ef3 --- /dev/null +++ b/network/build.gradle.kts @@ -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 { +} diff --git a/network/consumer-rules.pro b/network/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/network/proguard-rules.pro b/network/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/network/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/network/src/main/AndroidManifest.xml b/network/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..56a9e28a20 --- /dev/null +++ b/network/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 25d7352fb4..b57dd37567 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -53,4 +53,5 @@ include( ":authenticator", ":authenticatorbridge", ":core", + ":network", )