-
Notifications
You must be signed in to change notification settings - Fork 533
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
[build] create xamarin-android-tools.override.props
#8145
Conversation
So does VS not use |
No VS doesn't use
|
Hmm, ok so we probably should put back in some fake "IDE" style tests. |
If you installed the `android` workload via: dotnet workload install android --skip-sign-check \ --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/net8.0.json \ --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json \ --source https://api.nuget.org/v3/index.json `dotnet new android` & `dotnet build` succeeds. But `MSBuild.exe` fails with: D:\src\dotnet-sdk-8.0.100-preview.6.23318.1-win-x64\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.6.323\tools\Xamarin.Android.EmbeddedResource.targets(39,5): error XARLP7028: System.IO.FileNotFoundException: Could not load file or assembly 'libZipSharp, Version=2.1.0.0, Culture=neutral, PublicKeyToken=276db85bc4e20efc' or one of its dependencies. The system cannot find the file specified. File name: 'libZipSharp, Version=2.1.0.0, Culture=neutral, PublicKeyToken=276db85bc4e20efc' at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(IDictionary`2 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments, ICollection`1 proguardConfigFiles) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. It turns out that for references to `libZipSharp.dll`: * `Microsoft.Android.Build.BaseTasks.dll` references 2.1.0.0 * `Xamarin.Android.Build.Tasks.dll` references 3.0.0.0 However, this appears to already be solved in the 34.0.0-preview.6.355 version of the `android` workload. It is broken in `34.0.0-preview.6.323`. In that time window, we updated `$(LibZipSharpVersion)` in xamarin/xamarin-android, but not yet bumped to the latest xamarin/xamarin-android-tools: dotnet@f1d5918 To solve this issue, we can use the extension points we added to: dotnet/android-tools@34e98e2 And import xamarin-android's `Directory.Build.props` from `xamarin-android-tools.override.props`. With this change in place, I can set the value of `$(LibZipSharpVersion)` to any value and the value from xamarin-android overrides it. This probably slipped through because we dropped the "classic" Xamarin.Android test suite that used .NET framework MSBuild on Windows. All tests now use `dotnet build`. I added a test that builds an Android project in Debug & Release with `MSBuild.exe`, and updated Xamarin.ProjectTools to support doing this.
c38e3c5
to
b0bac43
Compare
@@ -33,7 +33,6 @@ public abstract class XamarinProject | |||
public string GlobalPackagesFolder { get; set; } = FileSystemUtils.FindNugetGlobalPackageFolder (); | |||
public IList<string> ExtraNuGetConfigSources { get; set; } = new List<string> (); | |||
|
|||
public virtual bool ShouldRestorePackageReferences => PackageReferences?.Count > 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET 6+ projects always need to restore, so I removed this in main
going forward.
MSBuild .binlog files no longer contain environment variables by default.
My new test fails with:
For some reason it tries to import: But locally, it's importing successfully: |
This isn't needed, as it was/will be addressed by more recent PRs: |
If you installed the
android
workload via:dotnet new android
&dotnet build
succeeds.But
MSBuild.exe
fails with:It turns out that for references to
libZipSharp.dll
:Microsoft.Android.Build.BaseTasks.dll
references 2.1.0.0Xamarin.Android.Build.Tasks.dll
references 3.0.0.0However, this appears to already be solved in the 34.0.0-preview.6.355 version of the
android
workload. It is broken in34.0.0-preview.6.323
.In that time window, we updated
$(LibZipSharpVersion)
in xamarin/xamarin-android, but not yet bumped to the latest xamarin/xamarin-android-tools:f1d5918
To solve this issue, we can use the extension points we added to:
dotnet/android-tools@34e98e2
And import xamarin-android's
Directory.Build.props
fromxamarin-android-tools.override.props
. With this change in place, I can set the value of$(LibZipSharpVersion)
to any value and the value from xamarin-android overrides it.This probably slipped through because we dropped the "classic" Xamarin.Android test suite that used .NET framework MSBuild on Windows. All tests now use
dotnet build
, so we need to add something to testMSBuild.exe
?