Open AlexBurdu opened 2 weeks ago
One of the use-cases for this is Compose Resources support in Amper. The current limitation in the Compose Gradle Plugin doesn't allow configuring it for the Amper-native project layout, which uses the flat folders structure. Example:
project/
src/
src@android/
composeRresources/
...
module.yaml
settings.gradle.kts
In this example layout, the composeResources
folder is located on the module/project level, without additional nesting.
Currently, there is a workaround for Amper to use Gradle-compatible project layout. But this leads to additional setup burden on the user.
In order to support Amper-native project layout, Compose Gradle plugin should allow customizable location of the composeResources
folder
See: AMPER-555 Support Compose resources in native Amper layout
Describe the bug
In the project I'm working on we try to reduce the nesting of the directories and customized the directory structure:
What happens is that the Resources accessors (extensions) are not generated, hence we can't do
Res.drawable.cupcake
and still need to rely onDrawableResource("drawable/copcake.xml")
.It would appear that the new compose resources feature relies on the standard structure and does not generate the accessors when that is customized.
Changing the above to the following fixes the issue:
Notice the
src
addition.Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
Unresolved reference: cupcake
Expected behavior Resources should be accessible for custom directory structure, as the path to them is provided in the gradle configuration.