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

Rework Design Time Build to use .aar files directly. #9423

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Oct 18, 2024

Context dotnet/maui#25207
Also

  1. Only import targets we actually need for a DTB
  2. re-order the targets to they run in the right places
  3. don't run targets we don't need to.
  4. move all design time files (as much as possible) to the designtime folder.

@dellis1972
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dellis1972 dellis1972 marked this pull request as ready for review December 9, 2024 19:46
@@ -35,8 +35,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
Disable generation to avoid "bizarre" build errors. -->
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<_AndroidResourceDesigner>Resource.designer.cs</_AndroidResourceDesigner>
<IsXBuild Condition="'$(MSBuildRuntimeVersion)' == ''">true</IsXBuild>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xbuild?!? Looking at this file, it's really old and only imported by classic Xamarin.Android. Maybe we don't need to touch this file here, and we can delete all references to Xamarin.Android.CSharp.targets in a different PR?

var path = Directory.GetParent (entry.FullName).Name;
if (ext == ".xml" || ext == ".axml") {
if (string.Compare (path, "raw", StringComparison.OrdinalIgnoreCase) != 0) {
using var ms = new MemoryStream ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this use the MemoryStreamPool we have in dotnet/android-tools?

if (entry.FullName != resmap)
continue;
Log.LogDebugMessage ($"Found: {entry.FullName}");
using var ms = new MemoryStream();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thought with MemoryStreamPool here.

Comment on lines +73 to +75
<MSBuild
Projects="@(ProjectReference)"
Targets="Restore;_GetProjectResourceDirectory"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions here:

  1. Does this really need to run Restore?
  2. What happens if the @(ProjectReference) is a plain net9.0 project or something old like netstandard2.0 or PCL?

Comment on lines 90 to +93
<_AdditionalProperties>
_ComputeFilesToPublishForRuntimeIdentifiers=true
;SelfContained=true
;DesignTimeBuild=$(DesignTimeBuild)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the inner-build per RID run during a design-time build? Does it even need to?

It's doing stuff related to the trimmer & AOT, it seems like should figure out how to skip it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants