| /* |
| * 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.LibraryType |
| |
| 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.concurrent:concurrent-futures-ktx:1.1.0" |
| implementation "androidx.core:core:1.3.2" |
| implementation "androidx.wear:wear:1.2.0" |
| |
| implementation(project(":wear:tiles:tiles")) |
| implementation(project(":wear:tiles:tiles-proto")) |
| implementation(libs.kotlinCoroutinesCore) |
| implementation(libs.kotlinCoroutinesAndroid) |
| |
| androidTestImplementation(project(":test:screenshot:screenshot")) |
| androidTestImplementation(libs.testExtJunit) |
| androidTestImplementation(libs.testCore) |
| androidTestImplementation(libs.testRunner) |
| androidTestImplementation(libs.testRules) |
| androidTestImplementation(libs.protobuf) |
| |
| // I'm not 100% sure why, but androidTestImplementation doesn't appear to use the standard |
| // results of a project build. This leads to it not using the shadow configuration from |
| // tiles-proto, and thus failing to find the protobuf classes at runtime. |
| // |
| // This line forces the androidTest to use the properly shaded proto library on the runtime |
| // classpath. |
| androidTestRuntimeOnly(project(path: ":wear:tiles:tiles-proto", configuration: "shadow")) |
| |
| 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.mockitoKotlin) |
| 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" |
| } |
| namespace "androidx.wear.tiles.renderer" |
| } |
| |
| // Allow usage of Kotlin's @OptIn. |
| tasks.withType(KotlinCompile).configureEach { |
| kotlinOptions { |
| freeCompilerArgs += ["-opt-in=kotlin.RequiresOptIn"] |
| } |
| } |
| |
| protobuf { |
| protoc { |
| artifact = libs.protobufCompiler.get() |
| } |
| |
| // 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 |
| inceptionYear = "2021" |
| description = "Android Wear Tiles Renderer components. These components can be used to parse " + |
| "and render an already constructed Wear Tile." |
| } |
| |