Skip to content

Commit

Permalink
Bump to AGP 8.5.1 (#128)
Browse files Browse the repository at this point in the history
* Bump to AGP 8.5.1

* Update copy of DependencyConfigurator.kt
  • Loading branch information
eric-labelle authored Jul 24, 2024
1 parent 6efbd73 commit 37c58b7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,13 @@ class DependencyConfigurator(
)
}

fun configurePrivacySandboxSdkConsumerTransforms(): DependencyConfigurator {
fun configurePrivacySandboxSdkConsumerTransforms(
compileSdkHashString: String,
buildToolsRevision: Revision,
bootstrapCreationConfig: BootClasspathConfig,
variants: List<VariantCreationConfig> = emptyList()
)
: DependencyConfigurator {
for (from in AsarTransform.supportedAsarTransformTypes) {
registerTransform(
AsarTransform::class.java,
Expand All @@ -476,21 +482,14 @@ class DependencyConfigurator(
}
}

return this
}

fun configurePrivacySandboxSdkVariantTransforms(
variants: List<VariantCreationConfig>,
compileSdkHashString: String,
buildToolsRevision: Revision,
bootstrapCreationConfig: BootClasspathConfig
): DependencyConfigurator {
fun configureExtractSdkShimTransforms(experimentalProperties: Map<String, Any>) {
fun configureExtractSdkShimTransforms(experimentalProperties: Map<String, Any>?) {
val extractSdkShimTransformParamConfig =
{ reg: TransformSpec<ExtractSdkShimTransform.Parameters> ->
val experimentalPropertiesApiGenerator: Dependency? =
experimentalProperties?.let {
ModulePropertyKey.Dependencies.ANDROID_PRIVACY_SANDBOX_SDK_API_GENERATOR
.getValue(experimentalProperties)?.single()
.getValue(it)?.single()
}
val apigeneratorArtifact: Dependency =
experimentalPropertiesApiGenerator
?: project.dependencies.create(
Expand All @@ -499,7 +498,11 @@ class DependencyConfigurator(
) as Dependency

val experimentalPropertiesRuntimeApigeneratorDependencies =
ModulePropertyKey.Dependencies.ANDROID_PRIVACY_SANDBOX_SDK_API_GENERATOR_GENERATED_RUNTIME_DEPENDENCIES.getValue(experimentalProperties)
experimentalProperties?.let {
ModulePropertyKey.Dependencies.ANDROID_PRIVACY_SANDBOX_SDK_API_GENERATOR_GENERATED_RUNTIME_DEPENDENCIES.getValue(
it
)
}
val runtimeDependenciesForShimSdk: List<Dependency> =
experimentalPropertiesRuntimeApigeneratorDependencies
?: (projectServices.projectOptions
Expand Down Expand Up @@ -593,13 +596,20 @@ class DependencyConfigurator(
}
}.distinct()

when(properties.size) {
0 -> {} // No variants, problem will be reported elsewhere.
1 -> configureExtractSdkShimTransforms(properties.single())
else -> error("It is not possible to override Privacy Sandbox experimental properties per variant.\n" +
"Properties with different values defined across multiple variants: ${properties.joinToString()} ")
if (properties.count() > 1) {
error(
"It is not possible to override Privacy Sandbox experimental properties per variant.\n" +
"Properties with different values defined across multiple variants: ${properties.joinToString()} "
)
}
configureExtractSdkShimTransforms(properties.singleOrNull())

return this
}

fun configurePrivacySandboxSdkVariantTransforms(
variants: List<VariantCreationConfig>,
): DependencyConfigurator {
fun registerAsarToApksTransform(variants: List<VariantCreationConfig>) {
// For signing privacy sandbox artifacts we allow per project signing configuration
// by the use of experimental properties. To reduce the expense of registering per
Expand Down Expand Up @@ -631,7 +641,7 @@ class DependencyConfigurator(
else -> throw UnsupportedOperationException(
"It is not possible to override Privacy Sandbox experimental properties per variant.\n" +
"Set the same signing config using experimental properties in each variant explicitly.")
}
}
registerTransform(
AsarToApksTransform::class.java,
AndroidArtifacts.ArtifactType.ANDROID_PRIVACY_SANDBOX_SDK_ARCHIVE,
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.5.0" # keep in sync with android-tools
android-tools = "31.5.0" # = 23.0.0 + agp
agp = "8.5.1" # keep in sync with android-tools
android-tools = "31.5.1" # = 23.0.0 + agp
compilerTesting = "0.2.1"
compose = "1.5.14"
kotlin = "1.9.24"
Expand Down

0 comments on commit 37c58b7

Please sign in to comment.