Verify assets as a part of the build process

23 Views Asked by At

I'm creating an Android application for which the person building it should provide assets in the right format. I want to verify that the assets are in the right format as a part of the build process, so that the app won't have to do this at runtime.

This should probably be done with Gradle, but what is the best way to do this?

Here is what I've considered:

  • First I thought of creating a task that would perform the verification, but AGP docs say that I "must avoid trying to get instances of the Task objects or guessing the Task names and adding callbacks or dependencies to those Task objects directly", so it seems like I shouldn't just make AGP tasks depend on my custom task.

  • Next I read about the Variant API which provides a way to add assets, but I don't see a way to verify the assets already present during the task execution phase.

0

There are 0 best solutions below