| buildscript { |
| repositories { |
| maven { url '../../prebuilts/gradle-plugin' } |
| maven { url '../../prebuilts/tools/common/m2/repository' } |
| maven { url '../../prebuilts/tools/common/m2/internal' } |
| } |
| dependencies { |
| classpath 'com.android.tools.build:gradle:0.9.+' |
| } |
| } |
| |
| ext.supportVersion = '19.1.0' |
| ext.supportRepoOut = '' |
| |
| /* |
| * With the build server you are given two env variables. |
| * The OUT_DIR is a temporary directory you can use to put things during the build. |
| * The DIST_DIR is where you want to save things from the build. |
| * |
| * The build server will copy the contents of DIST_DIR to somewhere and make it available. |
| */ |
| if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) { |
| buildDir = file(System.env.OUT_DIR + '/gradle/frameworks/support/build') |
| project.ext.distDir = file(System.env.DIST_DIR) |
| } else { |
| buildDir = file('../../out/host/gradle/frameworks/support/build') |
| project.ext.distDir = file('../../out/dist') |
| } |
| |
| ext.supportRepoOut = new File(buildDir, 'support_repo') |
| |
| // upload anchor for subprojects. |
| task mainUpload() { |
| |
| } |
| |
| // main task for release |
| task createArchive(type: Zip, dependsOn: mainUpload) { |
| from project.ext.supportRepoOut |
| destinationDir project.ext.distDir |
| into 'm2repository' |
| baseName = "android-m2repository-${project.ext.supportVersion}" |
| } |
| |
| // prepare repo. |
| task prepareRepo(type: Copy) { |
| from "$rootDir/../../prebuilts/maven_repo/android" |
| into project.ext.supportRepoOut |
| } |
| |
| prepareRepo.doFirst { |
| project.ext.supportRepoOut.deleteDir() |
| project.ext.supportRepoOut.mkdirs() |
| } |
| |
| subprojects { |
| // Change buildDir first so that all plugins pick up the new value. |
| project.buildDir = project.file("$project.parent.buildDir/../$project.name/build") |
| |
| apply plugin: 'maven' |
| |
| version = rootProject.ext.supportVersion |
| group = 'com.android.support' |
| |
| task release(type: Upload) { |
| configuration = configurations.archives |
| repositories { |
| mavenDeployer { |
| repository(url: uri("$rootProject.ext.supportRepoOut")) |
| } |
| } |
| } |
| |
| release.dependsOn rootProject.tasks.prepareRepo |
| mainUpload.dependsOn release |
| } |
| |
| FileCollection getAndroidPrebuilt(String apiLevel) { |
| files("$rootDir/../../prebuilts/sdk/$apiLevel/android.jar") |
| } |
| |