Giter Club home page Giter Club logo

Comments (2)

yshrsmz avatar yshrsmz commented on July 17, 2024

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.

yshrsmz avatar yshrsmz commented on July 17, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.