diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8fb50..621b622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Change Log ========== +0.1.3 +----- + +- Added support for using Victor in Android libraries + 0.1.2 ----- diff --git a/victor/build.gradle b/victor/build.gradle index 4dbe9c5..01e8bdb 100644 --- a/victor/build.gradle +++ b/victor/build.gradle @@ -41,7 +41,7 @@ dependencies { // Plugin publishing group = 'com.trello' -version = '0.1.2-SNAPSHOT' +version = '0.1.3-SNAPSHOT' plugindev { pluginId 'com.trello.victor' diff --git a/victor/src/main/groovy/com/trello/victor/VictorPlugin.groovy b/victor/src/main/groovy/com/trello/victor/VictorPlugin.groovy index f11dbfc..aa125b9 100644 --- a/victor/src/main/groovy/com/trello/victor/VictorPlugin.groovy +++ b/victor/src/main/groovy/com/trello/victor/VictorPlugin.groovy @@ -37,8 +37,19 @@ class VictorPlugin implements Plugin { densities.remove(Density.valueOf(density.toUpperCase())) } + def variants = null + if (project.android.hasProperty('applicationVariants')) { + variants = project.android.applicationVariants + } + else if (project.android.hasProperty('libraryVariants')) { + variants = project.android.libraryVariants + } + else { + throw new IllegalStateException('Android project must have applicationVariants or libraryVariants!') + } + // Register our task with the variant's resources - project.android.applicationVariants.all { variant -> + variants.all { variant -> // TODO: Use lazier evaluation for files by sticking this in a prep task? FileCollection svgFiles = project.files() variant.sourceSets.each { sourceSet ->