Bug 36079 - AndroidExplicitCrunch does not parallelize calls to aapt
Summary: AndroidExplicitCrunch does not parallelize calls to aapt
Status: IN_PROGRESS
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: 6.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2015-11-19 22:35 UTC by Jerome Laban
Modified: 2017-07-09 07:14 UTC (History)
9 users (show)

See Also:
Tags: BZCU
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jerome Laban 2015-11-19 22:35:17 UTC
When building an app with a very large number of local drawables, particularly when supporting all the available dpis/resolutions, the AAPT cruncher is extremely long).

For an initial build (or rebuild), a set of about 300 png files takes about 5 minutes to crunch (on a Xeon E5520@2.27Ghz).

Would it be possible to provide a way to either skip the crunching in debug, or actually parallelize calls to AAPT in explicit crunch so that it completes faster ?
Comment 2 dean.ellis 2016-05-19 08:16:23 UTC
We might be able to parallelise.. however skipping it not idea good idea since the user will see UI issues with things like 9 patch files. Also the android tooling issues warnings for images that are not crunched (if I remember correctly)
Comment 3 Jerome Laban 2016-05-19 13:16:34 UTC
Thanks for the update.

Sure, 9 patch files are a problem, then I'd rather have a way to include these files pre-crunched in the resources folder. A convention-based skipping would be interesting (e.g. myresource.crunched.png).
Comment 4 dean.ellis 2016-06-14 09:17:57 UTC
I think I have narrowed this down to the Crunch Task. I think we can parallelise that since it works on groups of directories. I'll start taking a look
Comment 5 dean.ellis 2017-02-23 10:44:24 UTC
Hi Jerome

We made some changes in the xamarin-android repo that should help out on resource processing a bit [1]. Now that we have a decent pattern for doing this via the AsyncTask I will look at adding that to the crunch task as well. 



[1] https://github.com/xamarin/xamarin-android/commit/f93149eb4bc456301d7e9b4fb8c9b8228a20cf2f
Comment 6 dean.ellis 2017-03-01 09:39:31 UTC
PR up for the Crunch task https://github.com/xamarin/xamarin-android/pull/462

Note You need to log in before you can comment on or make changes to this bug.