From 09f261b03454655c213ad52d9b1264f585060b5f Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Thu, 3 Mar 2022 18:55:41 -0700 Subject: [PATCH] Migrate networking code to Kotlin Multiplatform compatible module --- .idea/gradle.xml | 2 +- .idea/inspectionProfiles/Project_Default.xml | 12 ++ .idea/misc.xml | 4 + app/build.gradle.kts | 5 +- app/src/main/AndroidManifest.xml | 4 +- .../wbrawner/pihelper/AddPiHelperViewModel.kt | 6 +- .../java/com/wbrawner/pihelper/MainScreen.kt | 4 +- .../com/wbrawner/pihelper/PiHelperModule.kt | 8 +- .../wbrawner/pihelper/PiHelperViewModel.kt | 11 +- .../java/com/wbrawner/pihelper/ScanScreen.kt | 4 - build.gradle.kts | 7 +- gradle.properties | 3 + gradle/libs.versions.toml | 58 ++++--- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 6 +- piholeclient/.gitignore | 1 - piholeclient/build.gradle.kts | 45 ------ piholeclient/consumer-rules.pro | 67 -------- piholeclient/proguard-rules.pro | 23 --- .../wbrawner/piholeclient/PiHoleApiService.kt | 146 ------------------ .../piholeclient/PiHoleClientModule.kt | 71 --------- .../com/wbrawner/piholeclient/Responses.kt | 89 ----------- piholeclient/src/main/res/values/strings.xml | 3 - settings.gradle.kts | 2 +- shared/.gitignore | 1 + shared/build.gradle.kts | 63 ++++++++ .../src/androidMain}/AndroidManifest.xml | 7 +- .../wbrawner/pihelper/shared/HttpClient.kt | 11 ++ .../pihelper/shared/PiholeAPIService.kt | 82 ++++++++++ .../com/wbrawner/pihelper/shared/Responses.kt | 90 +++++++++++ .../wbrawner/pihelper/shared/HttpClient.kt | 11 ++ 31 files changed, 351 insertions(+), 497 deletions(-) delete mode 100644 piholeclient/.gitignore delete mode 100644 piholeclient/build.gradle.kts delete mode 100644 piholeclient/consumer-rules.pro delete mode 100644 piholeclient/proguard-rules.pro delete mode 100644 piholeclient/src/main/java/com/wbrawner/piholeclient/PiHoleApiService.kt delete mode 100644 piholeclient/src/main/java/com/wbrawner/piholeclient/PiHoleClientModule.kt delete mode 100644 piholeclient/src/main/java/com/wbrawner/piholeclient/Responses.kt delete mode 100644 piholeclient/src/main/res/values/strings.xml create mode 100644 shared/.gitignore create mode 100644 shared/build.gradle.kts rename {piholeclient/src/main => shared/src/androidMain}/AndroidManifest.xml (55%) create mode 100644 shared/src/androidMain/kotlin/com/wbrawner/pihelper/shared/HttpClient.kt create mode 100644 shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/PiholeAPIService.kt create mode 100644 shared/src/commonMain/kotlin/com/wbrawner/pihelper/shared/Responses.kt create mode 100644 shared/src/iosMain/Kotlin/com/wbrawner/pihelper/shared/HttpClient.kt diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8989db5..37e6888 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,7 +12,7 @@