diff --git a/booster-android-gradle-compat/src/main/kotlin/com/didiglobal/booster/gradle/AGPInterface.kt b/booster-android-gradle-compat/src/main/kotlin/com/didiglobal/booster/gradle/AGPInterface.kt index 35cd83b98..05ab8c9d7 100644 --- a/booster-android-gradle-compat/src/main/kotlin/com/didiglobal/booster/gradle/AGPInterface.kt +++ b/booster-android-gradle-compat/src/main/kotlin/com/didiglobal/booster/gradle/AGPInterface.kt @@ -104,6 +104,8 @@ interface AGPInterface { val BaseVariant.rawAndroidResources: FileCollection + val BaseVariant.localAndroidResources: FileCollection + val BaseVariant.javaCompilerTaskProvider: TaskProvider val BaseVariant.preBuildTaskProvider: TaskProvider diff --git a/booster-android-gradle-v3_3/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_3/V33.kt b/booster-android-gradle-v3_3/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_3/V33.kt index aae7c9e46..aa7eea823 100644 --- a/booster-android-gradle-v3_3/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_3/V33.kt +++ b/booster-android-gradle-v3_3/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_3/V33.kt @@ -111,6 +111,13 @@ internal object V33 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = variantData.androidResources.values.map { + it.get() + }.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v3_4/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_4/V34.kt b/booster-android-gradle-v3_4/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_4/V34.kt index a82c1502c..d0e3b584f 100644 --- a/booster-android-gradle-v3_4/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_4/V34.kt +++ b/booster-android-gradle-v3_4/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_4/V34.kt @@ -112,6 +112,14 @@ internal object V34 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = variantData.androidResources.values.map { + it.get() + }.reduce { collection, file -> + collection.plus(file) + } + + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v3_5/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_5/V35.kt b/booster-android-gradle-v3_5/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_5/V35.kt index 34576a30c..8cf6650d7 100644 --- a/booster-android-gradle-v3_5/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_5/V35.kt +++ b/booster-android-gradle-v3_5/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_5/V35.kt @@ -112,6 +112,13 @@ internal object V35 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = variantData.androidResources.values.map { + it.get() + }.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: AndroidArtifacts.ArtifactScope, diff --git a/booster-android-gradle-v3_6/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_6/V36.kt b/booster-android-gradle-v3_6/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_6/V36.kt index 049904a98..345bbd558 100644 --- a/booster-android-gradle-v3_6/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_6/V36.kt +++ b/booster-android-gradle-v3_6/src/main/kotlin/com/didiglobal/booster/android/gradle/v3_6/V36.kt @@ -121,6 +121,11 @@ object V36 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v4_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_0/V40.kt b/booster-android-gradle-v4_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_0/V40.kt index dfd6e2723..d5fb86f13 100644 --- a/booster-android-gradle-v4_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_0/V40.kt +++ b/booster-android-gradle-v4_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_0/V40.kt @@ -139,6 +139,11 @@ internal object V40 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: AndroidArtifacts.ArtifactScope, diff --git a/booster-android-gradle-v4_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_1/V41.kt b/booster-android-gradle-v4_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_1/V41.kt index ad91f404c..f9c7fae4a 100644 --- a/booster-android-gradle-v4_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_1/V41.kt +++ b/booster-android-gradle-v4_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_1/V41.kt @@ -156,6 +156,11 @@ internal object V41 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = componentProperties.variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = componentProperties.variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v4_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_2/V42.kt b/booster-android-gradle-v4_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_2/V42.kt index 06797ba63..e3ec3d842 100644 --- a/booster-android-gradle-v4_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_2/V42.kt +++ b/booster-android-gradle-v4_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v4_2/V42.kt @@ -157,6 +157,11 @@ internal object V42 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = component.variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = component.variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v7_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_0/V70.kt b/booster-android-gradle-v7_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_0/V70.kt index 4e07524ad..82da7802c 100644 --- a/booster-android-gradle-v7_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_0/V70.kt +++ b/booster-android-gradle-v7_0/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_0/V70.kt @@ -165,6 +165,11 @@ internal object V70 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = component.variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = component.variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v7_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_1/V71.kt b/booster-android-gradle-v7_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_1/V71.kt index 8130ba1da..143625b28 100644 --- a/booster-android-gradle-v7_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_1/V71.kt +++ b/booster-android-gradle-v7_1/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_1/V71.kt @@ -161,6 +161,11 @@ internal object V71 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = component.variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = component.variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope, diff --git a/booster-android-gradle-v7_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_2/V72.kt b/booster-android-gradle-v7_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_2/V72.kt index 13919c14f..d2334d4a4 100644 --- a/booster-android-gradle-v7_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_2/V72.kt +++ b/booster-android-gradle-v7_2/src/main/kotlin/com/didiglobal/booster/android/gradle/v7_2/V72.kt @@ -171,6 +171,11 @@ internal object V72 : AGPInterface { override val BaseVariant.rawAndroidResources: FileCollection get() = component.variantData.allRawAndroidResources + override val BaseVariant.localAndroidResources: FileCollection + get() = component.variantData.androidResources.values.reduce { collection, file -> + collection.plus(file) + } + override fun BaseVariant.getArtifactCollection( configType: AndroidArtifacts.ConsumedConfigType, scope: ArtifactScope,