From aec010b5808c469ce77962d894470c4e4cffa0d8 Mon Sep 17 00:00:00 2001 From: Tom Tresansky Date: Wed, 29 May 2024 08:35:19 -0400 Subject: [PATCH] Adding minimal support for necessary proguard file property for NiA --- .../api/experimental/android/library/AndroidLibrary.java | 5 +++++ .../android/library/StandaloneAndroidLibraryPlugin.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/AndroidLibrary.java b/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/AndroidLibrary.java index 119a34db..c9e717b2 100644 --- a/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/AndroidLibrary.java +++ b/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/AndroidLibrary.java @@ -18,6 +18,7 @@ import org.gradle.api.Action; import org.gradle.api.experimental.android.AndroidSoftware; +import org.gradle.api.provider.Property; import org.gradle.api.tasks.Nested; import org.gradle.declarative.dsl.model.annotations.Configuring; import org.gradle.declarative.dsl.model.annotations.Restricted; @@ -40,4 +41,8 @@ default void dependencies(Action action) { default void buildTypes(Action action) { action.execute(getBuildTypes()); } + + // TODO: We really want to model a list of consumer proguard files here, but can't yet + @Restricted + Property getConsumerProguardFile(); } diff --git a/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/StandaloneAndroidLibraryPlugin.java b/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/StandaloneAndroidLibraryPlugin.java index 769ebfe6..9853fbc2 100644 --- a/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/StandaloneAndroidLibraryPlugin.java +++ b/unified-prototype/unified-plugin/plugin-android/src/main/java/org/gradle/api/experimental/android/library/StandaloneAndroidLibraryPlugin.java @@ -52,6 +52,8 @@ private void linkDslModelToPlugin(Project project, AndroidLibrary dslModel) { if (NiaSupport.isNiaProject(project)) { NiaSupport.configureNiaLibrary(project, dslModel); } + + ifPresent(dslModel.getConsumerProguardFile(), android.getDefaultConfig()::consumerProguardFile); } @SuppressWarnings("UnstableApiUsage")