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
            }
        }
    }
}
