forked from material-components/material-components-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
88 lines (71 loc) · 2.77 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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.3.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"
// Disable pre-dexing when gradle called with -PdisablePreDex;
preDexLibs = !project.hasProperty('disablePreDex')
}
// 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 isAndroidTest = "com.android.build.gradle.TestPlugin".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. Note that we avoid doing this for Android Test projects as it causes
// crashes on Dalvik ('Class ref in pre-verified class resolved to unexpected implementation')
project.android.buildTypes.debug.testCoverageEnabled = !hasProperty('android.injected.invoked.from.ide')
}
if (isAndroidLibrary || isAndroidApp || isAndroidTest) {
// Enforce NewApi lint check as fatal.
project.android.lintOptions.check 'NewApi'
project.android.lintOptions.fatal 'NewApi'
// Disable pre-dexing when gradle called with -PdisablePreDex;
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
rootProject.lint.dependsOn project.lint
project.android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig.minSdkVersion rootProject.ext.minSdkVersion
defaultConfig.targetSdkVersion rootProject.ext.targetSdkVersion
// This disables the builds tools automatic vector -> PNG generation
defaultConfig.generatedDensities = []
compileOptions.sourceCompatibility JavaVersion.VERSION_1_7
compileOptions.targetCompatibility JavaVersion.VERSION_1_7
aaptOptions.additionalParameters "--no-version-vectors"
}
}
}
}