Skip to content

Commit 74cbccc

Browse files
committed
cleanup unneeded code
1 parent 976c22e commit 74cbccc

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

buildSrc/compiler-plugin/gradle-plugin/src/main/java/de/jensklingenberg/gradle/HelloWorldGradleSubplugin.kt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ class HelloWorldGradleSubPlugin : KotlinCompilerPluginSupportPlugin {
2121
}
2222

2323
private var gradleExtension : TestCompilerExtension = TestCompilerExtension()
24-
2524
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> {
26-
gradleExtension = kotlinCompilation.target.project.extensions.findByType(TestCompilerExtension::class.java)
27-
?: TestCompilerExtension()
28-
val project = kotlinCompilation.target.project
25+
gradleExtension = kotlinCompilation.target.project.extensions.findByType(TestCompilerExtension::class.java) ?: TestCompilerExtension()
2926

30-
return project.provider {
27+
return kotlinCompilation.target.project.provider {
3128
val options = mutableListOf(SubpluginOption("enabled", gradleExtension.enabled.toString()))
3229
options
3330
}
@@ -41,21 +38,18 @@ class HelloWorldGradleSubPlugin : KotlinCompilerPluginSupportPlugin {
4138
super.apply(target)
4239
}
4340

44-
/**
45-
* Just needs to be consistent with the key for CommandLineProcessor#pluginId
46-
*/
4741
override fun getCompilerPluginId(): String = "helloWorldPlugin"
4842

43+
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
44+
return true
45+
}
46+
4947
override fun getPluginArtifact(): SubpluginArtifact = SubpluginArtifact(
5048
groupId = SERIALIZATION_GROUP_NAME,
5149
artifactId = ARTIFACT_NAME,
5250
version = VERSION_NUMBER // remember to bump this version before any release!
5351
)
5452

55-
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
56-
return true
57-
}
58-
5953
override fun getPluginArtifactForNative(): SubpluginArtifact = SubpluginArtifact(
6054
groupId = SERIALIZATION_GROUP_NAME,
6155
artifactId = NATIVE_ARTIFACT_NAME,

0 commit comments

Comments
 (0)