Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] ReOrder when Assets are Processed. #1161

Merged
merged 1 commit into from
Jan 5, 2018

Conversation

dellis1972
Copy link
Contributor

Context #1150

The way the current system works is that the UpdateAndroidAssets
target is called as part of the ResolveReferencesDependsOn. This
makes it impossible to do any kind of processing of assets after
the project has already built. It also menas that a straight up
call to Build will result in all the assets being copied into
the intermediate directory. If your project has a large number
of assets that is going to take time. Note this might also be
called as part of a designtime build at the moment... not good.

So is there a reason why we call UpdateAndroidAssets before
Compile? We don't generate any entries in the Designer.cs files
for them.. We don't clean them up.. we dont appear to do anything
except package them! So the anser looks to be a resounding NO!

So we shall move the UpdateAndroidAssets to be part of the
_CreateBaseApkDependsOnTargets. This means they will be
processed just before we create the base apk. This will
occur after compilation has completed. So we have a win win..

This commit also includes a unit test which does some post processing
after the Compile target to update an asset, it makes sure that
post processing does work.

Context dotnet#1150

The way the current system works is that the `UpdateAndroidAssets`
target is called as part of the `ResolveReferencesDependsOn`. This
makes it impossible to do any kind of processing of assets after
the project has already built. It also menas that a straight up
call to `Build` will result in all the assets being copied into
the intermediate directory. If your project has a large number
of assets that is going to take time. Note this might also be
called as part of a designtime build at the moment... not good.

So is there a reason why we call `UpdateAndroidAssets` before
`Compile`? We don't generate any entries in the Designer.cs files
for them.. We don't clean them up.. we dont appear to do anything
except package them! So the anser looks to be a resounding NO!

So we shall move the `UpdateAndroidAssets` to be part of the
`_CreateBaseApkDependsOnTargets`. This means they will be
processed just before we create the base apk. This will
occur after compilation has completed. So we have a win win..

This commit also includes a unit test which does some post processing
after the `Compile` target to update an asset, it makes sure that
post processing does work.
@dellis1972 dellis1972 added the Area: xamarin-android Build Issues building the xamarin-android repo *itself*. label Jan 5, 2018
@jonpryor jonpryor merged commit 85740de into dotnet:master Jan 5, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: xamarin-android Build Issues building the xamarin-android repo *itself*.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants