File tree Expand file tree Collapse file tree 6 files changed +18
-9
lines changed
kotlin-allopen/src/main/kotlin/org/jetbrains/kotlin/allopen/gradle
kotlin-noarg/src/main/kotlin/org/jetbrains/kotlin/noarg/gradle Expand file tree Collapse file tree 6 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.allopen.gradle
18
18
19
19
open class AllOpenExtension {
20
20
internal val myAnnotations = mutableListOf<String >()
21
+ internal val myPresets = mutableListOf<String >()
21
22
22
23
open fun annotation (fqName : String ) {
23
24
myAnnotations.add(fqName)
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ class AllOpenKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
66
66
val ALLOPEN_GROUP_NAME = " org.jetbrains.kotlin"
67
67
val ALLOPEN_ARTIFACT_NAME = " kotlin-allopen"
68
68
69
- private val ANNOTATIONS_ARG_NAME = " annotation"
69
+ private val ANNOTATION_ARG_NAME = " annotation"
70
+ private val PRESET_ARG_NAME = " preset"
70
71
}
71
72
72
73
override fun isApplicable (project : Project , task : AbstractCompile ) = AllOpenGradleSubplugin .isEnabled(project)
@@ -85,7 +86,11 @@ class AllOpenKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
85
86
val options = mutableListOf<SubpluginOption >()
86
87
87
88
for (anno in allOpenExtension.myAnnotations) {
88
- options + = SubpluginOption (ANNOTATIONS_ARG_NAME , anno)
89
+ options + = SubpluginOption (ANNOTATION_ARG_NAME , anno)
90
+ }
91
+
92
+ for (preset in allOpenExtension.myPresets) {
93
+ options + = SubpluginOption (PRESET_ARG_NAME , preset)
89
94
}
90
95
91
96
return options
Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ class SpringGradleSubplugin : Plugin<Project> {
23
23
override fun apply (project : Project ) {
24
24
project.plugins.apply (AllOpenGradleSubplugin ::class .java)
25
25
val allOpenExtension = AllOpenGradleSubplugin .getAllOpenExtension(project)
26
- allOpenExtension.annotations(" org.springframework.stereotype.Component" ,
27
- " org.springframework.transaction.annotation.Transactional" ,
28
- " org.springframework.scheduling.annotation.Async" ,
29
- " org.springframework.cache.annotation.Cacheable" )
26
+ allOpenExtension.myPresets + = " spring"
30
27
}
31
28
}
Original file line number Diff line number Diff line change @@ -23,6 +23,6 @@ class KotlinJpaSubplugin : Plugin<Project> {
23
23
override fun apply (project : Project ) {
24
24
project.plugins.apply (NoArgGradleSubplugin ::class .java)
25
25
val noArgExtension = NoArgGradleSubplugin .getNoArgExtension(project)
26
- noArgExtension.annotation( " javax.persistence.Entity " )
26
+ noArgExtension.myPresets + = " jpa "
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.noarg.gradle
18
18
19
19
open class NoArgExtension {
20
20
internal val myAnnotations = mutableListOf<String >()
21
+ internal val myPresets = mutableListOf<String >()
21
22
22
23
open fun annotation (fqName : String ) {
23
24
myAnnotations.add(fqName)
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ class NoArgKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
67
67
val NOARG_GROUP_NAME = " org.jetbrains.kotlin"
68
68
val NOARG_ARTIFACT_NAME = " kotlin-noarg"
69
69
70
- private val ANNOTATIONS_ARG_NAME = " annotation"
70
+ private val ANNOTATION_ARG_NAME = " annotation"
71
+ private val PRESET_ARG_NAME = " preset"
71
72
}
72
73
73
74
override fun isApplicable (project : Project , task : AbstractCompile ) = NoArgGradleSubplugin .isEnabled(project)
@@ -86,7 +87,11 @@ class NoArgKotlinGradleSubplugin : KotlinGradleSubplugin<AbstractCompile> {
86
87
val options = mutableListOf<SubpluginOption >()
87
88
88
89
for (anno in noArgExtension.myAnnotations) {
89
- options + = SubpluginOption (ANNOTATIONS_ARG_NAME , anno)
90
+ options + = SubpluginOption (ANNOTATION_ARG_NAME , anno)
91
+ }
92
+
93
+ for (preset in noArgExtension.myPresets) {
94
+ options + = SubpluginOption (PRESET_ARG_NAME , preset)
90
95
}
91
96
92
97
return options
You can’t perform that action at this time.
0 commit comments