| plugins { |
| id "maven-publish" |
| id "com.android.library" |
| } |
| |
| description = 'gRPC BinderChannel' |
| |
| android { |
| namespace 'io.grpc.binder' |
| compileSdkVersion 33 |
| compileOptions { |
| sourceCompatibility 1.8 |
| targetCompatibility 1.8 |
| } |
| defaultConfig { |
| minSdkVersion 19 |
| targetSdkVersion 33 |
| versionCode 1 |
| versionName "1.0" |
| testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| multiDexEnabled true |
| } |
| lintOptions { abortOnError false } |
| publishing { |
| singleVariant('release') { |
| withSourcesJar() |
| withJavadocJar() |
| } |
| } |
| } |
| |
| repositories { |
| google() |
| mavenCentral() |
| } |
| |
| dependencies { |
| api project(':grpc-core') |
| |
| implementation libraries.androidx.annotation |
| implementation libraries.androidx.core |
| implementation libraries.androidx.lifecycle.common |
| implementation libraries.guava |
| testImplementation libraries.androidx.core |
| testImplementation libraries.androidx.test.core |
| testImplementation libraries.androidx.lifecycle.common |
| testImplementation libraries.androidx.lifecycle.service |
| testImplementation libraries.junit |
| testImplementation libraries.mockito.core |
| testImplementation (libraries.robolectric) { |
| // Unreleased change: https://github.com/robolectric/robolectric/pull/5432 |
| exclude group: 'com.google.auto.service', module: 'auto-service' |
| } |
| testImplementation (libraries.guava.testlib) { |
| exclude group: 'junit', module: 'junit' |
| } |
| testImplementation libraries.truth |
| testImplementation project(':grpc-testing') |
| testImplementation testFixtures(project(':grpc-core')) |
| |
| androidTestAnnotationProcessor libraries.auto.value |
| androidTestImplementation project(':grpc-testing') |
| androidTestImplementation project(':grpc-protobuf-lite') |
| androidTestImplementation libraries.auto.value.annotations |
| androidTestImplementation libraries.junit |
| androidTestImplementation libraries.androidx.core |
| androidTestImplementation libraries.androidx.test.core |
| androidTestImplementation libraries.androidx.test.rules |
| androidTestImplementation libraries.androidx.test.ext.junit |
| androidTestImplementation libraries.truth |
| androidTestImplementation libraries.mockito.android |
| androidTestImplementation libraries.androidx.lifecycle.service |
| androidTestImplementation (libraries.guava.testlib) { |
| exclude group: 'junit', module: 'junit' |
| } |
| androidTestImplementation testFixtures(project(':grpc-core')) |
| } |
| |
| import net.ltgt.gradle.errorprone.CheckSeverity |
| |
| tasks.withType(JavaCompile).configureEach { |
| options.compilerArgs += [ |
| "-Xlint:-cast" |
| ] |
| appendToProperty(it.options.errorprone.excludedPaths, ".*/R.java", "|") |
| } |
| |
| tasks.register("javadocs", Javadoc) { |
| source = android.sourceSets.main.java.srcDirs |
| exclude 'io/grpc/binder/internal/**' |
| exclude 'io/grpc/binder/Internal*' |
| 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') |
| } |
| } |
| // This is to enable moving to Java 11. An existing problem with javadoc |
| // produces a warning under Java 8, but with Java 11 it fails the build. |
| failOnError false |
| } |
| |
| 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 |
| } |
| } |
| } |
| } |