-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[workload] dotnet workload --info shows WorkloadDependencies.json
#52329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0.2xx
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the dotnet workload --info command to display workload dependencies from WorkloadDependencies.json files located alongside workload manifests. This provides users with detailed information about external dependencies (JDK, Android SDK, Xcode, etc.) required by installed workloads.
Key Changes
- Added JSON parsing logic to read and display WorkloadDependencies.json contents for each installed workload
- Added localized resource strings for dependency display (Version, Recommended Version, optional marker)
- Added comprehensive test coverage for the new dependency display functionality
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Cli/dotnet/Commands/Workload/WorkloadCommandDefinition.cs | Implements new methods to parse and display WorkloadDependencies.json, including PrintWorkloadDependencies, PrintDependencyCategory, PrintItemInfo, and platform-specific ID resolution |
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Adds four new localizable string resources for dependency information display |
| src/Cli/dotnet/Commands/xlf/*.xlf | Updates all 13 localization files with new string resources marked as "new" state pending translation |
| test/dotnet.Tests/CommandTests/Workload/Install/GivenDotnetWorkloadInstall.cs | Adds comprehensive test for dependency display functionality with MockWorkloadInstallRecordRepository |
| test/TestAssets/TestProjects/SampleManifest/WorkloadDependencies.json | Adds test fixture JSON file demonstrating various dependency types (JDK, Android SDK packages, Appium drivers) with optional flags and platform-specific IDs |
b77e4ed to
45736ec
Compare
Given the files:
C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.2\WorkloadDependencies.json
C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.1.10494\WorkloadDependencies.json
C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.0\WorkloadDependencies.json
This now prints out the information we have available:
> D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\dotnet.exe workload --info
Workload version: 10.0.200-manifests.f8cdff57
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
[android]
Installation Source: SDK 10.0.200, VS 18.0.11222.15, VS 17.14.36811.4
Manifest Version: 36.1.2/10.0.200
Manifest Path: D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\10.0.200\microsoft.net.sdk.android\36.1.2\WorkloadManifest.json
Install Type: FileBased
Dependencies (jdk):
Version: [17.0,22.0)
Recommended Version: 17.0.14
Dependencies (androidsdk):
- Android SDK Build-Tools 35
build-tools;35.0.0
- Android SDK Command-line Tools
cmdline-tools;13.0
- Android Emulator (optional)
emulator
Recommended Version: 35.1.20
- NDK (Side by side) 27.1.12297006 (optional)
ndk;27.1.12297006
- Android SDK Platform 35
platforms;android-35
- Android SDK Platform 36.1 (Preview) (optional)
platforms;android-36.1
- Android SDK Platform-Tools
platform-tools
Recommended Version: 35.0.2
- Google APIs ARM 64 v8a System Image (optional)
system-images;android-35;google_apis;x86_64
[maccatalyst]
Installation Source: VS 18.0.11222.15, VS 17.14.36811.4
Manifest Version: 26.1.10494/10.0.100
Manifest Path: D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.1.10494\WorkloadManifest.json
Install Type: FileBased
Dependencies (xcode):
Version: [26.1,)
Recommended Version: 26.1
Dependencies (sdk):
Version: 26.1
[ios]
Installation Source: VS 18.0.11222.15, VS 17.14.36811.4
Manifest Version: 26.1.10494/10.0.100
Manifest Path: D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.1.10494\WorkloadManifest.json
Install Type: FileBased
Dependencies (xcode):
Version: [26.1,)
Recommended Version: 26.1
Dependencies (sdk):
Version: 26.1
[maui-windows]
Installation Source: VS 18.0.11222.15, VS 17.14.36811.4
Manifest Version: 10.0.0/10.0.100
Manifest Path: D:\src\dotnet\sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.0\WorkloadManifest.json
Install Type: FileBased
Dependencies (windowsAppSdk):
Version: [1.7.250909003,)
Recommended Version: 1.7.250909003
Dependencies (windowsSdkBuildTools):
Version: [10.0.22621.756,)
Recommended Version: 10.0.22621.756
Dependencies (win2d):
Version: [1.3.2,)
Recommended Version: 1.3.2
Dependencies (webview2):
Version: [1.0.3179.45,)
Recommended Version: 1.0.3179.45
Dependencies (appium):
Version: [2.17.1,)
Recommended Version: 2.17.1
- windows
Version: [3.1.1,)
Recommended Version: 3.1.1
- xcuitest
Version: [7.32.0,)
Recommended Version: 7.32.0
- mac2
Version: [1.20.3,)
Recommended Version: 1.20.3
- uiautomator2
Version: [4.2.1,)
Recommended Version: 4.2.1
The output could be further improved, if we added `desc` elements in
`WorkloadDependencies.json` for each dependency, we could print those
out as well.
45736ec to
7de33d0
Compare
This better matches the existing text
Given the files:
This now prints out the information we have available:
The output could be further improved, if we added
descelements inWorkloadDependencies.jsonfor each dependency, we could print those out as well.