* Convert xharness.csproj and Xharness.Tests.csproj to .NET/sdk-style projects.
* Fix numerous nullability issues that came up.
* Adjust Make logic to do the correct thing now that the executable is named differently.
* Port usage of WebClient to HttpClient, since WebClient is deprecated.
* Find an alternative solution to System.Web.MimeMapping.GetMimeMapping, which
doesn’t exist in .NET.
* Fix misc other warnings and errors.
We couldn't do universal builds using NativeAOT, because .NET had a sanity
check that was a bit too eager and caused unnecessary build failures. We've
now been able to add an escape hatch to that sanity check, so let's use it.
This makes universal builds using NativeAOT work, so we can also enable/add
corresponding test variations in xharness.
Also ask the runtime to allow SelfContained without a RuntimeIdentifier (the
runtime has an overeager sanity check that doesn't apply to us, so we must
skip it). Fixes#19142.
Fixes https://github.com/xamarin/xamarin-macios/issues/19142.
Fixes https://github.com/xamarin/xamarin-macios/issues/19206.
This fixes an issue where we wouldn't enable the mtouch tests, because we
check if iOS is enabled to enable them, and it turns out iOS isn't enabled by
default, only 64-bit iOS.
This is rather unintuitive, so just remove the 32-bit/64-bit distinction in
xharness and Azure Pipeline, since our support for 32-bit iOS is very rapidly
going away (with Xcode 15 support) anyway.
When parsing configuration files, our logic works on a first-come-wins basis,
where the first time we find a variable, that's the value we get.
In the makefiles it's the opposite: the final value is the last time a variable is set.
This means we must parse configuration files in the reverse order, otherwise this:
INCLUDE_IOS=
INCLUDE_IOS=1
will get the opposite result of what we want.
We're going to change the pack names to support multi-targeting, so ahead
of the pack name change I'm changing the existing logic to use a variable
for the pack name in most places (this will make the rename much easier and
simpler).
These changes should have no effect by themselves.
Setting test configuration variables using the environment is useful
when running tests on a Windows machine (easier than having to deal with
make).
Also refactor the code a bit to not use constants, and more consistent
naming.
Additionally parse files in reverse order, because any variables at the
end should take precedence (when parsing config files the first time
variable is found is the one we use).
This commit fixes the code that was added in
https://github.com/xamarin/xamarin-macios/pull/16361.
The previous change uses the version number that is part of the config
file in the current build machine. That is correct when we are working
when we are running the tests in the same machine that built them. That
IS NOT THE CASE when building on CI.
Back when the CI did the separation to accommodate the EO we noticed
that if the workload is built in a diff machine, the versions were not
to be trusted, that is why the CI sets and enviroment variable to track
the version that was built in the original step. This change check if we
are on the CI, if we are we trust the version given by the previos
machine, else we use the config one.
The autoformatter was down for a litle while, and these issues crept in.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build:
* Stop running 'make all' in tests/ on every separate test run.
* Add a lot more stuff in the package-test-libraries.zip archive.
* Extract all the new stuff on every test run. We add stuff from outside the tests/
directory, so adjust archive creation and extraction to use the root directory
of the repository as the root of the zip archive as well.
* Also add the introspection dependencies to the same archive to simplify the logic.
* Fix xharness to not store absolute paths in generated projects.
* Fix test project to not automatically run make in tests/test-libraries when running
on the bots.
Building the test dependencies takes ~10 minutes for each test run, so this saves
about that time for each test run.
This is because the SetTopLevelPropertyGroupValue method doesn't always
work as expected (it doesn't always set seomthing), while SetProperty does.
Fixing the SetTopLevelPropertyGroup method is somewhat complex, since it
lives in the dotnet/xharness repository, so instead use the SetProperty
method, which is our own (working) version.
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.
This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.
Also add code to the autoformat script to automatically fix these issues in the future.
Make the code that creates test variations set a single BundlingArguments
property, and then when we generate the corresponding test project we set both
MtouchExtraArgs and MonoBundlingExtraArgs. The property that doesn't apply to
the current platform will just be ignored.