Skip to content

Commit 8261c81

Browse files
authored
build: fix/speed-up build graph dependencies (#924)
When building the entire solution, we need to ensure the various "Installer.<OS>" and "Packaging.<OS>" projects are not built at the same time as other projects, especially on Windows, where we may hit file locking problems. The installer projects call a build script internally that calls a `dotnet publish` on various projects. By making the installer projects reference (but not consume) the dependent projects we ensure MSBuild won't build them until the end, and prevent file access errors. At the same time, we can probably remove the "-m:1" flags that tell MSBuild to only build one project at a time.
2 parents d4f031f + 990b647 commit 8261c81

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

src/linux/Packaging.Linux/Packaging.Linux.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
<ItemGroup>
1919
<ProjectReference Include="../../shared/Git-Credential-Manager/Git-Credential-Manager.csproj" ReferenceOutputAssembly="false" />
20+
<ProjectReference Include="../../shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
21+
<ProjectReference Include="../../shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
22+
<ProjectReference Include="../../shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
23+
<ProjectReference Include="../../shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
2024
</ItemGroup>
2125

2226
<!-- Implicit SDK targets import (so we can override the default targets below) -->

src/osx/Installer.Mac/Installer.Mac.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
<ItemGroup>
1515
<ProjectReference Include="../../shared/Git-Credential-Manager/Git-Credential-Manager.csproj" ReferenceOutputAssembly="false" />
16-
<ProjectReference Include="../../shared/Atlassian.Bitbucket.UI/Atlassian.Bitbucket.UI.csproj" ReferenceOutputAssembly="false" />
17-
<ProjectReference Include="../../shared/GitHub.UI/GitHub.UI.csproj" ReferenceOutputAssembly="false" />
16+
<ProjectReference Include="../../shared/Atlassian.Bitbucket.UI.Avalonia/Atlassian.Bitbucket.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
17+
<ProjectReference Include="../../shared/GitHub.UI.Avalonia/GitHub.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
18+
<ProjectReference Include="../../shared/GitLab.UI.Avalonia/GitLab.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
19+
<ProjectReference Include="../../shared/Core.UI.Avalonia/Core.UI.Avalonia.csproj" ReferenceOutputAssembly="false" />
1820
</ItemGroup>
1921

2022
<!-- Implicit SDK targets import (so we can override the default targets below) -->

src/osx/Installer.Mac/layout.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ cp "$INSTALLER_SRC/uninstall.sh" "$PAYLOAD" || exit 1
9797
# Publish core application executables
9898
echo "Publishing core application..."
9999
dotnet publish "$GCM_SRC" \
100-
--no-restore \
101-
-m:1 \
102100
--configuration="$CONFIGURATION" \
103101
--framework="$FRAMEWORK" \
104102
--runtime="$RUNTIME" \
@@ -107,8 +105,6 @@ dotnet publish "$GCM_SRC" \
107105

108106
echo "Publishing core UI helper..."
109107
dotnet publish "$GCM_UI_SRC" \
110-
--no-restore \
111-
-m:1 \
112108
--configuration="$CONFIGURATION" \
113109
--framework="$FRAMEWORK" \
114110
--runtime="$RUNTIME" \
@@ -117,8 +113,6 @@ dotnet publish "$GCM_UI_SRC" \
117113

118114
echo "Publishing Bitbucket UI helper..."
119115
dotnet publish "$BITBUCKET_UI_SRC" \
120-
--no-restore \
121-
-m:1 \
122116
--configuration="$CONFIGURATION" \
123117
--framework="$FRAMEWORK" \
124118
--runtime="$RUNTIME" \
@@ -127,8 +121,6 @@ dotnet publish "$BITBUCKET_UI_SRC" \
127121

128122
echo "Publishing GitHub UI helper..."
129123
dotnet publish "$GITHUB_UI_SRC" \
130-
--no-restore \
131-
-m:1 \
132124
--configuration="$CONFIGURATION" \
133125
--framework="$FRAMEWORK" \
134126
--runtime="$RUNTIME" \
@@ -137,8 +129,6 @@ dotnet publish "$GITHUB_UI_SRC" \
137129

138130
echo "Publishing GitLab UI helper..."
139131
dotnet publish "$GITLAB_UI_SRC" \
140-
--no-restore \
141-
-m:1 \
142132
--configuration="$CONFIGURATION" \
143133
--framework="$FRAMEWORK" \
144134
--runtime="$RUNTIME" \

src/windows/Installer.Windows/Installer.Windows.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
<PayloadPath>$(PlatformOutPath)Installer.Windows\bin\$(Configuration)\net472\win-x86</PayloadPath>
1010
</PropertyGroup>
1111

12+
<ItemGroup>
13+
<ProjectReference Include="../../shared/Git-Credential-Manager/Git-Credential-Manager.csproj" ReferenceOutputAssembly="false" />
14+
<ProjectReference Include="../Atlassian.Bitbucket.UI.Windows/Atlassian.Bitbucket.UI.Windows.csproj" ReferenceOutputAssembly="false" />
15+
<ProjectReference Include="../GitHub.UI.Windows/GitHub.UI.Windows.csproj" ReferenceOutputAssembly="false" />
16+
<ProjectReference Include="../GitLab.UI.Windows/GitLab.UI.Windows.csproj" ReferenceOutputAssembly="false" />
17+
<ProjectReference Include="../Core.UI.Windows/Core.UI.Windows.csproj" ReferenceOutputAssembly="false" />
18+
</ItemGroup>
19+
1220
<ItemGroup>
1321
<None Include="Setup.iss" />
1422
</ItemGroup>

src/windows/Installer.Windows/layout.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mkdir -p "$PAYLOAD","$SYMBOLS"
4141
# Publish core application executables
4242
Write-Output "Publishing core application..."
4343
dotnet publish "$GCM_SRC" `
44-
--framework net472 `
44+
--framework net472 `
4545
--configuration "$CONFIGURATION" `
4646
--runtime win-x86 `
4747
--output "$PAYLOAD"

0 commit comments

Comments
 (0)