Comments (2)
As it may take some time to resolve the issue, I am planning to release a version for Kotlin 1.4 without supporting this.
from buildkonfig.
kotlin {
android()
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
js(IR) {
browser()
}
js("node") {
nodejs()
}
macosX64()
linuxX64()
mingwX64()
ios()
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmTest by getting
val appMain by creating {
dependsOn(commonMain)
}
val androidMain by getting {
dependsOn(appMain)
}
val jsCommonMain by creating {
dependsOn(commonMain)
}
val jsMain by getting {
dependsOn(jsCommonMain)
}
val nodeMain by getting {
dependsOn(jsCommonMain)
}
val jsTest by getting
val desktopMain by creating {
dependsOn(appMain)
}
val macosX64Main by getting {
dependsOn(desktopMain)
}
val linuxX64Main by getting {
dependsOn(desktopMain)
}
val mingwX64Main by getting {
dependsOn(desktopMain)
}
}
}
target: android, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
compilation: debug, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation, task ':compileDebugKotlinAndroid', androidDebugClasses
compilation: defaultSourceSet: source set androidDebug, []
compilation: allKotlinSourceSets: [source set androidDebug, source set androidMain, source set commonMain, source set appMain]
------
compilation: release, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation, task ':compileReleaseKotlinAndroid', androidReleaseClasses
compilation: defaultSourceSet: source set androidRelease, []
compilation: allKotlinSourceSets: [source set androidRelease, source set androidMain, source set commonMain, source set appMain]
------
target: iosArm64, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation, task ':compileKotlinIosArm64', iosArm64MainKlibrary
compilation: defaultSourceSet: source set iosArm64Main, [source set commonMain, source set iosMain]
compilation: allKotlinSourceSets: [source set iosArm64Main, source set commonMain, source set iosMain]
------
target: iosX64, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation, task ':compileKotlinIosX64', iosX64MainKlibrary
compilation: defaultSourceSet: source set iosX64Main, [source set commonMain, source set iosMain]
compilation: allKotlinSourceSets: [source set iosX64Main, source set commonMain, source set iosMain]
------
target: js, class org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation, task ':compileKotlinJs', jsMainClasses
compilation: defaultSourceSet: source set jsMain, [source set commonMain, source set jsCommonMain]
compilation: allKotlinSourceSets: [source set jsMain, source set commonMain, source set jsCommonMain]
------
target: jvm, class org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation, task ':compileKotlinJvm', jvmMainClasses
compilation: defaultSourceSet: source set jvmMain, [source set commonMain]
compilation: allKotlinSourceSets: [source set jvmMain, source set commonMain]
------
target: linuxX64, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation, task ':compileKotlinLinuxX64', linuxX64MainKlibrary
compilation: defaultSourceSet: source set linuxX64Main, [source set commonMain, source set desktopMain]
compilation: allKotlinSourceSets: [source set linuxX64Main, source set commonMain, source set desktopMain, source set appMain]
------
target: macosX64, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation, task ':compileKotlinMacosX64', macosX64MainKlibrary
compilation: defaultSourceSet: source set macosX64Main, [source set commonMain, source set desktopMain]
compilation: allKotlinSourceSets: [source set macosX64Main, source set commonMain, source set desktopMain, source set appMain]
------
target: metadata, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget_Decorated
compilation: appMain, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation, task ':compileAppMainKotlinMetadata', metadataAppMainClasses
compilation: defaultSourceSet: source set appMain, [source set commonMain]
compilation: allKotlinSourceSets: []
------
compilation: commonMain, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation, task ':compileCommonMainKotlinMetadata', metadataCommonMainClasses
compilation: defaultSourceSet: source set commonMain, []
compilation: allKotlinSourceSets: []
------
compilation: desktopMain, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinSharedNativeCompilation, task ':compileDesktopMainKotlinMetadata', metadataDesktopMainClasses
compilation: defaultSourceSet: source set desktopMain, [source set appMain]
compilation: allKotlinSourceSets: []
------
compilation: iosMain, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinSharedNativeCompilation, task ':compileIosMainKotlinMetadata', metadataIosMainClasses
compilation: defaultSourceSet: source set iosMain, [source set commonMain]
compilation: allKotlinSourceSets: []
------
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation, task ':compileKotlinMetadata', metadataMainClasses
compilation: defaultSourceSet: source set commonMain, []
compilation: allKotlinSourceSets: [source set commonMain]
------
target: mingwX64, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation, task ':compileKotlinMingwX64', mingwX64MainKlibrary
compilation: defaultSourceSet: source set mingwX64Main, [source set commonMain, source set desktopMain]
compilation: allKotlinSourceSets: [source set mingwX64Main, source set commonMain, source set desktopMain, source set appMain]
------
target: node, class org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget_Decorated
compilation: main, class org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation, task ':compileKotlinNode', nodeMainClasses
compilation: defaultSourceSet: source set nodeMain, [source set commonMain, source set jsCommonMain]
compilation: allKotlinSourceSets: [source set nodeMain, source set commonMain, source set jsCommonMain]
------
In this case, BuildKonfig should be created for each source sets.
Here's the source-set hierarchy.
- common
- jvm
- app
- android
- desktop
- macosX64
- linuxX64
- mingwX64
- jsCommon
- js
- node
- Base actual declaration of BuildKonfig is always in common.
- Expect declarations can be in any source set. but when you configure BuildKonfig for
desktop
, you can't create specific BuildKonfig for macos/linux/mingw. Upper source set always win.
from buildkonfig.
Related Issues (20)
- provide a way to read values from properties file HOT 7
- [java.lang.IllegalArgumentException: packageName must be provided] thrown when adding a js(IR) target HOT 4
- Build failed when BuildKonfig configuration moved to a separate file HOT 2
- Kotlin/JS IR backend breaks when using BuildKonfig's `exposeObjectWithName` option HOT 12
- BuildKonfig `0.9.0` -> `0.10.0` breaks Gradle Sync HOT 6
- Kotlin v1.5.31, XCFramework: targetConfigs fields not found from iOS HOT 7
- Java version compatibility HOT 2
- Kotlin/JS Exception: non-flavored defaultConfigs must be provided. Despite is provided. HOT 5
- Support config inheritance HOT 9
- Update Gradle to 7.3+ and use Kotlin 1.5.31
- Support for Gradle configuration cache HOT 1
- Support for adding platform specific config HOT 2
- Generating Non-Internal BuildKonfig object HOT 2
- Generating Secondary and more BuildKonfig object HOT 9
- can support kotlin Native ? HOT 5
- BuildType & ProductFlavor & sourceSets support ? HOT 1
- Plugin generates invalid class so build fails HOT 5
- Readme does not document hierarchical project support HOT 2
- Type ...BuildConfig is defined multiple times HOT 2
- BuildKonfig doesn't work with npm-publish HOT 4
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.