Added attaching external annotations via module script.
This commit is contained in:
@@ -21,10 +21,17 @@ class ClasspathBuilder(val parent: ModuleBuilder) {
|
||||
}
|
||||
}
|
||||
|
||||
class AnnotationsPathBuilder(val parent: ModuleBuilder) {
|
||||
public fun plusAssign(name: String) {
|
||||
parent.addAnnotationsPathEntry(name)
|
||||
}
|
||||
}
|
||||
|
||||
open class ModuleBuilder(val name: String): Module {
|
||||
// http://youtrack.jetbrains.net/issue/KT-904
|
||||
private val sourceFiles0: ArrayList<String?> = ArrayList<String?>()
|
||||
private val classpathRoots0: ArrayList<String?> = ArrayList<String?>()
|
||||
private val annotationsRoots0: ArrayList<String?> = ArrayList<String?>()
|
||||
|
||||
val sources: SourcesBuilder
|
||||
get() = SourcesBuilder(this)
|
||||
@@ -32,6 +39,9 @@ open class ModuleBuilder(val name: String): Module {
|
||||
val classpath: ClasspathBuilder
|
||||
get() = ClasspathBuilder(this)
|
||||
|
||||
val annotationsPath: AnnotationsPathBuilder
|
||||
get() = AnnotationsPathBuilder(this)
|
||||
|
||||
public fun addSourceFiles(pattern: String) {
|
||||
sourceFiles0.add(pattern)
|
||||
}
|
||||
@@ -40,8 +50,13 @@ open class ModuleBuilder(val name: String): Module {
|
||||
classpathRoots0.add(name)
|
||||
}
|
||||
|
||||
public fun addAnnotationsPathEntry(name: String) {
|
||||
annotationsRoots0.add(name)
|
||||
}
|
||||
|
||||
public override fun getSourceFiles(): List<String?>? = sourceFiles0
|
||||
public override fun getClasspathRoots(): List<String?>? = classpathRoots0
|
||||
public override fun getAnnotationsRoots(): List<String?>? = annotationsRoots0
|
||||
public override fun getModuleName(): String? = name
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user