Commit 944f88a
authored
[build] Fix issues preventing parallel builds (dotnet#7068)
Changes: dotnet/java-interop@d0ef9e3...51c3dae
* dotnet/java-interop@51c3dae7: [Java.Interop-MonoAndroid.csproj] Add jnienv-gen ProjectReference (dotnet#990)
Remove all instances of `dotnet build -m:1` from the build system,
and fix all issues which prevent it from appearing to work.
(Testing was via 4 consecutive CI builds without errors. This does
not mean it's a complete fix, but it seems good enough to merge.)
Fixes include:
Using `build-tools/create-android-api` (9987069) to build
`JNIEnv.g.cs` only once, instead of once per
`$(TargetFrameworkVersion)`. This prevents sharing violations when
multiple `Mono.Android.csproj` builds attempt to create it
simultaneously:
System.IO.IOException: The process cannot access the file 'C:\a\_work\1\s\src\Mono.Android\Android.Runtime\JNIEnv.g.cs' because it is being used by another process.
*Serialize* gradlew-using project references, such that `r8.csproj`
has a `@(ProjectReference)` to `manifestmerger.csproj`, and
`manifestmerger.csproj` has a `@(ProjectReference)` to
`apksigner.csproj`. `gradlew` execution can time out when multiple
`gradlew` instances are run concurrently, even if
`gradlew --no-daemon` is used. Serializing these project references
avoids the errors:
org.gradle.launcher.daemon.client.DaemonConnectionException: Timeout waiting to connect to the Gradle daemon.
The file lock is held by a different Gradle process.
Add a `@(ProjectReference)` on `Microsoft.Android.Sdk.ILLink.csproj` to
`Xamarin.Android.Build.Tasks.csproj`, so that
`Xamarin.Android.Build.Tasks\obj\$(Configuration)\Profile.g.cs` is
available for compilation. Fixes:
CSC error CS2001: Source file 'C:\code\xamarin-android\src\Microsoft.Android.Sdk.ILLink\..\Xamarin.Android.Build.Tasks\obj\Debug\Profile.g.cs' could not be found.
Commit dotnet/java-interop@51c3dae7, which adds a
`@(ProjectReference)` on `Java.Interop-MonoAndroid.csproj` to
`jnienv-gen.csproj`, which ensures that `jnienv-gen.exe` exists when
`Java.Interop-MonoAndroid.csproj` is built. Fix errors such as:
'"C:\a\_work\1\s\external\Java.Interop\bin\BuildRelease\jnienv-gen.exe"' is not recognized as an internal or external command, operable program or batch file.
or
…/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop.targets(19,5):
error MSB3073: The command "mono "…/xamarin-android/external/Java.Interop/bin/BuildDebug/jnienv-gen.exe" Java.Interop/JniEnvironment.g.cs obj/Debug/jni.c" exited with code 2.
[…/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop-MonoAndroid.csproj]1 parent 8259f6d commit 944f88a
File tree
10 files changed
+34
-18
lines changed- build-tools
- automation
- create-android-api
- scripts
- external
- src
- Microsoft.Android.Sdk.ILLink
- Mono.Android
- manifestmerger
- r8
10 files changed
+34
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
120 | 132 | | |
121 | 133 | | |
122 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
Submodule Java.Interop updated from d0ef9e3 to 51c3dae
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 33 | | |
37 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 124 | | |
135 | 125 | | |
136 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
0 commit comments