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

Fix resources for flavors.

Fix #129.
This commit is contained in:
Cedric Beust 2016-02-15 10:12:09 -08:00
parent 981979d9ed
commit e2b8d78cac
7 changed files with 37 additions and 37 deletions

View file

@ -27,7 +27,7 @@ class JavaPlugin @Inject constructor(val javaCompiler: JavaCompiler)
// IBuildConfigContributor
private fun hasSourceFiles(project: Project)
= KFiles.findSourceFiles(project, project.sourceDirectories, listOf("java")).size > 0
= KFiles.findSourceFiles(project.directory, project.sourceDirectories, listOf("java")).size > 0
override fun affinity(project: Project) = if (hasSourceFiles(project)) 1 else 0

View file

@ -32,7 +32,7 @@ class KotlinPlugin @Inject constructor(val executors: KobaltExecutors)
// IBuildConfigContributor
private fun hasSourceFiles(project: Project)
= KFiles.findSourceFiles(project, project.sourceDirectories, listOf("kt")).size > 0
= KFiles.findSourceFiles(project.directory, project.sourceDirectories, listOf("kt")).size > 0
override fun affinity(project: Project) = if (hasSourceFiles(project)) 1 else 0

View file

@ -41,8 +41,8 @@ class JarGenerator @Inject constructor(val dependencyManager: DependencyManager)
result.add(IncludedFile(From(prefixPath.toString() + "/"), To(""), fileSpecs))
// Resources, if applicable
project.sourceDirectories.filter { it.contains("resources") }.forEach {
result.add(IncludedFile(From(it), To(""), listOf(IFileSpec.GlobSpec("**"))))
context.variant.resourceDirectories(project).forEach {
result.add(IncludedFile(From(it.path), To(""), listOf(IFileSpec.GlobSpec("**"))))
}
} else {
//