Commit eff77a4
[xaprepare] Restore for multiple solutions (#3997)
Context: #3884
Commit 91467bb updated the build system so that instead of trying to
do "everthing" within a single `.sln` file -- which would result in
various file share exceptions when attempting to build
`Xamarin.Android.sln` within Visual Studio on Windows -- the build
tree would instead become "stateful":
1. Build `Xamarin.Android.BootstrapTasks.sln`.
2. Then `Xamarin.Android.sln` can be built.
3. Then `Xamarin.Android-Tests.sln` can be built.
(1) was handled "internally" via `msbuild /t:Prepare`.
A result of 91467bb is that if e.g.
`build-tools/Xamarin.Android.Tools.BootstrapTasks` were changed, building
`src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj`
would no longer cause `Xamarin.Android.Tools.BootstrapTasks` to be
rebuilt.
(This was the point, as rebuilding
`Xamarin.Android.Tools.BootstrapTasks`/etc. is what caused the file
sharing issues that we wanted fixed.)
Overlooked in 91467bb is that `xaprepare` (invoked by
`msbuild /t:Prepare`) is responsible for restoring NuGet packages on
`.sln` files, but it would only restore packages for
`Xamarin.Android.sln`.
This restriction caused problems in PR #3884, which attempted to add
NuGet packages to `build-tools/Xamarin.Android.BootstrapTasks`, but
because that solution never had its NuGet packages restored,
attempting to use the expected *outputs* of NuGet restore would fail:
$ cat build-tools/Xamarin.Android.BootstrapTasks/packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.ApiCompat" version="5.0.0-beta.19602.1" targetFramework="net472" />
<package id="Microsoft.DotNet.GenAPI" version="5.0.0-beta.19602.1" targetFramework="net472" />
<package id="Mono.Posix.NETStandard" version="1.0.0" targetFramework="net472" />
<package id="Xamarin.LibZipSharp" version="1.0.6" targetFramework="net472" />
</packages>
$ msbuild -t:restore build-tools/Xamarin.Android.BootstrapTasks/Xamarin.Android.Tools.BootstrapTask.csproj
…
$ ls packages/Microsoft.D*
ls: cannot access 'packages/Microsoft.D*': No such file or directory
Improve build system sanity: when `xaprepare` restores NuGet packages,
it should restore the following solutions:
* `Xamarin.Android.BootstrapTasks.sln`
* `Xamarin.Android.Build.Tasks.sln`
* `Xamarin.Android.sln`
This will allow PR #3884 to work as intended.1 parent 83ba00a commit eff77a4
File tree
2 files changed
+20
-8
lines changed- build-tools/xaprepare/xaprepare
- Application
- Steps
2 files changed
+20
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
171 | 178 | | |
172 | 179 | | |
173 | 180 | | |
174 | | - | |
| 181 | + | |
175 | 182 | | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
179 | | - | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
0 commit comments