Skip to content

Commit 45dd0ed

Browse files
authored
[build] Use arcade dependency management (dotnet#729)
1 parent 032a50d commit 45dd0ed

16 files changed

+103
-25
lines changed

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
]
2222
}
2323
}
24-
}
24+
}

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
2-
<Import Project="eng\Version.props" />
2+
<Import Project="eng\Versions.props" />
33
<PropertyGroup>
44
<BuildForWinUI Condition="'$(SolutionFileName)' == 'Microsoft.Maui.WinUI.sln'">true</BuildForWinUI>
55
<BuildForNet6 Condition="'$(SolutionFileName)' == 'Microsoft.Maui-net6.sln' or '$(BuildForWinUI)' == 'true'">true</BuildForNet6>
@@ -35,7 +35,7 @@
3535
<PackageVersion>0.0.1-alpha1</PackageVersion>
3636
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
3737
</PropertyGroup>
38-
<!-- This target is replaced by GitInfo when restored. Allows Version.targets to rely on it before restore. -->
38+
<!-- This target is replaced by GitInfo when restored. Allows Versions.targets to rely on it before restore. -->
3939
<Target Name="GitVersion" />
4040
<Target Name="GitInfo" />
4141
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="$(MSBuildThisFileDirectory)eng\Environment.Build.props" />

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<Import Condition="'$(SampleProject)' != 'true' and '$(CI)' == 'true'" Project="eng\Git.Build.targets" />
3-
<Import Condition="'$(SampleProject)' != 'true' and '$(CI)' == 'true' " Project="eng\Version.targets" />
3+
<Import Condition="'$(SampleProject)' != 'true' and '$(CI)' == 'true' " Project="eng\Versions.targets" />
44
<Import Project="eng\AndroidX.targets" />
55
<Import Project="eng\Microsoft.Extensions.targets" />
66
</Project>

NuGet.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<clear />
@@ -10,4 +10,5 @@
1010
<activePackageSource>
1111
<add key="All" value="(Aggregate source)" />
1212
</activePackageSource>
13+
<disabledPackageSources />
1314
</configuration>

eng/README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
The `eng` folder contains and is used by parts of the https://github.com/dotnet/arcade SDK.
2+
3+
## Dependency Management
4+
The Arcade SDK contains a tool known as [`darc`][0], which can be used to manage
5+
and query the relationships between repositories in the dotnet ecosystem.
6+
7+
The `eng/Version.Details.xml` and `eng/Versions.props` files contain information
8+
about the products and tooling that this repository depends on.
9+
10+
Many dotnet repositories use a publishing workflow that will push build artifact data
11+
to a central location known as the "Build Asset Registry". This data includes
12+
a "channel" association, which is used to determine when an update for a particular
13+
product or tool is available. Local updates and automatic update "subscriptions"
14+
compare the version files in the repository against the versions avalable in the
15+
channel that you are interested in. The `darc` tool is used facilitate these updates.
16+
17+
To work with `darc` locally, see the [setting up your darc client docs][1].
18+
You'll need to run a script in the dotnet/arcade repo to install the dotnet global
19+
tool, join the `arcade-contrib` GitHub team, and run the [`darc authenticate`][2]
20+
command to add the PATs required by the tool.
21+
22+
The GitHub PAT that you add must have the full `repo` scope enabled if you want to
23+
work with any of the `subcription` commands. Subscriptions control the automated
24+
creation of dependency update pull requests.
25+
26+
27+
To add a new dependency, run the [`darc add-dependency`][3] command at the root
28+
of the repository:
29+
```
30+
darc add-dependency -n Microsoft.Dotnet.Sdk.Internal -t product -v 6.0.0-preview.2.21154.6 -r https://github.com/dotnet/installer
31+
```
32+
33+
To update all dependencies, use the [`darc update-dependencies`][4] command:
34+
```
35+
darc update-dependencies --channel ".NET 6"
36+
```
37+
38+
To configure automatic updates, use the [`darc add-subscription`][5] command
39+
to enroll a target repo/branch into updates from a particular channel:
40+
```
41+
darc add-subscription --channel ".NET 6" --source-repo https://github.com/dotnet/installer --target-repo https://github.com/dotnet/maui --target-branch main --update-frequency everyWeek --standard-automerge
42+
```
43+
44+
Once a subscription is configured, pull requests will be created automatically
45+
by the dotnet Maestro bot whenever dependency updates are available.
46+
47+
Subscriptions need to be manually managed at this time. For example, when a
48+
release branch is created, someone with `darc` installed locally will need to
49+
run the `add-subscription` command to configure updates against that new branch.
50+
51+
52+
[0]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md
53+
[1]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md#setting-up-your-darc-client
54+
[2]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md#authenticate
55+
[3]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md#add-dependency
56+
[4]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md#update-dependencies
57+
[5]: https://github.com/dotnet/arcade/blob/ea609b8e036359934332480de9336d98fcbb3f91/Documentation/Darc.md#add-subscription

eng/Version.Details.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Dependencies>
2+
<ProductDependencies>
3+
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-preview.3.21202.5" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
4+
<Uri>https://github.com/dotnet/installer</Uri>
5+
<Sha>aee38a6dd446b512b1ae510d80d2ed1c1f24e79a</Sha>
6+
</Dependency>
7+
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="11.0.200-preview.3.196">
8+
<Uri>https://github.com/xamarin/xamarin-android</Uri>
9+
<Sha />
10+
</Dependency>
11+
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="14.3.100-preview.3.471">
12+
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
13+
<Sha />
14+
</Dependency>
15+
<Dependency Name="Microsoft.iOS.Sdk" Version="14.4.100-preview.3.1326">
16+
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
17+
<Sha />
18+
</Dependency>
19+
</ProductDependencies>
20+
</Dependencies>
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project>
22
<!--Package versions-->
33
<PropertyGroup>
4-
<MicrosoftNETSdkPackageVersion>6.0.100-preview.3.21202.5</MicrosoftNETSdkPackageVersion>
5-
<MicrosoftAndroidSdkPackageVersion>11.0.200-preview.3.196</MicrosoftAndroidSdkPackageVersion>
4+
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-preview.3.21202.5</MicrosoftDotnetSdkInternalPackageVersion>
5+
<MicrosoftAndroidSdkWindowsPackageVersion>11.0.200-preview.3.196</MicrosoftAndroidSdkWindowsPackageVersion>
66
<MicrosoftMacCatalystSdkPackageVersion>14.3.100-preview.3.471</MicrosoftMacCatalystSdkPackageVersion>
77
<MicrosoftiOSSdkPackageVersion>14.4.100-preview.3.1326</MicrosoftiOSSdkPackageVersion>
88
</PropertyGroup>
9-
</Project>
9+
</Project>
File renamed without changes.

eng/dogfood.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ if (-Not $sln) {
5757

5858
# Modify global.json, so the IDE can load
5959
$globaljson = Join-Path $PSScriptRoot ../global.json
60-
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Version.props)
60+
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Versions.props)
6161
$json = Get-Content $globaljson | ConvertFrom-Json
6262
$json | Add-Member sdk (New-Object -TypeName PSObject) -Force
63-
$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftNETSdkPackageVersion -Force
63+
$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftDotnetSdkInternalPackageVersion -Force
6464
$json | ConvertTo-Json | Set-Content $globaljson
6565

6666
# NOTE: I've not found a better way to do this

eng/package.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ if ($IsWindows)
1414
{
1515
# Modify global.json, so the IDE can load
1616
$globaljson = Join-Path $PSScriptRoot ../global.json
17-
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Version.props)
17+
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Versions.props)
1818
$json = Get-Content $globaljson | ConvertFrom-Json
1919
$json | Add-Member sdk (New-Object -TypeName PSObject) -Force
20-
$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftNETSdkPackageVersion -Force
20+
$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftDotnetSdkInternalPackageVersion -Force
2121
$json | ConvertTo-Json | Set-Content $globaljson
2222

2323
# NOTE: I've not found a better way to do this

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"MSBuild.Sdk.Extras": "3.0.23",
44
"Microsoft.Build.NoTargets": "2.0.1"
55
}
6-
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Project>
2-
<Import Project="../../../eng/Version.props" />
2+
<Import Project="../../../eng/Versions.props" />
33
</Project>

src/DotNet/Dependencies/Packs.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
7-
<PackageDownload Include="Microsoft.Android.Sdk.Windows" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
8-
<PackageDownload Include="Microsoft.Android.Sdk.Darwin" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
9-
<PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
6+
<PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
7+
<PackageDownload Include="Microsoft.Android.Sdk.Windows" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
8+
<PackageDownload Include="Microsoft.Android.Sdk.Darwin" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
9+
<PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
1010
<PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
1111
<PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
1212
<PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" />

src/DotNet/Dependencies/Workloads.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
6+
<PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
77
<PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
88
<PackageDownload Include="Microsoft.NET.Workload.iOS" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
99
</ItemGroup>

src/DotNet/DotNet.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
<DotNetDirectory>$(MauiOutputPath)dotnet/</DotNetDirectory>
77
<DotNetToolPath>$(DotNetDirectory)dotnet</DotNetToolPath>
88
<DotNetPacksDirectory>$(DotNetDirectory)packs/</DotNetPacksDirectory>
9-
<DotNetSdkManifestsDirectory>$(DotNetDirectory)sdk-manifests/$(MicrosoftNETSdkPackageVersion.Split('-')[0])/</DotNetSdkManifestsDirectory>
10-
<DotNetSentinelPath>$(DotNetDirectory)sdk/$(MicrosoftNETSdkPackageVersion)/EnableWorkloadResolver.sentinel</DotNetSentinelPath>
9+
<DotNetSdkManifestsDirectory>$(DotNetDirectory)sdk-manifests/$(MicrosoftDotnetSdkInternalPackageVersion.Split('-')[0])/</DotNetSdkManifestsDirectory>
10+
<DotNetSentinelPath>$(DotNetDirectory)sdk/$(MicrosoftDotnetSdkInternalPackageVersion)/EnableWorkloadResolver.sentinel</DotNetSentinelPath>
1111
</PropertyGroup>
1212
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
1313
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.ps1</DotNetInstallScriptUrl>
1414
<DotNetInstallScriptName>dotnet-install.ps1</DotNetInstallScriptName>
1515
<DotNetInstallScriptPath>$(MauiOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
16-
<DotNetInstallCommand>&amp; '$(DotNetInstallScriptPath)' -Version $(MicrosoftNETSdkPackageVersion) -InstallDir '$(DotNetDirectory)' -Verbose</DotNetInstallCommand>
16+
<DotNetInstallCommand>&amp; '$(DotNetInstallScriptPath)' -Version $(MicrosoftDotnetSdkInternalPackageVersion) -InstallDir '$(DotNetDirectory)' -Verbose</DotNetInstallCommand>
1717
<DotNetInstallCommand>powershell -Command &quot;$(DotNetInstallCommand)&quot;</DotNetInstallCommand>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('osx'))">
2020
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.sh</DotNetInstallScriptUrl>
2121
<DotNetInstallScriptName>dotnet-install.sh</DotNetInstallScriptName>
2222
<DotNetInstallScriptPath>$(MauiOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
23-
<DotNetInstallCommand>sh '$(DotNetInstallScriptPath)' --version $(MicrosoftNETSdkPackageVersion) --install-dir '$(DotNetDirectory)' --verbose</DotNetInstallCommand>
23+
<DotNetInstallCommand>sh '$(DotNetInstallScriptPath)' --version $(MicrosoftDotnetSdkInternalPackageVersion) --install-dir '$(DotNetDirectory)' --verbose</DotNetInstallCommand>
2424
</PropertyGroup>
2525

2626
<PropertyGroup>
@@ -38,7 +38,7 @@
3838
<!-- These files should invalidate ./bin/dotnet completely -->
3939
<_Inputs>
4040
$(MSBuildThisFile);
41-
../../eng/Version.props;
41+
../../eng/Versions.props;
4242
</_Inputs>
4343
</PropertyGroup>
4444

src/Templates/src/Microsoft.Maui.Templates.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<Compile Remove="**/*" />
2323
</ItemGroup>
2424

25-
<!-- Eventually replaced by eng/Version.targets -->
25+
<!-- Eventually replaced by eng/Versions.targets -->
2626
<Target Name="SetVersions" />
2727

2828
<Target Name="_GenerateTemplateFile"

0 commit comments

Comments
 (0)