Skip to content

Commit 69c239b

Browse files
committed
clarifying some things regarding Configurations in KeywordsGeneratorPlugin
1 parent e6e1a41 commit 69c239b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: plugins/keywords-generator/src/main/kotlin/org/jetbrains/dataframe/keywords/KeywordsGeneratorPlugin.kt

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@ package org.jetbrains.dataframe.keywords
22

33
import org.gradle.api.Plugin
44
import org.gradle.api.Project
5+
import org.gradle.api.artifacts.DependencyScopeConfiguration
6+
import org.gradle.api.artifacts.ResolvableConfiguration
57
import org.gradle.api.tasks.SourceSet
68
import org.gradle.api.tasks.SourceSetContainer
79
import org.gradle.kotlin.dsl.get
810
import org.gradle.kotlin.dsl.register
911
import org.jetbrains.kotlinx.dataframe.BuildConfig
1012
import java.io.File
1113

14+
@Suppress("UnstableApiUsage")
1215
abstract class KeywordsGeneratorPlugin : Plugin<Project> {
1316

1417
override fun apply(target: Project): Unit = with(target) {
1518
// from https://kotlinlang.org/docs/whatsnew21.html#compiler-symbols-hidden-from-the-kotlin-gradle-plugin-api
16-
val taskDependencyScope = configurations.create("keywordsGeneratorScope")
17-
dependencies.add(taskDependencyScope.name, "$KOTLIN_COMPILER_EMBEDDABLE:$KOTLIN_COMPILER_VERSION")
18-
val taskResolvableConfiguration = configurations.create("keywordGeneratorResolvable") {
19-
extendsFrom(taskDependencyScope)
20-
}
19+
val dependencyScopeConfiguration: DependencyScopeConfiguration = configurations.dependencyScope("keywordsGeneratorDependencyScope").get()
20+
dependencies.add(dependencyScopeConfiguration.name, "$KOTLIN_COMPILER_EMBEDDABLE:$KOTLIN_COMPILER_VERSION")
21+
22+
val resolvableConfiguration: ResolvableConfiguration = configurations.resolvable("keywordGeneratorResolvable") {
23+
extendsFrom(dependencyScopeConfiguration)
24+
}.get()
2125

2226
val genSrcDir = layout.buildDirectory.asFile.get().resolve("generatedSrc")
2327

@@ -26,7 +30,7 @@ abstract class KeywordsGeneratorPlugin : Plugin<Project> {
2630
mainSourceSet.addDir(genSrcDir)
2731

2832
val genTask = tasks.register<KeywordsGeneratorTask>(KeywordsGeneratorTask.NAME) {
29-
kotlinCompiler.from(taskResolvableConfiguration)
33+
kotlinCompiler.from(resolvableConfiguration)
3034
srcDir = genSrcDir
3135
}
3236

0 commit comments

Comments
 (0)