Setup a basic gradle build.

Any interaction with Maven is missing, and docs/API txt's are not currently
generating. These will be done in future CLs.

PiperOrigin-RevId: 141363143
This commit is contained in:
travisc 2016-12-07 23:09:24 +00:00 committed by Travis Collins
parent 5effa7d71f
commit 0625dfe0e9
4 changed files with 79 additions and 41 deletions

2
.gitignore vendored
View File

@ -5,6 +5,6 @@
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
build/
/captures
.externalNativeBuild

70
build.gradle Normal file
View File

@ -0,0 +1,70 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
allprojects {
repositories {
jcenter()
}
}
ext {
extraVersion = 40
buildNumber = Integer.toString(extraVersion)
buildToolsVersion = '24.0.1'
compileSdkVersion = 25
minSdkVersion = 9
targetSdkVersion = 25
supportVersion = '25.1.0-SNAPSHOT'
testRunnerVersion = '0.6-alpha'
espressoVersion = '2.3-alpha'
// Enforce the use of prebuilt dependencies in all sub-projects. This is
// required for the doclava dependency.
usePrebuilts = "true"
}
// lint every library
task(lint) << {
}
// TODO: setup docs build and API txt generation
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
version = rootProject.ext.supportVersion
group = 'com.android.support'
project.plugins.whenPluginAdded { plugin ->
def isAndroidLibrary = "com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)
def isAndroidApp = "com.android.build.gradle.AppPlugin".equals(plugin.class.name)
def isJavaLibrary = "org.gradle.api.plugins.JavaPlugin".equals(plugin.class.name)
if (isAndroidLibrary || isAndroidApp) {
// Enable code coverage for debug builds only if we are not running inside the IDE,
// since enabling coverage reports breaks the method parameter resolution in the IDE
// debugger.
project.android.buildTypes.debug.testCoverageEnabled = !hasProperty('android.injected.invoked.from.ide')
// TODO: setup code coverage collection for tests
// Enforce NewApi lint check as fatal.
project.android.lintOptions.check 'NewApi'
project.android.lintOptions.fatal 'NewApi'
project.parent.lint.dependsOn project.lint
}
if (isAndroidLibrary || isJavaLibrary) {
// TODO: setup maven release building?
}
}
}

View File

@ -3,10 +3,10 @@ apply plugin: 'com.android.library'
archivesBaseName = 'design'
dependencies {
compile project(':support-v4')
compile project(':support-appcompat-v7')
compile project(':support-recyclerview-v7')
compile project(':support-transition')
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:transition:25.0.1'
androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
exclude module: 'support-annotations'
@ -21,10 +21,12 @@ dependencies {
}
android {
compileSdkVersion project.ext.currentSdk
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 9
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// This disables the builds tools automatic vector -> PNG generation
generatedDensities = []
@ -96,37 +98,3 @@ android.libraryVariants.all { variant ->
artifacts.add('archives', javadocJarTask);
artifacts.add('archives', sourcesJarTask);
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri(rootProject.ext.supportRepoOut)) {
}
pom.project {
name 'Android Design Support Library'
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'
}
}
}
}
}
}