Skip to content

Commit e072125

Browse files
committed
Adding bump command even for non-versioned products.
1 parent c04f45a commit e072125

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/PostSharp.Engineering.BuildTools/AppExtensions.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ internal static void AddCommands( this CommandApp app, Product product )
9191
.WithDescription( "Swaps deployment slots" );
9292
}
9393

94-
if ( product.DependencyDefinition.IsVersioned )
95-
{
96-
root.AddCommand<BumpCommand>( "bump" )
97-
.WithData( data )
98-
.WithDescription( "Bumps the version of this product" );
99-
}
94+
// We add the bump command even for non-versioned products because it makes
95+
// orchestration of bumping all products easier.
96+
root.AddCommand<BumpCommand>( "bump" )
97+
.WithData( data )
98+
.WithDescription( "Bumps the version of this product" );
10099

101100
root.AddCommand<GenerateThirdPartyNoticesCommand>( "third-party-notices" )
102101
.WithData( data )

src/PostSharp.Engineering.BuildTools/Build/Bumping/BumpCommand.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ internal class BumpCommand : BaseCommand<BumpSettings>
1717
{
1818
protected override bool ExecuteCore( BuildContext context, BumpSettings settings ) => Execute( context, settings );
1919

20-
public static bool Execute( BuildContext context, BumpSettings settings )
20+
private static bool Execute( BuildContext context, BumpSettings settings )
2121
{
2222
var product = context.Product;
2323
var console = context.Console;
24+
25+
if ( !product.DependencyDefinition.IsVersioned )
26+
{
27+
console.WriteWarning( "Ignoring the version bumping because this product is not versioned." );
28+
29+
return true;
30+
}
31+
2432
console.WriteHeading( $"Bumping the '{product.ProductName}' version" );
2533

2634
var developmentBranch = product.DependencyDefinition.Branch;

0 commit comments

Comments
 (0)