| /** |
| * This file was created using the `create_project.py` script located in the |
| * `<AndroidX root>/development/project-creator` directory. |
| * |
| * Please use that script when creating a new project, rather than copying an existing project and |
| * modifying its settings. |
| */ |
| import androidx.build.LibraryType |
| import androidx.build.SdkResourceGenerator |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("kotlin") |
| id("java-gradle-plugin") |
| } |
| |
| configurations { |
| // Config for plugin classpath to be used during tests |
| testPlugin { |
| canBeConsumed = false |
| canBeResolved = true |
| } |
| } |
| |
| tasks.withType(Test).configureEach { |
| it.javaLauncher = javaToolchains.launcherFor { |
| // Test on JDK 17 which supports lower versions of AGP. This can be removed |
| // once we move to AGP 8.2.1+ |
| languageVersion = JavaLanguageVersion.of(17) |
| } |
| } |
| |
| apply from: "../../../buildSrc/kotlin-dsl-dependency.gradle" |
| |
| dependencies { |
| implementation(findGradleKotlinDsl()) |
| implementation("com.android.tools.build:gradle-api:8.0.0") |
| implementation(libs.kotlinStdlib) |
| compileOnly(libs.androidGradlePlugin) |
| compileOnly(libs.kspGradlePlugin) |
| |
| testImplementation(libs.junit) |
| testImplementation(project(":internal-testutils-gradle-plugin")) |
| |
| testPlugin("com.android.tools.build:gradle:8.0.0") |
| testPlugin("com.android.tools.build:aapt2:8.0.0-9289358") |
| testPlugin("com.android.tools.build:aapt2:8.0.0-9289358:linux") |
| testPlugin("com.android.tools.build:aapt2:8.0.0-9289358:osx") |
| testPlugin(libs.kotlinGradlePlugin) |
| testPlugin(libs.kspGradlePlugin) |
| } |
| |
| gradlePlugin { |
| plugins { |
| privacysandboxlibrary { |
| id = "androidx.privacysandbox.library" |
| implementationClass = "androidx.privacysandboxlibraryplugin.PrivacySandboxLibraryPlugin" |
| } |
| } |
| } |
| |
| // Configure the generating task of plugin-under-test-metadata.properties to |
| // include additional dependencies for the injected plugin classpath that |
| // are not present in the main runtime dependencies. This allows us to test |
| // the KAPT / KSP plugins while keeping a compileOnly dep on the main source. |
| tasks.withType(PluginUnderTestMetadata.class).named("pluginUnderTestMetadata").configure { |
| it.pluginClasspath.from(configurations.testPlugin) |
| } |
| |
| androidx { |
| name = "androidx.privacysandbox.plugins:privacysandbox-library" |
| type = LibraryType.GRADLE_PLUGIN |
| inceptionYear = "2023" |
| description = "Android Privacy Sandbox Sdk Library Gradle Plugin" |
| } |