Commit 88d6093
authored
[ci] Build without -m:1. (#941)
`dotnet build Java.Interop.sln` didn't work unless `-m:1` was used:
% make prepare-core JI_MAX_JDK=8
% dotnet build -target:Prepare -p:MaxJdkVersion=8 Java.Interop.sln
% dotnet build Java.Interop.sln
…
…/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj(35,5): error MSB3073: The command ""/Users/jon/android-toolchain/jdk-1.8/bin/javac" -classpath …" exited with code 1.
…/tests/Java.Interop.Export-Tests/Java.Interop.Export-Tests.csproj(35,5): error MSB3073: The command ""/Users/jon/android-toolchain/jdk-1.8/bin/javac" -classpath …" exited with code 1.
…/tests/Java.Interop-Tests/Java.Interop-Tests.csproj(60,5): error MSB3073: The command ""/Users/jon/android-toolchain/jdk-1.8/bin/javac" -source 1.8 -target 1.8 -bootclasspath …" exited with code 1.
…/tests/Java.Interop-Tests/Java.Interop-Tests.csproj(60,5): error MSB3073: The command ""/Users/jon/android-toolchain/jdk-1.8/bin/javac" -source 1.8 -target 1.8 -bootclasspath …" exited with code 1.
Using `dotnet build -m:1` avoids the above MSB3073 errors; see also
commit 1de5501, which added `-m:1` to CI builds.
Fix these parallel build issues so that `-m:1` isn't needed. This is
principally done by removing `Java.Interop.BootstrapTasks.csproj`
from `Java.Interop.sln`, and adding it to a new
`Java.Interop.BootstrapTasks.sln` solution. The `Prepare` target is
updated to explicitly Restore and Build the new
`Java.Interop.BootstrapTasks.dll` solution.
Note that the Restore and Build target invocations must be separate;
using [`Targets="Restore;Build"` will not work][0].
Update `Java.Interop.BootstrapTasks.csproj` to *no longer* `<Import/>`
`VersionInfo.targets`, as this causes a circular dependency
(`VersionInfo.targets` uses tasks from
`Java.Interop.BootstrapTasks.dll`). This is fine, as
`Java.Interop.BootstrapTasks.dll` doesn't need to be versioned.
Review our custom `.targets` files, and replace
`BeforeTargets="BeforeBuild"` with `BeforeTargets="Build"` or
`BeforeTargets="BeforeCompile"` (as appropriate).
Building before the `BeforeBuild` target is problematic, as the
`BeforeBuild` target runs before `@(ProjectReference)`d projects are
built, meaning dependencies may not exist. (Oops.)
TODO: Instead of having two `.sln` files, try to instead use
`<UsingTask/>` with `AssemblyFile` and `TasFactory` set, as done in
[rainersigwald/build-task-in-solution-demo][1] and the
[`InvokeCustomTaskDemo` target][2]. This *may* avoid the need for
a separate `.sln` (and `Prepare` target invocation?).
[0]: dotnet/msbuild#2811 (comment)
[1]: https://github.com/rainersigwald/build-task-in-solution-demo
[2]: https://github.com/rainersigwald/build-task-in-solution-demo/blob/17508937bb9edb0b817820146f85adf0da331515/Task/DemoFunctionality.targets#L4-L101 parent 13def0e commit 88d6093
File tree
8 files changed
+41
-17
lines changed- build-tools
- Java.Interop.BootstrapTasks
- automation/templates
- scripts
- tests
- Java.Interop-Tests
- Java.Interop.Export-Tests
- Xamarin.Android.Tools.Bytecode-Tests
8 files changed
+41
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 243 | | |
250 | 244 | | |
251 | 245 | | |
| |||
338 | 332 | | |
339 | 333 | | |
340 | 334 | | |
341 | | - | |
342 | 335 | | |
343 | 336 | | |
344 | 337 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments