@@ -2391,35 +2391,37 @@ public static void DotNetAddPackage(this ICakeContext context, string packageNam
2391
2391
/// Lists the package references for a project or solution.
2392
2392
/// </summary>
2393
2393
/// <param name="context">The context.</param>
2394
+ /// <returns>The the package references.</returns>
2394
2395
/// <example>
2395
2396
/// <code>
2396
- /// DotNetListPackage();
2397
+ /// DotNetPackageList output = DotNetListPackage();
2397
2398
/// </code>
2398
2399
/// </example>
2399
2400
[ CakeMethodAlias ]
2400
2401
[ CakeAliasCategory ( "Package" ) ]
2401
2402
[ CakeNamespaceImport ( "Cake.Common.Tools.DotNet.Package.List" ) ]
2402
- public static void DotNetListPackage ( this ICakeContext context )
2403
+ public static DotNetPackageList DotNetListPackage ( this ICakeContext context )
2403
2404
{
2404
- context . DotNetListPackage ( null ) ;
2405
+ return context . DotNetListPackage ( null ) ;
2405
2406
}
2406
2407
2407
2408
/// <summary>
2408
2409
/// Lists the package references for a project or solution.
2409
2410
/// </summary>
2410
2411
/// <param name="context">The context.</param>
2411
2412
/// <param name="project">The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown.</param>
2413
+ /// <returns>The the package references.</returns>
2412
2414
/// <example>
2413
2415
/// <code>
2414
- /// DotNetListPackage("./src/MyProject/MyProject.csproj");
2416
+ /// DotNetPackageList output = DotNetListPackage("./src/MyProject/MyProject.csproj");
2415
2417
/// </code>
2416
2418
/// </example>
2417
2419
[ CakeMethodAlias ]
2418
2420
[ CakeAliasCategory ( "Package" ) ]
2419
2421
[ CakeNamespaceImport ( "Cake.Common.Tools.DotNet.Package.List" ) ]
2420
- public static void DotNetListPackage ( this ICakeContext context , string project )
2422
+ public static DotNetPackageList DotNetListPackage ( this ICakeContext context , string project )
2421
2423
{
2422
- context . DotNetListPackage ( project , null ) ;
2424
+ return context . DotNetListPackage ( project , null ) ;
2423
2425
}
2424
2426
2425
2427
/// <summary>
@@ -2428,6 +2430,7 @@ public static void DotNetListPackage(this ICakeContext context, string project)
2428
2430
/// <param name="context">The context.</param>
2429
2431
/// <param name="project">The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown.</param>
2430
2432
/// <param name="settings">The settings.</param>
2433
+ /// <returns>The the package references.</returns>
2431
2434
/// <example>
2432
2435
/// <code>
2433
2436
/// var settings = new DotNetPackageListSettings
@@ -2436,13 +2439,13 @@ public static void DotNetListPackage(this ICakeContext context, string project)
2436
2439
/// Format = DotNetPackageListFormat.Json
2437
2440
/// };
2438
2441
///
2439
- /// DotNetListPackage("./src/MyProject/MyProject.csproj", settings);
2442
+ /// DotNetPackageList output = DotNetListPackage("./src/MyProject/MyProject.csproj", settings);
2440
2443
/// </code>
2441
2444
/// </example>
2442
2445
[ CakeMethodAlias ]
2443
2446
[ CakeAliasCategory ( "Package" ) ]
2444
2447
[ CakeNamespaceImport ( "Cake.Common.Tools.DotNet.Package.List" ) ]
2445
- public static void DotNetListPackage ( this ICakeContext context , string project , DotNetPackageListSettings settings )
2448
+ public static DotNetPackageList DotNetListPackage ( this ICakeContext context , string project , DotNetPackageListSettings settings )
2446
2449
{
2447
2450
if ( context is null )
2448
2451
{
@@ -2454,8 +2457,8 @@ public static void DotNetListPackage(this ICakeContext context, string project,
2454
2457
settings = new DotNetPackageListSettings ( ) ;
2455
2458
}
2456
2459
2457
- var adder = new DotNetPackageLister ( context . FileSystem , context . Environment , context . ProcessRunner , context . Tools ) ;
2458
- adder . List ( project , settings ) ;
2460
+ var lister = new DotNetPackageLister ( context . FileSystem , context . Environment , context . ProcessRunner , context . Tools ) ;
2461
+ return lister . List ( project , settings ) ;
2459
2462
}
2460
2463
}
2461
2464
}
0 commit comments