blob: 7f2ce6b219412e9312b4311f5aab7ff9be425d87 [file] [log] [blame]
/*
* Copyright (C) 2022 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 androidx.build.LibraryType
import androidx.build.RunApiTasks
import androidx.build.SupportConfig
import androidx.build.SdkHelperKt
plugins {
id("AndroidXPlugin")
id("kotlin")
id("com.google.protobuf")
}
dependencies {
api(libs.kotlinStdlib)
api(libs.protobufLite)
api(libs.kotlinPoet)
implementation(libs.guavaAndroid)
implementation project(path: ':privacysandbox:tools:tools')
testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(project(":internal-testutils-truth"))
testImplementation(project(":privacysandbox:tools:tools-testing"))
testImplementation(project(":room:room-compiler-processing-testing"))
// Include android jar for compilation of generated sources.
testImplementation(fileTree(
dir: "${SdkHelperKt.getSdkPath(project)}/platforms/$SupportConfig.COMPILE_SDK_VERSION/",
include: "android.jar"
))
// Get AIDL compiler path and framework.aidl path and pass to tests for code generation.
def aidlCompilerPath = "${SdkHelperKt.getSdkPath(project)}/build-tools/${SupportConfig.buildToolsVersion(project)}/aidl"
def frameworkAidlPath = "${SdkHelperKt.getSdkPath(project)}/platforms/${SupportConfig.COMPILE_SDK_VERSION}/framework.aidl"
test {
inputs.files(aidlCompilerPath)
.withPropertyName("aidl_compiler_path")
.withPathSensitivity(PathSensitivity.NAME_ONLY)
inputs.files(frameworkAidlPath)
.withPropertyName("framework_aidl_path")
.withPathSensitivity(PathSensitivity.NAME_ONLY)
doFirst {
systemProperty "aidl_compiler_path", aidlCompilerPath
systemProperty "framework_aidl_path", frameworkAidlPath
}
}
}
protobuf {
protoc {
artifact = libs.protobufCompiler.get()
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}
}
}
}
}
androidx {
name = "androidx.privacysandbox.tools:tools-core"
type = LibraryType.ANNOTATION_PROCESSOR_UTILS
inceptionYear = "2022"
description = "Core utilities for Privacy Sandbox Tools."
}