We created an Android app with a webview which shows a local website from the assets folder.
The project has different Product Flavors to generate diffent apps with different styles and content but with the same codebas (native Java and HTML / JS).
For each flavor we want to define a diffent sass file with the colors and tweaks for that specific flavour.
I know that I need to create a task in gradle which builds the CSS files but I have no idea where to start:
- How do I get the url of the assets folder of a specific flavour?
- Can I use a special gradle plugin for building sass or do I have to create a task which executes the "sass" command?
- When I use another gradle plugin like compass, how do I configure the right folders for each flavour? The plugin settings are in the top level and not in the Android plugin level.
I finaly have the solution!
Add this to your build.gradle in the main folder (not of your app):
Add this the build.gradle of the app module:
I never thought it would work out but it works!