1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Fix bug mixing R.java on Kotlin sources.

Fix https://github.com/cbeust/kobalt-android/issues/6
This commit is contained in:
Cedric Beust 2016-04-11 09:06:07 -07:00
parent 933b50c39c
commit 3bec28e8e0
4 changed files with 34 additions and 12 deletions

View file

@ -44,7 +44,11 @@ class JavaCompiler @Inject constructor(val jvmCompiler: JvmCompiler) {
allArgs.addAll(info.compilerArgs)
val fileManager = compiler.getStandardFileManager(null, null, null)
val fileObjects = fileManager.getJavaFileObjectsFromFiles(info.sourceFiles.map { File(it) })
val fileObjects = fileManager.getJavaFileObjectsFromFiles(info.sourceFiles.map {
File(it)
}.filter {
it.isFile
})
val dc = DiagnosticCollector<JavaFileObject>()
val classes = arrayListOf<String>()
val writer = PrintWriter(System.out)

View file

@ -121,6 +121,9 @@ class KotlinPlugin @Inject constructor(val executors: KobaltExecutors, val depen
override val sourceDirectory = "kotlin"
/** kotlinc can be passed directories */
override val canCompileDirectories = true
override fun compile(project: Project, context: KobaltContext, info: CompilerActionInfo): TaskResult {
val result =
if (info.sourceFiles.size > 0) {