SamWithReceiver: Add general-purpose plugin and Gradle/Maven integrations
This commit is contained in:
committed by
Yan Zhulanow
parent
db3172a750
commit
d07fd52c43
@@ -16,10 +16,21 @@
|
||||
|
||||
package org.jetbrains.kotlin.annotation.plugin.ide
|
||||
|
||||
import com.intellij.openapi.module.Module
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
||||
import java.io.File
|
||||
|
||||
fun Module.getSpecialAnnotations(prefix: String): List<String> {
|
||||
val kotlinFacet = org.jetbrains.kotlin.idea.facet.KotlinFacet.get(this) ?: return emptyList()
|
||||
val commonArgs = kotlinFacet.configuration.settings.compilerArguments ?: return emptyList()
|
||||
|
||||
return commonArgs.pluginOptions
|
||||
?.filter { it.startsWith(prefix) }
|
||||
?.map { it.substring(prefix.length) }
|
||||
?: emptyList()
|
||||
}
|
||||
|
||||
internal class AnnotationBasedCompilerPluginSetup(val annotationFqNames: List<String>, val classpath: List<String>)
|
||||
|
||||
internal fun modifyCompilerArgumentsForPlugin(
|
||||
|
||||
Reference in New Issue
Block a user