|
|
|
@ -6,7 +6,10 @@
|
|
|
|
|
package org.jetbrains.compose.internal |
|
|
|
|
|
|
|
|
|
import org.gradle.api.Project |
|
|
|
|
import org.gradle.api.plugins.JavaPluginConvention |
|
|
|
|
import org.gradle.api.plugins.JavaPluginExtension |
|
|
|
|
import org.gradle.api.tasks.SourceSetContainer |
|
|
|
|
import org.gradle.util.GradleVersion |
|
|
|
|
import org.jetbrains.compose.ComposeExtension |
|
|
|
|
import org.jetbrains.compose.web.WebExtension |
|
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension |
|
|
|
@ -23,8 +26,9 @@ internal val Project.mppExt: KotlinMultiplatformExtension
|
|
|
|
|
internal val Project.mppExtOrNull: KotlinMultiplatformExtension? |
|
|
|
|
get() = extensions.findByType(KotlinMultiplatformExtension::class.java) |
|
|
|
|
|
|
|
|
|
internal val Project.javaExt: JavaPluginExtension |
|
|
|
|
get() = javaExtOrNull ?: error("Could not find JavaPluginExtension ($project)") |
|
|
|
|
|
|
|
|
|
internal val Project.javaExtOrNull: JavaPluginExtension? |
|
|
|
|
get() = extensions.findByType(JavaPluginExtension::class.java) |
|
|
|
|
internal val Project.javaSourceSets: SourceSetContainer |
|
|
|
|
get() = if (GradleVersion.current() < GradleVersion.version("7.1")) { |
|
|
|
|
convention.getPlugin(JavaPluginConvention::class.java).sourceSets |
|
|
|
|
} else { |
|
|
|
|
extensions.getByType(JavaPluginExtension::class.java).sourceSets |
|
|
|
|
} |
|
|
|
|