Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter non-kotlin code out of generated sources #263

Merged
merged 11 commits into from
Feb 24, 2020
Merged
6 changes: 5 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ maven_install(
],
)

android_sdk_repository(
justhecuke-zz marked this conversation as resolved.
Show resolved Hide resolved
justhecuke-zz marked this conversation as resolved.
Show resolved Hide resolved
name = "androidsdk",
)

http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,20 @@ class BazelWorker(
val exitCode = try {
delegate.apply(loadArguments(request.argumentsList, true))
} catch (e: RuntimeException) {
return if (wasInterrupted(e)) INTERUPTED_STATUS
val innerExitCode = if (wasInterrupted(e)) INTERUPTED_STATUS
else ERROR_STATUS.also {
System.err.println(
"ERROR: Worker threw uncaught exception with args: ${request.argumentsList.joinToString(" ")}"
)
e.printStackTrace(System.err)
}
WorkerProtocol.WorkResponse.newBuilder()
.setOutput(buffer.toString())
.setExitCode(innerExitCode)
.build()
.writeDelimitedTo(realStdOut)
realStdOut.flush()
return innerExitCode
}

WorkerProtocol.WorkResponse.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class KotlinJvmTaskExecutor @Inject internal constructor(
private fun JvmCompilationTask.expandWithGeneratedSources(): JvmCompilationTask =
expandWithSources(
File(directories.generatedSources).walkTopDown()
.filter { it.isFile }
.filter { it.isFile && IS_JVM_SOURCE_FILE.test(it.name) }
.map { it.path }
.iterator()
)
Expand Down