mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Fix the multiple -source flags bug.
This commit is contained in:
parent
b1f7c9fd03
commit
fb2e970082
3 changed files with 4 additions and 4 deletions
|
@ -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>
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue