diff --git a/themr/src/main/kotlin/com/github/ouchadam/themr/ThemrPlugin.kt b/themr/src/main/kotlin/com/github/ouchadam/themr/ThemrPlugin.kt index bc52a1c..afb0436 100644 --- a/themr/src/main/kotlin/com/github/ouchadam/themr/ThemrPlugin.kt +++ b/themr/src/main/kotlin/com/github/ouchadam/themr/ThemrPlugin.kt @@ -1,6 +1,7 @@ package com.github.ouchadam.themr import com.android.build.gradle.AppPlugin +import com.android.build.gradle.LibraryPlugin import org.gradle.api.Plugin import org.gradle.api.Project import org.w3c.dom.Element @@ -17,6 +18,12 @@ class ThemrPlugin : Plugin { } } + project.plugins.withType(LibraryPlugin::class.java) { plugin -> + plugin.extension.sourceSets { + it.getByName("main").res.srcDirs(project.file("build/generated/res/themr")) + } + } + project.task("themrGenerateThemes") { it.doLast { val styles: Map = readThemeStyles(project.file("src/main/res/values/${extension.source}.xml"))