mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Add flags for Java projects only.
This commit is contained in:
parent
af4c7d9822
commit
62a2ec5f74
1 changed files with 14 additions and 9 deletions
|
@ -16,6 +16,7 @@ import com.beust.kobalt.misc.KFiles
|
||||||
import com.beust.kobalt.misc.RunCommand
|
import com.beust.kobalt.misc.RunCommand
|
||||||
import com.beust.kobalt.misc.log
|
import com.beust.kobalt.misc.log
|
||||||
import com.beust.kobalt.plugin.java.JavaCompiler
|
import com.beust.kobalt.plugin.java.JavaCompiler
|
||||||
|
import com.beust.kobalt.plugin.java.JavaProject
|
||||||
import com.beust.kobalt.plugin.packaging.JarUtils
|
import com.beust.kobalt.plugin.packaging.JarUtils
|
||||||
import com.google.common.collect.HashMultimap
|
import com.google.common.collect.HashMultimap
|
||||||
import com.google.inject.Inject
|
import com.google.inject.Inject
|
||||||
|
@ -244,16 +245,20 @@ public class AndroidPlugin @Inject constructor(val javaCompiler: JavaCompiler)
|
||||||
* happen if the developer is using RetroLambda for example).
|
* happen if the developer is using RetroLambda for example).
|
||||||
*/
|
*/
|
||||||
override fun flagsFor(project: Project) : List<String> {
|
override fun flagsFor(project: Project) : List<String> {
|
||||||
val result : ArrayList<String> = project.projectProperties.get(JvmCompilerPlugin.COMPILER_ARGS)?.let {
|
if (project is JavaProject) {
|
||||||
arrayListOf<String>().apply { addAll(it as List<String>) }
|
val result: ArrayList<String> = project.projectProperties.get(JvmCompilerPlugin.COMPILER_ARGS)?.let {
|
||||||
} ?: arrayListOf<String>()
|
arrayListOf<String>().apply { addAll(it as List<String>) }
|
||||||
if (! result.contains("-source")) with(result) {
|
} ?: arrayListOf<String>()
|
||||||
addAll(listOf("-source", "1.6"))
|
if (!result.contains("-source")) with(result) {
|
||||||
|
addAll(listOf("-source", "1.6"))
|
||||||
|
}
|
||||||
|
if (!result.contains("-target")) with(result) {
|
||||||
|
addAll(listOf("-target", "1.6"))
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
} else {
|
||||||
|
return emptyList()
|
||||||
}
|
}
|
||||||
if (! result.contains("-target")) with(result) {
|
|
||||||
addAll(listOf("-target", "1.6"))
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue