Comments (6)
i can suggest more optimized dsl
fun NamedDomainObjectContainer<TargetConfigDsl>.ios(block: TargetConfigDsl.() -> Unit) {
listOf("iosArm64", "iosSimulatorArm64", "iosX64").forEach {
create(it, block)
}
}
fun NamedDomainObjectContainer<TargetConfigDsl>.android(block: TargetConfigDsl.() -> Unit) {
create("android", block)
}
fun TargetConfigDsl.buildConfigField(name: String, value: String) {
buildConfigField(type = STRING, name = name, value = value, const = true)
}
Usage
buildkonfig {
defaultConfigs {
buildConfigField(name = "versionName", value = "0.0.0")
}
targetConfigs {
android {
buildConfigField(name = "versionName", value = "2.0.0")
}
ios {
buildConfigField(name = "versionName", value = "1.0.0")
}
}
}
from buildkonfig.
Thanks, I'll see later 😉
from buildkonfig.
I have made investigation, and looks like issue fixes if we specify ios target like this:
targetConfigs {
create("android") {
buildConfigField(...)
}
create("iosArm64") {
buildConfigField(...)
}
create("iosSimulatorArm64") {
buildConfigField(...)
}
create("iosX64") {
buildConfigField(...)
}
}
from buildkonfig.
@Moozart
could you give me more info?
e.g) kotlin version, kmp plugin version, gradle version
from buildkonfig.
@RyuNen344 Ofcourse,
kotlin = "1.9.23"
distributionUrl=https://services.gradle.org/distributions/gradle-8.2-bin.zip
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
from buildkonfig.
@egorikftp Thanks for the research. I haven't tried it but if it works I will use it with this scoped func. Writing all ios modules one by one made me a bit lazy :)
fun NamedDomainObjectContainer<TargetConfigDsl>.crateForIOS() { listOf("iosArm64", "iosSimulatorArm64", "iosX64").forEach { create(it) { buildConfigField(FieldSpec.Type.STRING, "target", "ios") } } }
from buildkonfig.
Related Issues (20)
- Cause: non-flavored defaultConfigs must be provided. HOT 2
- Specify flavor in build time HOT 7
- ios configuration and environment variables
- Support Kotlin 1.9.20 HOT 7
- Automate changelog generation
- BuildKonfigs objects are not available in dependent modules. HOT 1
- add an easy way to load flavor from arbitrary properties file HOT 2
- Add Support to change build types or Build Variants from dropdown like native android HOT 3
- How to configure for compose multiplatform nativeMain?
- Unable to detect shared ios SourceSet created by KMP plugin HOT 1
- Add option to disable @JsExport HOT 4
- [Kotlin v2] CONST_VAL_WITHOUT_INITIALIZER warnings HOT 1
- Support Kotlin 2.0.0
- Flavor Selection Based on Build Variants in Android HOT 4
- How to solve "Unresolved reference: BuildKonfig" error? HOT 4
- Rename `buildkonfig` to `buildKonfig` HOT 1
- Support for Kotlin 1.9.0? HOT 4
- Dependency Dashboard
- SourceSet change support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildkonfig.