Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
am 86fb8ef: gradle for support lib.
Browse files Browse the repository at this point in the history
* commit '86fb8efa9f2eb814c3ccb58e80bbf171b9514760':
  gradle for support lib.
  • Loading branch information
Xavier Ducrohet authored and Android Git Automerger committed Sep 13, 2013
2 parents 6d2f45f + 86fb8ef commit d099474
Show file tree
Hide file tree
Showing 12 changed files with 396 additions and 1 deletion.
49 changes: 49 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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.5.7'
}
}

ext.version = '18.0.1'

// ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/
ext.androidHostOut = file("$rootDir/../../out")

// rootProject.buildDir is specific to this gradle build.
buildDir = new File(ext.androidHostOut, "host/gradle/frameworks/support/build")

ext.androidRepoOut = new File(ext.androidHostOut, "host/support_repo/")

task release(type: Copy) {
from "$rootDir/../../prebuilts/maven_repo/android"
into project.ext.androidRepoOut
}

subprojects {
// Change buildDir first so that all plugins pick up the new value.
project.buildDir = project.file("$project.parent.buildDir/../$project.name")

apply plugin: 'maven'

version = rootProject.ext.version
group = 'com.android.support'

task release(type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: uri("$rootProject.ext.androidRepoOut"))
}
}
}
release.dependsOn rootProject.tasks.release
}

FileCollection getAndroidPrebuilt(String apiLevel) {
files("$rootDir/../../prebuilts/sdk/$apiLevel/android.jar")
}
1 change: 1 addition & 0 deletions local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
android.dir=../../
6 changes: 6 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include 'v4'
include 'v13'
include 'v7:gridlayout'
include 'v7:appcompat'
include 'v7:mediarouter'

95 changes: 95 additions & 0 deletions v13/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apply plugin: 'java'

archivesBaseName = 'support-v13'

sourceSets {
main.java.srcDir 'java'
ics.java.srcDir 'ics'
icsmr1.java.srcDir 'ics-mr1'
k.java.srcDir 'k'
}

dependencies {
icsCompile getAndroidPrebuilt('14')

icsmr1Compile getAndroidPrebuilt('15')

kCompile getAndroidPrebuilt('current')

// order is important as we need the API 13 before the API 4 so that it uses the latest one.
compile getAndroidPrebuilt('13')
compile project(':v4')
compile sourceSets.ics.output
compile sourceSets.icsmr1.output
compile sourceSets.k.output
}

jar {
from sourceSets.ics.output
from sourceSets.icsmr1.output
from sourceSets.k.output
}

uploadArchives {
repositories {
mavenDeployer {

repository(url: uri(project.parent.ext.androidRepoOut)) {
}

pom.project {
name 'Android Support Library v13'
description "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 13 or later."
url 'http://developer.android.com/tools/extras/support-library.html'
inceptionYear '2011'

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

scm {
url "http://source.android.com"
connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
}
developers {
developer {
name 'The Android Open Source Project'
}
}
}
}
}
}

// configuration for the javadoc to include all source sets.
javadoc {
source sourceSets.main.allJava
source sourceSets.ics.allJava
source sourceSets.icsmr1.allJava
source sourceSets.k.allJava
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
from sourceSets.ics.allSource
from sourceSets.icsmr1.allSource
from sourceSets.k.allSource
}

task javadocJar(type: Jar, dependsOn:javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
131 changes: 131 additions & 0 deletions v4/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
apply plugin: 'java'

archivesBaseName = 'support-v4'

sourceSets {
main.java.srcDir 'java'
eclair.java.srcDir 'eclair'
froyo.java.srcDir 'froyo'
gingerbread.java.srcDir 'gingerbread'
honeycomb.java.srcDir 'honeycomb'
honeycombmr2.java.srcDir 'honeycomb_mr2'
ics.java.srcDir 'ics'
icsmr1.java.srcDir 'ics-mr1'
jellybean.java.srcDir 'jellybean'
jellybeanmr1.java.srcDir 'jellybean-mr1'
jellybeanmr2.java.srcDir 'jellybean-mr2'
}

dependencies {
eclairCompile getAndroidPrebuilt('5')
froyoCompile getAndroidPrebuilt('8')
gingerbreadCompile getAndroidPrebuilt('9')
honeycombCompile getAndroidPrebuilt('11')
honeycombmr2Compile getAndroidPrebuilt('13')
icsCompile getAndroidPrebuilt('14')
icsmr1Compile getAndroidPrebuilt('15')
jellybeanCompile getAndroidPrebuilt('16')
jellybeanmr1Compile getAndroidPrebuilt('17')
jellybeanmr2Compile getAndroidPrebuilt('current')

compile getAndroidPrebuilt('4')
compile sourceSets.eclair.output
compile sourceSets.froyo.output
compile sourceSets.gingerbread.output
compile sourceSets.honeycomb.output
compile sourceSets.honeycombmr2.output
compile sourceSets.ics.output
compile sourceSets.icsmr1.output
compile sourceSets.jellybean.output
compile sourceSets.jellybeanmr1.output
compile sourceSets.jellybeanmr2.output
}


jar {
from sourceSets.eclair.output
from sourceSets.froyo.output
from sourceSets.gingerbread.output
from sourceSets.honeycomb.output
from sourceSets.honeycombmr2.output
from sourceSets.ics.output
from sourceSets.icsmr1.output
from sourceSets.jellybean.output
from sourceSets.jellybeanmr1.output
from sourceSets.jellybeanmr2.output
}

uploadArchives {
repositories {
mavenDeployer {
repository(url: uri(project.parent.ext.androidRepoOut)) {
}

pom.project {
name 'Android Support Library v4'
description "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 4 or later."
url 'http://developer.android.com/tools/extras/support-library.html'
inceptionYear '2011'

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

scm {
url "http://source.android.com"
connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
}
developers {
developer {
name 'The Android Open Source Project'
}
}
}
}
}
}

// configuration for the javadoc to include all source sets.
javadoc {
source sourceSets.main.allJava
source sourceSets.eclair.allJava
source sourceSets.froyo.allJava
source sourceSets.gingerbread.allJava
source sourceSets.honeycomb.allJava
source sourceSets.honeycombmr2.allJava
source sourceSets.ics.allJava
source sourceSets.icsmr1.allJava
source sourceSets.jellybean.allJava
source sourceSets.jellybeanmr1.allJava
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
from sourceSets.eclair.allSource
from sourceSets.froyo.allSource
from sourceSets.gingerbread.allSource
from sourceSets.honeycomb.allSource
from sourceSets.honeycombmr2.allSource
from sourceSets.ics.allSource
from sourceSets.icsmr1.allSource
from sourceSets.jellybean.allSource
from sourceSets.jellybeanmr1.allSource
}

task javadocJar(type: Jar, dependsOn:javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
1 change: 1 addition & 0 deletions v7/appcompat/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat">
<uses-sdk android:minSdkVersion="7"/>
<application />
</manifest>
26 changes: 26 additions & 0 deletions v7/appcompat/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apply plugin: 'android-library'

archivesBaseName = 'appcompat-v7'

dependencies {
compile project(':v4')
}

android {
compileSdkVersion "current"
buildToolsVersion "17"

sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDir 'src'
main.res.srcDir 'res'
main.assets.srcDir 'assets'
main.resources.srcDir 'src'
instrumentTest.java.srcDir 'tests/src'

// this moves src/instrumentTest to tests so all folders follow:
// tests/java, tests/res, tests/assets, ...
// This is a *reset* so it replaces the default paths
instrumentTest.setRoot('tests')
}
}
1 change: 1 addition & 0 deletions v7/gridlayout/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.gridlayout">
<uses-sdk android:minSdkVersion="7"/>
<application />
</manifest>
22 changes: 22 additions & 0 deletions v7/gridlayout/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apply plugin: 'android-library'

archivesBaseName = 'gridlayout-v7'

android {
compileSdkVersion "unstubbed"
buildToolsVersion "17"

sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.java.srcDir 'src'
main.res.srcDir 'res'
main.assets.srcDir 'assets'
main.resources.srcDir 'src'
instrumentTest.java.srcDir 'tests/src'

// this moves src/instrumentTest to tests so all folders follow:
// tests/java, tests/res, tests/assets, ...
// This is a *reset* so it replaces the default paths
instrumentTest.setRoot('tests')
}
}
2 changes: 1 addition & 1 deletion v7/gridlayout/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

# Project target.
target=android-7
android.library=true
android.library=true
1 change: 1 addition & 0 deletions v7/mediarouter/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.mediarouter">
<uses-sdk android:minSdkVersion="7"/>
<application />
</manifest>
Loading

0 comments on commit d099474

Please sign in to comment.