Michal Klusák
08/29/2023, 2:11 PMKonstantin Tskhovrebov
08/29/2023, 2:16 PMVlad
08/29/2023, 2:41 PMKonstantin Tskhovrebov
08/29/2023, 2:42 PMKonstantin Tskhovrebov
08/29/2023, 2:43 PMVlad
08/29/2023, 2:45 PMVlad
08/29/2023, 2:45 PMKonstantin Tskhovrebov
08/29/2023, 2:45 PMVlad
08/29/2023, 2:46 PMVlad
08/29/2023, 2:46 PMKonstantin Tskhovrebov
08/29/2023, 2:47 PMVlad
08/29/2023, 2:49 PMVlad
08/29/2023, 2:50 PMMichal Klusák
08/29/2023, 6:44 PMKonstantin Tskhovrebov
08/29/2023, 9:24 PMPablichjenkov
08/30/2023, 1:34 AMDoes anyone have any simple but ready example project for thisI have done this in Android java before. I could give you a link but the code is kind of old and the Readme is empty. But essentially you set your dependencies based on Environment variables or config files. sort of:
sourceSets {
val commonMain by getting {
dependencies {
implementation(project("common-customer-api")) // Only interfaces / abstract classes here
// or implementation("com.mycompany:common-customer-api:1.0.0")
}
}
// Android
val androidMain by getting {
dependencies {
val customer = System.property[customer]
when (customer) {
"A" -> {
implementation(project(":A")) // Implementations for customer A
// or implementation("com.mycompany:customerA:1.0.0")
}
"B" -> {
implementation(project(":B")) // Implementations for customer B
// or implementation("com.mycompany:customerB:1.0.0")
}
}
}
}
// Repeat the Same for iOS, JVM, JS
}
You can make it much better not repeating it for each target , perhaps creating a function to set each target
val customerLib = when (customer) {
"A" -> {
"com.mycompany:customerA:1.0.0"
"B" -> {
"com.mycompany:customerB:1.0.0"
}
}
setAndroid(customerLib)
setIos(customerLib)
Pablichjenkov
08/30/2023, 1:41 AMMichal Klusák
08/30/2023, 7:50 AMVlad
08/30/2023, 8:35 AMcustomer
easily. I mean, we know system envs in settings for the projects, so if you want to build different app, you just go into those settings and change the customer from A to B manually?Pablichjenkov
08/30/2023, 2:21 PMappconfig.json
file in root of your project. In that json you specify the current customer/flavor. Read the json from your Gradle scripts. That is more convenient than using environment variables or gradle propertiesKonstantin Tskhovrebov
08/30/2023, 2:28 PMgradle.properties
Vlad
02/06/2024, 11:59 AMVlad
02/08/2024, 4:07 PMimplementation(project(":$flavorName}"))
And that is working and seems to be easy, true, but only for android.
Now I am completely stuck with - how would I connect iOS app icon/name with this module.
Firstly we need to make sure that iOS app icon, which is iOS asset is in KMP and compiled by KMP. And then we get it from the complied KMP (I am not sure that already is possible).
But how?
There are not much info in google or github for the very topic and google search already indexed and shows this thread as first result.Vlad
02/08/2024, 4:08 PMpererikbergman
02/21/2024, 8:49 AMVlad
02/21/2024, 9:19 AMpererikbergman
02/24/2024, 6:40 AMViktor Nyblom
05/03/2024, 2:23 PMpererikbergman
05/03/2024, 2:35 PM