Skip to content

Commit

Permalink
adding support for library projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ouchadam committed Apr 26, 2019
1 parent 8753d25 commit ade58bf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,6 +18,12 @@ class ThemrPlugin : Plugin<Project> {
}
}

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<String, Style> = readThemeStyles(project.file("src/main/res/values/${extension.source}.xml"))
Expand Down

0 comments on commit ade58bf

Please sign in to comment.