I'm familiar with building large applications using make
, but now I have begun using Android Studio and I want to understand how to do things I already do in a Makefile
.
Here are a example that might help you frame an answer:
Makefile example: (minimalist)
INK=inkscape
INKFLAGS=--export-area-page
# Resolve *.png dependencies
drawable-mdpi/%.png: %.svg
$(INK) $< --export-png=$@ -w 48 -h 48 $(INKFLAGS)
drawable-hdpi/%.png: %.svg
$(INK) $< --export-png=$@ -w 72 -h 72 $(INKFLAGS)
drawable-xdpi/%.png: %.svg
$(INK) $< --export-png=$@ -w 96 -h 96 $(INKFLAGS)
More simple example:
drawable-mdpi/ic_launcher.png: ic_launcher.svg
inkscape ic_launcher.svg --export-png=ic_launcher.png -w 48 -h 48 --export-area-page
drawable-hdpi/ic_launcher.png: ic_launcher.svg
inkscape ic_launcher.svg --export-png=ic_launcher.png -w 72 -h 72 --export-area-page
How to do that in Gradle?
I want to resolve external dependencies such as mentioned in the above example. Actually I'm doing it via 'make', but i want to completely remove this extra step.