@@ -2,22 +2,26 @@ package org.jetbrains.dataframe.keywords
2
2
3
3
import org.gradle.api.Plugin
4
4
import org.gradle.api.Project
5
+ import org.gradle.api.artifacts.DependencyScopeConfiguration
6
+ import org.gradle.api.artifacts.ResolvableConfiguration
5
7
import org.gradle.api.tasks.SourceSet
6
8
import org.gradle.api.tasks.SourceSetContainer
7
9
import org.gradle.kotlin.dsl.get
8
10
import org.gradle.kotlin.dsl.register
9
11
import org.jetbrains.kotlinx.dataframe.BuildConfig
10
12
import java.io.File
11
13
14
+ @Suppress(" UnstableApiUsage" )
12
15
abstract class KeywordsGeneratorPlugin : Plugin <Project > {
13
16
14
17
override fun apply (target : Project ): Unit = with (target) {
15
18
// 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()
21
25
22
26
val genSrcDir = layout.buildDirectory.asFile.get().resolve(" generatedSrc" )
23
27
@@ -26,7 +30,7 @@ abstract class KeywordsGeneratorPlugin : Plugin<Project> {
26
30
mainSourceSet.addDir(genSrcDir)
27
31
28
32
val genTask = tasks.register<KeywordsGeneratorTask >(KeywordsGeneratorTask .NAME ) {
29
- kotlinCompiler.from(taskResolvableConfiguration )
33
+ kotlinCompiler.from(resolvableConfiguration )
30
34
srcDir = genSrcDir
31
35
}
32
36
0 commit comments