SamWithReceiver: Add general-purpose plugin and Gradle/Maven integrations

This commit is contained in:
Yan Zhulanow
2017-06-08 15:38:10 +03:00
committed by Yan Zhulanow
parent db3172a750
commit d07fd52c43
38 changed files with 886 additions and 21 deletions
@@ -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(