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

Fix the multiple -source flags bug.

This commit is contained in:
Cedric Beust 2015-11-24 23:54:36 -08:00
parent b1f7c9fd03
commit fb2e970082
3 changed files with 4 additions and 4 deletions

View file

@ -4,5 +4,5 @@ package com.beust.kobalt.api
* Plugins that add compiler flags.
*/
interface ICompilerFlagContributor : IContributor {
fun flagsFor(project: Project): List<String>
fun flagsFor(project: Project, currentFlags: List<String>): List<String>
}

View file

@ -32,7 +32,7 @@ class JvmCompiler @Inject constructor(val dependencyManager: DependencyManager)
val addedFlags = ArrayList(info.compilerArgs) +
if (project != null) {
context.pluginInfo.compilerFlagContributors.flatMap {
it.flagsFor(project)
it.flagsFor(project, info.compilerArgs)
}
} else {
emptyList()

View file

@ -27,14 +27,14 @@ public class AptPlugin @Inject constructor(val depFactory: DepFactory, val execu
override val name = NAME
// ICompilerFlagContributor
override fun flagsFor(project: Project) : List<String> {
override fun flagsFor(project: Project, currentFlags: List<String>) : List<String> {
val result = arrayListOf<String>()
configurationFor(project)?.let { config ->
aptDependencies.get(key = project.name)?.let { aptDependency ->
val dependencyJarFile = JarFinder.byId(aptDependency)
result.add("-processorpath")
result.add(dependencyJarFile.absolutePath)
val generated = KFiles.joinAndMakeDir(project.directory, project.buildDirectory!!, config.outputDir)
val generated = KFiles.joinAndMakeDir(project.directory, project.buildDirectory, config.outputDir)
result.add("-s")
result.add(generated)
}