Skip to content

Commit

Permalink
Implemented scanning multiple drawable directories when present.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsnappy1 committed Nov 21, 2024
1 parent c37f14a commit bfce1f1
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ internal class ResourceManager(
)
)

// Locate the "drawable" directory within the "res" directory.
list.add(
Resource(
type = ResourceType.DRAWABLES,
moduleDetails = ModuleDetails(resDirectory = File(resFile, "drawable"))
// Locate all "drawable" directory within the "res" directory.
resFile.listFiles()?.filter { it.isDirectory && it.name.startsWith("drawable") }?.forEach { drawableDirectory ->
list.add(
Resource(
type = ResourceType.DRAWABLES,
moduleDetails = ModuleDetails(resDirectory = File(resFile, drawableDirectory.name))
)
)
)
}

/*
Also add resources for project dependencies. (i.e. implementation(project(":my_library")))
Expand All @@ -69,13 +71,15 @@ internal class ResourceManager(
)
)

// Locate the "drawable" directory within the "res" directory.
list.add(
Resource(
type = ResourceType.DRAWABLES,
moduleDetails = ModuleDetails(module, namespace, File(resFile, "drawable"))
// Locate all "drawable" directory within the "res" directory.
resFile.listFiles()?.filter { it.isDirectory && it.name.startsWith("drawable") }?.forEach { drawableDirectory ->
list.add(
Resource(
type = ResourceType.DRAWABLES,
moduleDetails = ModuleDetails(module, namespace, File(resFile, "drawable"))
)
)
)
}
}
}
return list
Expand Down

0 comments on commit bfce1f1

Please sign in to comment.