diff --git a/grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt b/grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt index 62e82cb..3bbf899 100644 --- a/grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt +++ b/grease/src/main/kotlin/io/deepmedia/tools/grease/GreasePlugin.kt @@ -320,6 +320,7 @@ open class GreasePlugin : Plugin { val resourcesMergingWorkdir = target.greaseBuildDir.get().dir(variant.name).dir("resources") val mergedResourcesDir = resourcesMergingWorkdir.dir("merged") + val currentResourcesDir = resourcesMergingWorkdir.dir("current") val blameDir = resourcesMergingWorkdir.dir("blame") val extraAndroidRes = configurations.artifactsOf(AndroidArtifacts.ArtifactType.ANDROID_RES) dependsOn(extraAndroidRes) @@ -328,6 +329,11 @@ open class GreasePlugin : Plugin { fun injectResources() { target.delete(resourcesMergingWorkdir) + target.delete(currentResourcesDir) + target.copy { + from(outputDir.asFileTree) + into(currentResourcesDir) + } val executorFacade = Workers.withGradleWorkers( creationConfig.services.projectInfo.path, @@ -340,7 +346,7 @@ open class GreasePlugin : Plugin { resCompilerService = CopyToOutputDirectoryResourceCompilationService, incrementalMergedResources = mergedResourcesDir.asFile, mergedResources = outputDir.asFile.get(), - resourceSets = extraAndroidRes.files.toList(), + resourceSets = currentResourcesDir.asFileTree.files.toList() + extraAndroidRes.files, minSdk = minSdk.get(), aaptWorkerFacade = executorFacade, blameLogOutputFolder = blameDir.asFile, diff --git a/tests/sample-dependency-library/build.gradle.kts b/tests/sample-dependency-library/build.gradle.kts new file mode 100644 index 0000000..e467416 --- /dev/null +++ b/tests/sample-dependency-library/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "io.deepmedia.tools.grease.sample.dependency.library" + compileSdk = 34 + defaultConfig { + minSdk = 21 + } + + kotlinOptions { + jvmTarget = "1.8" + } +} + +dependencies { + // Empty +} \ No newline at end of file diff --git a/tests/sample-dependency-library/src/main/res/values/strings.xml b/tests/sample-dependency-library/src/main/res/values/strings.xml new file mode 100644 index 0000000..f254287 --- /dev/null +++ b/tests/sample-dependency-library/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + library_dependency + library2 + \ No newline at end of file diff --git a/tests/sample-library/build.gradle.kts b/tests/sample-library/build.gradle.kts index 46c1896..fd2770c 100644 --- a/tests/sample-library/build.gradle.kts +++ b/tests/sample-library/build.gradle.kts @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) id("io.deepmedia.tools.grease") } @@ -58,6 +59,9 @@ android { dependencies { grease("androidx.core:core:1.0.0") + grease(project(":sample-dependency-pure")) + grease(project(":sample-dependency-library")) + // include deps to pom when publishing api("com.google.android.material:material:1.0.0") // Includes resource and some manifest changes @@ -67,6 +71,4 @@ dependencies { grease("org.tensorflow:tensorflow-lite:2.3.0") // Manifest changes, layout resources grease("com.otaliastudios:cameraview:2.7.2") - - grease(project(":sample-dependency-pure")) } \ No newline at end of file diff --git a/tests/sample-library/src/main/res/values/strings.xml b/tests/sample-library/src/main/res/values/strings.xml new file mode 100644 index 0000000..d5cddaa --- /dev/null +++ b/tests/sample-library/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + library + \ No newline at end of file diff --git a/tests/settings.gradle.kts b/tests/settings.gradle.kts index 844ebee..a575555 100644 --- a/tests/settings.gradle.kts +++ b/tests/settings.gradle.kts @@ -24,4 +24,5 @@ dependencyResolutionManagement { rootProject.name = "Grease" include(":sample-library") -include(":sample-dependency-pure") \ No newline at end of file +include(":sample-dependency-pure") +include(":sample-dependency-library") \ No newline at end of file