1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 08:38:13 -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. * Plugins that add compiler flags.
*/ */
interface ICompilerFlagContributor : IContributor { 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) + val addedFlags = ArrayList(info.compilerArgs) +
if (project != null) { if (project != null) {
context.pluginInfo.compilerFlagContributors.flatMap { context.pluginInfo.compilerFlagContributors.flatMap {
it.flagsFor(project) it.flagsFor(project, info.compilerArgs)
} }
} else { } else {
emptyList() emptyList()

View file

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