| apply plugin: 'android-library' |
| |
| android { |
| compileSdkVersion 15 |
| buildToolsVersion "18.0.1" |
| } |
| |
| // query for all (non-test) variants and inject a new step in the builds |
| android.libraryVariants.all { variant -> |
| // create a task that copies some additional data in the library bundle |
| def copyBlahTask = tasks.create(name: "copy${variant.name.capitalize()}Blah", type: Copy) { |
| from file("$project.projectDir/blah") |
| destinationDir file("${buildDir}/bundles/${variant.dirName}") |
| } |
| |
| // now make the package task depend on it |
| variant.packageLibrary.dependsOn copyBlahTask |
| } |
| |
| project.afterEvaluate { |
| if (android.libraryVariants.size() != 2) { |
| throw new GradleException("Wrong number of app variants!") |
| } |
| } |