From 12ea23ff1c23b87b08d7bcf6337be1396a0c3194 Mon Sep 17 00:00:00 2001 From: Daniel Santiago Date: Mon, 28 Jun 2021 09:11:09 -0700 Subject: [PATCH] Use File APIs when comparing paths in the AggregatedPackagesTransform. Using file APIs allows for platform-agnostic path comparisons where as File#parent() returns a String which will contain path separators that are OS specific and will fail to match with the known aggregated packages path that use UNIX-based file separator '/'. Specifically this fixes an issue for Windows users whose file separators are '\'. Note that JarEntry path matching is String based but well formatted Jar files (which are Zip files) regardless of the host OS use forward slashes as path separator. Fixes https://github.com/google/dagger/issues/2695 RELNOTES=Fix an issue where `enableAggregatingTask` would not correctly generate Hilt classes when compiling in a dev environment with Windows OS. PiperOrigin-RevId: 381877388 --- .../hilt/android/plugin/util/AggregatedPackagesTransform.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/dagger/hilt/android/plugin/src/main/kotlin/dagger/hilt/android/plugin/util/AggregatedPackagesTransform.kt b/java/dagger/hilt/android/plugin/src/main/kotlin/dagger/hilt/android/plugin/util/AggregatedPackagesTransform.kt index fe6e1800154..9e91d6b88aa 100644 --- a/java/dagger/hilt/android/plugin/src/main/kotlin/dagger/hilt/android/plugin/util/AggregatedPackagesTransform.kt +++ b/java/dagger/hilt/android/plugin/src/main/kotlin/dagger/hilt/android/plugin/util/AggregatedPackagesTransform.kt @@ -77,7 +77,7 @@ abstract class AggregatedPackagesTransform : TransformAction parentDirectory.endsWith(aggregatedPackage) }