-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathbuild.gradle
82 lines (73 loc) · 1.87 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
plugins {
id "maven-publish"
id "com.android.library"
}
description = 'gRPC: Android'
android {
namespace 'io.grpc.android'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions { abortOnError true }
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}
repositories {
google()
}
dependencies {
api project(':grpc-api')
implementation project(':grpc-core')
implementation libraries.guava
testImplementation project('::grpc-okhttp')
testImplementation libraries.androidx.test.core
testImplementation libraries.junit
testImplementation libraries.robolectric
testImplementation libraries.truth
}
tasks.register("javadocs", Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.getBootClasspath())
classpath += files({
android.libraryVariants.collect { variant ->
variant.javaCompileProvider.get().classpath
}
})
options {
// Disable JavaDoc doclint on Java 8.
if (JavaVersion.current().isJava8Compatible()) {
addStringOption('Xdoclint:none', '-quiet')
}
}
}
tasks.register("javadocJar", Jar) {
dependsOn javadocs
archiveClassifier = 'javadoc'
from javadocs.destinationDir
}
tasks.register("sourcesJar", Jar) {
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
publishing {
publications {
maven {
afterEvaluate {
from components.release
}
}
}
}