Skip to content

Commit

Permalink
Update copy of DependencyConfigurator.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-labelle committed Oct 29, 2024
1 parent 4c1c61e commit a102407
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,21 @@ class DependencyConfigurator(
AndroidArtifacts.TYPE_PLATFORM_ATTR
)

val sharedLibSupport = projectOptions[BooleanOption.CONSUME_DEPENDENCIES_AS_SHARED_LIBRARIES]

val libraryCategory = project.objects.named(Category::class.java, Category.LIBRARY)
for (transformTarget in AarTransform.getTransformTargets(aarOrJarTypeToConsume)) {
dependencies.registerTransform(
AarTransform::class.java
) { spec ->
spec.from.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, AndroidArtifacts.ArtifactType.EXPLODED_AAR.type)
spec.from.attribute(Category.CATEGORY_ATTRIBUTE, libraryCategory)
spec.to.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, transformTarget.type)
spec.to.attribute(Category.CATEGORY_ATTRIBUTE, libraryCategory)
spec.parameters.projectName.setDisallowChanges(project.name)
spec.parameters.targetType.setDisallowChanges(transformTarget)
spec.parameters.sharedLibSupport.setDisallowChanges(sharedLibSupport)
val namespacedSharedLibSupport = projectOptions[BooleanOption.CONSUME_DEPENDENCIES_AS_SHARED_LIBRARIES]
val sharedLibSupport = projectOptions[BooleanOption.SUPPORT_OEM_TOKEN_LIBRARIES]

val libraryCategory = project.objects.named(Category::class.java, Category.LIBRARY)
for (transformTarget in AarTransform.getTransformTargets(aarOrJarTypeToConsume, sharedLibSupport)) {
dependencies.registerTransform(
AarTransform::class.java
) { spec ->
spec.from.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, AndroidArtifacts.ArtifactType.EXPLODED_AAR.type)
spec.from.attribute(Category.CATEGORY_ATTRIBUTE, libraryCategory)
spec.to.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, transformTarget.type)
spec.to.attribute(Category.CATEGORY_ATTRIBUTE, libraryCategory)
spec.parameters.projectName.setDisallowChanges(project.name)
spec.parameters.targetType.setDisallowChanges(transformTarget)
spec.parameters.namespacedSharedLibSupport.setDisallowChanges(namespacedSharedLibSupport)
}
}
if (projectOptions[BooleanOption.PRECOMPILE_DEPENDENCIES_RESOURCES]) {
Expand Down

0 comments on commit a102407

Please sign in to comment.