blob: ae9634bfb4a4da57a720bb62abe591e7141ba178 [file] [log] [blame]
/*
* Copyright 2021 The Android Open Source Project
*
* 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.tasks.KotlinCompile
import androidx.build.LibraryGroups
import androidx.build.LibraryType
import androidx.build.LibraryVersions
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
id("com.google.protobuf")
}
dependencies {
api("androidx.annotation:annotation:1.1.0")
api(libs.guavaListenableFuture)
implementation "androidx.concurrent:concurrent-futures:1.1.0"
implementation "androidx.core:core:1.3.2"
implementation(project(":wear:tiles:tiles"))
implementation(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinCoroutinesAndroid)
androidTestImplementation(project(path: ":wear:tiles:tiles-proto", configuration: "shadow"))
androidTestImplementation(project(":test-screenshot"))
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation("com.google.protobuf:protobuf-java:3.10.0")
testImplementation(libs.testExtJunit)
testImplementation(libs.testExtTruth)
testImplementation(libs.testCore)
testImplementation(libs.testRunner)
testImplementation(libs.testRules)
testImplementation(libs.kotlinCoroutinesTest)
testImplementation(libs.robolectric)
testImplementation(libs.mockitoCore)
testImplementation(libs.truth)
}
android {
defaultConfig {
minSdkVersion 26
}
buildTypes.all {
consumerProguardFiles "proguard-rules.pro"
}
// Use Robolectric 4.+
testOptions.unitTests.includeAndroidResources = true
sourceSets {
androidTest.assets.srcDirs += project.rootDir.absolutePath + "/../../golden/wear/wear-tiles-renderer"
}
}
// Allow usage of Kotlin's @OptIn.
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.10.0"
}
// Generates the java proto-lite code for the protos in this project. See
// https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
// for more information.
generateProtoTasks {
all().each { task ->
task.builtins {
java {}
}
}
}
}
androidx {
name = "Android Wear Tiles Renderer"
type = LibraryType.PUBLISHED_LIBRARY
mavenGroup = LibraryGroups.WEAR_TILES
mavenVersion = LibraryVersions.WEAR_TILES
inceptionYear = "2021"
description = "Android Wear Tiles Renderer components. These components can be used to parse " +
"and render an already constructed Wear Tile."
}