* [Makefile] Make csc strict and fix some small errors.
Make csc to bee more strict when compiling the projects and mix some
small errors we had in the bindings.
Fixes: https://github.com/xamarin/xamarin-macios/issues/5398
* xibuild: New wrapper tool to run msbuild or managed executables
MSBuild supports fallback paths for projects imported using
`$(MSBuildExtensionsPath)`, but these must be specified explicitly in
the app.config of the main executable. There was a PR to allow use of
properties for this in the app.config, but that was not accepted
upstream.
This is required for being able to:
1. build projects with msbuild against the in-tree XI/XM build output
2. and to run nunit tests against the same.
For this we introduce a new tool, `xibuild`, based on XA's `xabuild`.
This supports the fallback paths to be specified via the environment variable
`MSBuildExtensionsPathFallbackPathsOverride`[1].
It essentially operates in 3 modes:
1. `xibuild -c /path/to/foo.exe`
Generates /path/to/foo.exe.config with the fallback paths inserted into that.
2. `xibuild -- /v:diag /path/to/project.csproj`
Runs msbuild with the arguments after `--` with a custom app.config based on
`MSBuild.dll.config`, with the fallback paths correctly inserted.
This is in a temporary file and the original config file is not touched.
3. `xibuild -t -- /path/to/managed_tool.exe args`
Generates `/path/to/managed_tool.exe.config` based on `MSBuild.dll.config` with
the fallback paths inserted, and runs `managed_tool.exe` with the arguments.
The default is to overwrite the config file.
But there is also a switch to merge it with an existing config file.
--
1. Value of the environment variable $MSBuildExtensionsPathFallbackPathsOverride
is prepended to any existing list of search paths in `MSBuild.dll.config`, IOW,
it takes precedence. So, the order of lookup becomes:
- Value of the property `$(MSBuildExtensionsPath)`
- Value of the environment variable `$MSBuildExtensionsPathFallbackPathsOverride`
- /Library/Frameworks/Mono.framework/External/xbuild on macOS
* Integrate use of `xibuild` with the tests
Update all uses of `msbuild` and invocations of tools like nunit that
might depend on using the in-tree builds to use `xibuild`.
* xibuild: Move help descriptions to OptionSet itself.
* Remove more usage of mcs across the build and tests
* Fix -o[ut] mcs/csc argument difference
* Fix OpenTK.[dll.mdb|pdb]
* Complete some MCS|CSC renames
* Fix SYSTEM_CSC not to have a default option since it's not usable that way in every case (and most of them already deal with that option)
* Do not rename a variable used by mono itself
* Un-renamed two other variables
* Fix copying pdb
* Generate debug symbols for *.BindingAttributes.dll and copy .mdb for the old XamMac binary version
* Newer csc-compiled XamMac.BindingAttributes.dll have .pdb while the old, mcs-compiled binary cached, version has a .mdb
* Fix msc -> mcs typo.