-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
81 lines (68 loc) · 2.97 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
apply plugin: 'android-library'
group = 'com.android.support.test.uiautomator'
version = '2.1.2'
// Android Library configuration
android {
defaultConfig {
minSdkVersion 18
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
packagingOptions {
exclude 'LICENSE.txt'
}
sourceSets {
androidTest.java.srcDir 'tests/src/androidTest/java/'
}
}
configurations {
doclava
}
dependencies {
doclava project(':doclava')
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
}
afterEvaluate {
// The tests run against the testapp and will fail unless the testapp is installed as well.
// Make sure the testapp is installed before we run connectedAndroidTest
connectedAndroidTest.dependsOn ':uiautomator-testapp:installDebug'
}
apply from: "../testing/publish.gradle"
// Add Javadoc tasks for all build variants.
afterEvaluate {
// Configure the javadoc task to generate api lists
android.libraryVariants.each { variant ->
Javadoc javadoc = project.tasks.findByName("generate${variant.name.capitalize()}Javadoc")
javadoc.options.addStringOption("api", "${project.docsDir}/${variant.name}/api.txt")
javadoc.options.addStringOption("removedApi", "${project.docsDir}/${variant.name}/removed.txt")
javadoc.options.addStringOption("stubpackages", "android.support.test.uiautomator")
}
// Setup dependencies for api check
apiCheckLast.dependsOn generateReleaseJavadoc
apiCheckCurrent.dependsOn generateReleaseJavadoc
packageReleaseJavadoc.dependsOn apiCheckLast
packageReleaseJavadoc.dependsOn apiCheckCurrent
}
// Check API against current version
task apiCheckCurrent(type: JavaExec) {
main = "com.google.doclava.apicheck.ApiCheck"
classpath = configurations.doclava
args("-error", "2", "-error", "3", "-error", "4", "-error", "5", "-error", "6")
args("-error", "7", "-error", "8", "-error", "9", "-error", "10", "-error", "11")
args("-error", "12", "-error", "13", "-error", "14", "-error", "15", "-error", "16")
args("-error", "17", "-error", "18", "-error", "19", "-error", "20", "-error", "21")
args("-error", "23", "-error", "24", "-error", "25")
args('api/current.txt', "${project.docsDir}/release/api.txt")
args("api/removed.txt", "${project.docsDir}/release/removed.txt")
}
// Check API against previously released version
task apiCheckLast(type: JavaExec) {
main = "com.google.doclava.apicheck.ApiCheck"
classpath = configurations.doclava
args("-hide", "2", "-hide", "3", "-hide", "4", "-hide", "5", "-hide", "6")
args("-error", "7", "-error", "8", "-error", "9", "-error", "10", "-error", "11")
args("-error", "12", "-error", "13", "-error", "14", "-error", "15", "-error", "16")
args("-error", "17", "-error", "18")
args("-hide", "24", "-hide", "25")
args('api/0.txt', "${project.docsDir}/release/api.txt")
args("api/removed.txt", "${project.docsDir}/release/removed.txt")
}