blob: 8679da4c854de9dd13495d40c2359c787d8cefb0 [file] [log] [blame]
/*
* Copyright 2024 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.gradle.api.attributes.java.TargetJvmEnvironment
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("com.google.protobuf")
id ("kotlin-parcelize")
}
configurations {
// TODO(b/418222072): Migrate MultiProcessDataStoreIpcTest to datastore-core as it is using
// internal implementations
// Configuration to access internal implementation of datastore-core library
// This removes need for suppressing INVISIBLE_REFERENCE and INVISIBLE_MEMBER in codebase
// IDE does not support this configuration yet, so you will still see references to internal
// members marked as an error. You can ignore them.
friends {
canBeResolved = true
canBeConsumed = false
transitive = false
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_API))
attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment, TargetJvmEnvironment.ANDROID))
attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)
attribute(Attribute.of("artifactType", String), "android-classes-jar")
}
}
implementation.extendsFrom(friends)
}
android {
namespace = "androidx.datastore.testapp"
}
dependencies {
implementation(libs.okio)
implementation(libs.protobufLite)
implementation("androidx.lifecycle:lifecycle-service:2.6.1")
implementation(project(":datastore:datastore-core-okio"))
friends(project(":datastore:datastore-core"))
androidTestImplementation(libs.kotlinCoroutinesTest)
androidTestImplementation(libs.kotlinTest)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testCore)
androidTestImplementation(project(":internal-testutils-truth"))
androidTestImplementation(project(":internal-testutils-datastore"))
androidTestImplementation(project(":kruth:kruth"))
}
tasks.withType(KotlinCompile).configureEach {
it.friendPaths.from(configurations.friends.incoming.artifactView { }.files)
}