| 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 33 |
| defaultConfig { |
| consumerProguardFiles "proguard-rules.txt" |
| minSdkVersion 19 |
| targetSdkVersion 33 |
| versionCode 1 |
| versionName "1.0" |
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| } |
| lintOptions { abortOnError true } |
| publishing { |
| singleVariant('release') { |
| withSourcesJar() |
| withJavadocJar() |
| } |
| } |
| } |
| |
| repositories { |
| google() |
| mavenCentral() |
| } |
| |
| dependencies { |
| api project(':grpc-core') |
| implementation libraries.guava |
| testImplementation project('::grpc-okhttp') |
| testImplementation libraries.androidx.test.core |
| testImplementation libraries.junit |
| testImplementation (libraries.robolectric) { |
| // Unreleased change: https://github.com/robolectric/robolectric/pull/5432 |
| exclude group: 'com.google.auto.service', module: 'auto-service' |
| } |
| 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 |
| } |
| } |
| } |
| } |