// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
    id 'firebase-library'
    id 'kotlin-android'
}

firebaseLibrary {
    publishJavadoc = false
    releaseNotes {
        enabled.set(false)
    }
}

android {
    namespace "com.google.firebase.encoders.json"
    compileSdkVersion project.compileSdkVersion
    defaultConfig {
        minSdkVersion project.minSdkVersion
        targetSdkVersion project.targetSdkVersion
        versionName version
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
}

kotlin { compilerOptions { jvmTarget = JvmTarget.JVM_1_8 } }

dependencies {
    api 'com.google.firebase:firebase-encoders:17.0.0'

    implementation libs.androidx.annotation

    testImplementation libs.androidx.test.runner
    testImplementation libs.androidx.test.junit
    testImplementation libs.truth
    testImplementation libs.junit
    testImplementation libs.mockito.core
    testImplementation libs.robolectric
}

tasks.withType(JavaCompile) {
    options.compilerArgs << "-Werror"
}
