From 2ab04573b0669871bc78d493ea044026cdac1d9c Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 29 Jun 2022 10:30:57 -0400 Subject: [PATCH] [apksigner] Serialize gradlew: depend on java-source-utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Context: 944f88a8b6f1c30eaf43f56cfbebf0f8cd7a547f Commit 944f88a8 enabled parallel builds by removing `dotnet build -m:1` usage, which allows for faster incremental builds. One of the problems encountered was around `gradlew` usage: `gradlew` doesn't support multiple concurrent executions, and will *block* waiting for other `gradlew` builds to complete, which can result in timeouts and failed builds. Commit 944f88a8 fixed this by "serializing" all projects which involve `gradlew`: * `r8.csproj` is the "entrypoint" * `r8.csproj` references `manifestmerger.csproj` * `manifestmerger.csproj` references `apksigner.csproj` This arrangement would cause `dotnet build` to sequentially build `r8.csproj`, `manifestmerger.csproj`, and `apksigner.csproj`, ensuring that only one `gradlew` command was run at a time. Unfortunately, we overlooked `external/Java.Interop/tools/java-source-utils/java-source-utils.csproj`. Thus, we occasionally see the Windows build fail: Timeout waiting to connect to the Gradle daemon. … …/java-source-utils.targets(10,5): error MSB3073: The command ""C:\a\_work\1\s\external\Java.Interop\build-tools\gradle\gradlew" …" exited with code 1. Update `apksigner.csproj` to reference `java-source-utils.csproj`, extending the "sequential order" of `gradlew`-using projects. This should make the Windows build more reliable. Additionally, move the ``s out of `apksigner.csproj` and into `apksigner.targets`. This is more consistent with other projects, and reduces the likelihood of VSMac rewriting (and removing the formatting of) `apksigner.csproj`. --- src/Mono.Android/Mono.Android.csproj | 1 - src/apksigner/apksigner.csproj | 24 ++++++------------------ src/apksigner/apksigner.targets | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 src/apksigner/apksigner.targets diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index c4150010091..8cc95be552f 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -375,7 +375,6 @@ - diff --git a/src/apksigner/apksigner.csproj b/src/apksigner/apksigner.csproj index 7807152e355..5860e929093 100644 --- a/src/apksigner/apksigner.csproj +++ b/src/apksigner/apksigner.csproj @@ -16,23 +16,11 @@ - - - - + + + + - - - + diff --git a/src/apksigner/apksigner.targets b/src/apksigner/apksigner.targets new file mode 100644 index 00000000000..b6459821136 --- /dev/null +++ b/src/apksigner/apksigner.targets @@ -0,0 +1,23 @@ + + + + + + + + + + + +