-
Notifications
You must be signed in to change notification settings - Fork 524
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] DTBs and _ResolveLibraryProjectImports #3891
Merged
jonpryor
merged 1 commit into
dotnet:master
from
jonathanpeppers:dtb-resolvelibraryprojectimports
Nov 12, 2019
Merged
[Xamarin.Android.Build.Tasks] DTBs and _ResolveLibraryProjectImports #3891
jonpryor
merged 1 commit into
dotnet:master
from
jonathanpeppers:dtb-resolvelibraryprojectimports
Nov 12, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jonathanpeppers
commented
Nov 8, 2019
jonathanpeppers
force-pushed
the
dtb-resolvelibraryprojectimports
branch
from
November 8, 2019 18:03
c536978
to
5919bb5
Compare
I spent a little time looking at build logs of design-time builds inside VS Windows. To trigger these, I was editing an `.axml` file and saving it. I found some perf issues... The first thing I noticed was that `_ResolveLibraryProjectImports` runs on every DTB: Building target "_ResolveLibraryProjectImports" completely. Input file "obj\Debug\100\designtime\build.props" is newer than output file "obj\Debug\100\stamp\_ResolveLibraryProjectImports.stamp". Then I looked at how `build.props` was actually changing between different targets such as: * `UpdateGeneratedFiles` - the general DTB target * `SetupDependenciesForDesigner` - the Android designer runs this target Comparing the files, I saw this difference: - AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk + AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk\ - AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle + AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle\ - JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25 + JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\ So in some cases `_ResolveMonoAndroidSdks` is running to normalize the paths and other times not... `_CreatePropertiesCache` should depend on `_ResolveMonoAndroidSdks` to fix this issue. After that I found the *next* issue: - DesignTimeBuild = True + DesignTimeBuild = true What??? It appears that the casing differs depending on which part of the IDE is triggering the build. I suspect the designer is using one casing while VS proper uses another. I think we should call `ToLowerInvariant()` on every line in the `build.props` file to work around MSBuild's case insensitivity. This change saves ~350ms on every design-time build. However, if `build.props` changes all the time it may do even better, since `build.props` triggers almost all MSBuild targets in Xamarin.Android.
jonathanpeppers
force-pushed
the
dtb-resolvelibraryprojectimports
branch
from
November 11, 2019 19:29
5919bb5
to
e5093c0
Compare
dellis1972
approved these changes
Nov 12, 2019
jonpryor
pushed a commit
that referenced
this pull request
Nov 12, 2019
…3891) I spent a little time looking at build logs of design-time builds inside VS Windows. To trigger these, I was editing an `.axml` file and saving it. I found some perf issues... The first thing I noticed was that `_ResolveLibraryProjectImports` runs on every DTB: Building target "_ResolveLibraryProjectImports" completely.I spent a little time looking at build logs of design-time builds inside VS Windows. To trigger these, I was editing an `.axml` file and saving it. I found some perf issues... The first thing I noticed was that the `_ResolveLibraryProjectImports` target runs on every DTB: Building target "_ResolveLibraryProjectImports" completely. Input file "obj\Debug\100\designtime\build.props" is newer than output file "obj\Debug\100\stamp\_ResolveLibraryProjectImports.stamp". Then I looked at how `build.props` was actually changing between different targets such as: * `UpdateGeneratedFiles`: the general DTB target * `SetupDependenciesForDesigner`: the Android designer runs this target Comparing the files, I saw this difference: - AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk + AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk\ - AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle + AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle\ - JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25 + JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\ So in some cases the `_ResolveMonoAndroidSdks` target is running to normalize the paths and other times not! The `_CreatePropertiesCache` target should depend on the `_ResolveMonoAndroidSdks` target to fix this issue. After that I found the *next* issue: - DesignTimeBuild = True + DesignTimeBuild = true What??? It appears that the casing differs depending on which part of the IDE is triggering the build. I suspect the designer is using one casing while VS proper uses another. I think we should call `ToLowerInvariant()` on every line in the `build.props` file to work around MSBuild's case insensitivity. This change saves ~350ms on every design-time build. However, if `build.props` changes all the time it may do even better, since `build.props` triggers almost all MSBuild targets in Xamarin.Android. Input file "obj\Debug\100\designtime\build.props" is newer than output file "obj\Debug\100\stamp\_ResolveLibraryProjectImports.stamp". Then I looked at how `build.props` was actually changing between different targets such as: * `UpdateGeneratedFiles` - the general DTB target * `SetupDependenciesForDesigner` - the Android designer runs this target Comparing the files, I saw this difference: - AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk + AndroidSdkPath = C:\Program Files (x86)\Android\android-sdk\ - AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle + AndroidNdkPath = C:\Program Files (x86)\Android\android-sdk\ndk-bundle\ - JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25 + JavaSdkPath = C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25\ So in some cases `_ResolveMonoAndroidSdks` is running to normalize the paths and other times not... `_CreatePropertiesCache` should depend on `_ResolveMonoAndroidSdks` to fix this issue. After that I found the *next* issue: - DesignTimeBuild = True + DesignTimeBuild = true What??? It appears that the casing differs depending on which part of the IDE is triggering the build. I suspect the designer is using one casing while VS proper uses another. I think we should call `ToLowerInvariant()` on every line in the `build.props` file to work around MSBuild's case insensitivity. This change saves ~350ms on every design-time build. However, if `build.props` changes all the time it may do even better, since `build.props` triggers almost all MSBuild targets in Xamarin.Android.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I spent a little time looking at build logs of design-time builds
inside VS Windows. To trigger these, I was editing an
.axml
file andsaving it.
I found some perf issues...
The first thing I noticed was that
_ResolveLibraryProjectImports
runs on every DTB:
Then I looked at how
build.props
was actually changing betweendifferent targets such as:
UpdateGeneratedFiles
- the general DTB targetSetupDependenciesForDesigner
- the Android designer runs thistarget
Comparing the files, I saw this difference:
So in some cases
_ResolveMonoAndroidSdks
is running to normalize thepaths and other times not...
_CreatePropertiesCache
should depend on_ResolveMonoAndroidSdks
to fix this issue.After that I found the next issue:
What??? It appears that the casing differs depending on which part of
the IDE is triggering the build. I suspect the designer is using one
casing while VS proper uses another.
I think we should call
ToLowerInvariant()
on every line in thebuild.props
file to work around MSBuild's case insensitivity.This change saves ~350ms on every design-time build. However, if
build.props
changes all the time it may do even better, sincebuild.props
triggers almost all MSBuild targets in Xamarin.Android.