-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#8] [KMM] [Backend] Set Up Network layer Core with Ktor #51
Conversation
c200409
to
527870e
Compare
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/core/NetworkClient.kt
Show resolved
Hide resolved
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/helpers/UrlPath.kt
Outdated
Show resolved
Hide resolved
🧛 shared Code Coverage:
|
File | Coverage |
---|---|
JsonMockEngine.kt |
100.00% |
Koin.kt |
0.00% |
NetworkClient.kt |
76.83% |
NetworkClientTest.kt |
100.00% |
NetworkMockModel.kt |
86.61% |
NetworkModule.kt |
0.00% |
RepositoryModule.kt |
0.00% |
Start.kt |
0.00% |
UseCaseModule.kt |
0.00% |
Modified Files Not Found In Coverage Report:
.gitignore
.gitmodules
AndroidManifest.xml
BuildKonfig.kt.example
Dangerfile
Dependency.kt
KoinApplication.swift
LazyKoin.swift
Module.kt
Plugin.kt
Podfile
Podfile.lock
Typealias+Koin.swift
Versions.kt
build.gradle.kts
build.gradle.kts
deploy_ios_firebase.yml
deploy_ios_release_firebase.yml
gradle.properties
ios_review_pull_request.yml
kmm_review_pull_request.yml
nimble-jsonapi-kotlin
project.pbxproj
settings.gradle.kts
Codebase cunningly covered by count Shroud 🧛
Generated by 🚫 Danger
shared/src/commonTest/kotlin/co/nimblehq/blisskmmic/helpers/mock/NetworkMockModel.kt
Outdated
Show resolved
Hide resolved
f9ed8e1
to
9fb1826
Compare
f60eee4
to
078d5d5
Compare
9fb1826
to
20409e7
Compare
f818f06
to
e71863f
Compare
d1d0b55
to
0d404e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyhow, LGTM now 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/core/NetworkClient.kt
Outdated
Show resolved
Hide resolved
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/core/NetworkClient.kt
Outdated
Show resolved
Hide resolved
ed98f64
to
b05e2a5
Compare
shared/src/commonMain/kotlin/co/nimblehq/blisskmmic/data/network/core/NetworkClient.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blyscuit 1 issue left, rest lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
buildkonfig { | ||
packageName = "co.nimblehq.blisskmmic" | ||
|
||
defaultConfigs { | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_ID", | ||
BuildKonfig.CLIENT_ID | ||
) | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_SECRET", | ||
BuildKonfig.CLIENT_SECRET | ||
) | ||
buildConfigField( | ||
STRING, | ||
"BASE_URL", | ||
BuildKonfig.STAGING_BASE_URL | ||
) | ||
} | ||
|
||
defaultConfigs("production") { | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_ID", | ||
BuildKonfig.CLIENT_ID | ||
) | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_SECRET", | ||
BuildKonfig.CLIENT_SECRET | ||
) | ||
buildConfigField( | ||
STRING, | ||
"BASE_URL", | ||
BuildKonfig.PRODUCTION_BASE_URL | ||
) | ||
} | ||
|
||
defaultConfigs("staging") { | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_ID", | ||
BuildKonfig.CLIENT_ID_STAGING | ||
) | ||
buildConfigField( | ||
STRING, | ||
"CLIENT_SECRET", | ||
BuildKonfig.CLIENT_SECRET_STAGING | ||
) | ||
buildConfigField( | ||
STRING, | ||
"BASE_URL", | ||
BuildKonfig.STAGING_BASE_URL | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blyscuit Sorry for recalling you on a merged PR, I think there is still something wrong here. We need to define a properties file for BuildKonfig and read them from the properties file instead of a BuildKonfig
class. The logic here is BuildKonfig lib helps us to create BuildKonfig
class file to use in runtime from a properties config, so BuildKonfig
class is the result, not the source of this gradle config.
object BuildKonfig { | ||
const val CLIENT_ID = "" | ||
const val CLIENT_SECRET = "" | ||
const val STAGING_BASE_URL = "" | ||
const val PRODUCTION_BASE_URL = "" | ||
const val CLIENT_ID_STAGING = "" | ||
const val CLIENT_SECRET_STAGING = "" | ||
const val UI_TEST_EMAIL = "" | ||
const val UI_TEST_PASSWORD = "" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sample file is incorrect. It should be a properties file when working with Gradle build system 💭
close #8
What Happened
Ktor
.BuildKonfig
for flavor.Native Coroutines
for usingFlow
asCombine
.Koin
for DI from this article https://medium.com/@uwaisalqadri/elegant-koin-injection-for-swift-in-kotlin-multiplatform-mobile-9a803f6efb2e.Insight
buildsrc
files.BuildKonfig
is generated from CICD.Proof of Work