Copy jet.modules.* to kotlin.modules.*
The next step will be to use the new "kotlin.modules" package and drop the old "jet" one
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package kotlin.modules
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
object AllModules : ThreadLocal<ArrayList<Module>>() {
|
||||
override fun initialValue() = ArrayList<Module>()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package kotlin.modules
|
||||
|
||||
public trait Module {
|
||||
public fun getModuleName(): String
|
||||
|
||||
public fun getOutputDirectory(): String
|
||||
|
||||
public fun getSourceFiles(): List<String>
|
||||
|
||||
public fun getClasspathRoots(): List<String>
|
||||
|
||||
public fun getAnnotationsRoots(): List<String>
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package kotlin.modules
|
||||
|
||||
import java.util.*
|
||||
import jet.modules.*
|
||||
import java.util.ArrayList
|
||||
|
||||
public fun module(name: String, outputDir: String, callback: ModuleBuilder.() -> Unit) {
|
||||
public fun module(name: String, outputDir: String, callback: ModuleBuilder.() -> Unit) {
|
||||
val builder = ModuleBuilder(name, outputDir)
|
||||
builder.callback()
|
||||
AllModules.modules.get()?.add(builder)
|
||||
jet.modules.AllModules.modules.get()?.add(builder)
|
||||
kotlin.modules.AllModules.get()?.add(builder)
|
||||
}
|
||||
|
||||
class SourcesBuilder(val parent: ModuleBuilder) {
|
||||
@@ -27,7 +27,7 @@ class AnnotationsPathBuilder(val parent: ModuleBuilder) {
|
||||
}
|
||||
}
|
||||
|
||||
open class ModuleBuilder(val name: String, val outputDir: String): Module {
|
||||
open class ModuleBuilder(val name: String, val outputDir: String): jet.modules.Module, kotlin.modules.Module {
|
||||
// http://youtrack.jetbrains.net/issue/KT-904
|
||||
private val sourceFiles0 = ArrayList<String>()
|
||||
private val classpathRoots0 = ArrayList<String>()
|
||||
|
||||
Reference in New Issue
Block a user