@@ -15,29 +15,31 @@ namespace EnumerableAsyncProcessor.Pipeline.Modules;
1515[ DependsOn < RunUnitTestsModule > ]
1616public class PackProjectsModule : Module < List < CommandResult > >
1717{
18- protected override async Task < List < CommandResult > ? > ExecuteAsync ( IPipelineContext context , CancellationToken cancellationToken )
18+ protected override async Task < List < CommandResult > ? > ExecuteAsync ( IModuleContext context , CancellationToken cancellationToken )
1919 {
2020 var results = new List < CommandResult > ( ) ;
21- var packageVersion = await GetModule < NugetVersionGeneratorModule > ( ) ;
22- var projectFiles = context . Git ( ) . RootDirectory ! . GetFiles ( f => GetProjectsPredicate ( f , context ) ) ;
21+ var packageVersion = await context . GetModule < NugetVersionGeneratorModule > ( ) ;
22+ var projectFiles = context . Git ( ) . RootDirectory . GetFiles ( f => GetProjectsPredicate ( f , context ) ) ;
23+
2324 foreach ( var projectFile in projectFiles )
2425 {
25- results . Add ( await context . DotNet ( ) . Pack ( new DotNetPackOptions {
26- ProjectSolution = projectFile . Path ,
27- Configuration = Configuration . Release ,
26+ results . Add ( await context . DotNet ( ) . Pack ( new DotNetPackOptions
27+ {
28+ ProjectSolution = projectFile . Path ,
29+ Configuration = "Release" ,
2830 Properties =
2931 [
30- ( "PackageVersion" , packageVersion . Value ) ! ,
31- ( "Version" , packageVersion . Value ) !
32+ ( "PackageVersion" , packageVersion . ValueOrDefault ) ! ,
33+ ( "Version" , packageVersion . ValueOrDefault ) !
3234 ] ,
3335 IncludeSource = true
34- } , cancellationToken ) ) ;
36+ } , cancellationToken : cancellationToken ) ) ;
3537 }
3638
3739 return results ;
3840 }
3941
40- private bool GetProjectsPredicate ( File file , IPipelineContext context )
42+ private bool GetProjectsPredicate ( File file , IModuleContext context )
4143 {
4244 var path = file . Path ;
4345 if ( ! path . EndsWith ( ".csproj" , StringComparison . OrdinalIgnoreCase ) )
@@ -55,4 +57,4 @@ private bool GetProjectsPredicate(File file, IPipelineContext context)
5557 context . Logger . LogInformation ( "Found File: {File}" , path ) ;
5658 return true ;
5759 }
58- }
60+ }
0 commit comments