11using EnumerableAsyncProcessor . Extensions ;
2- using Microsoft . Extensions . Logging ;
32using ModularPipelines . Attributes ;
43using ModularPipelines . Context ;
54using ModularPipelines . DotNet . Extensions ;
@@ -13,9 +12,7 @@ namespace ModularPipelines.Build.Modules;
1312
1413[ DependsOn < NugetVersionGeneratorModule > ]
1514[ DependsOn < PackageFilesRemovalModule > ]
16- [ DependsOn < CodeFormattedNicelyModule > ( IgnoreIfNotRegistered = true ) ]
1715[ DependsOn < FindProjectDependenciesModule > ]
18- [ DependsOn < ChangedFilesInPullRequestModule > ]
1916[ DependsOn < RunUnitTestsModule > ]
2017[ RunOnLinuxOnly ]
2118public class PackProjectsModule : Module < CommandResult [ ] >
@@ -26,49 +23,20 @@ public class PackProjectsModule : Module<CommandResult[]>
2623
2724 var projectFiles = context . GetModule < FindProjectDependenciesModule , FindProjectDependenciesModule . ProjectDependencies > ( ) ;
2825
29- var changedFiles = context . GetModule < ChangedFilesInPullRequestModule , IReadOnlyList < File > > ( ) ;
3026
3127 var dependencies = await projectFiles . ValueOrDefault ! . Dependencies
3228 . ToAsyncProcessorBuilder ( )
3329 . SelectAsync ( async projectFile => await Pack ( context , cancellationToken , projectFile , packageVersion ) )
3430 . ProcessOneAtATime ( ) ;
35-
36- var gitVersioningInformation = await context . Git ( ) . Versioning . GetGitVersioningInformation ( ) ;
37-
31+
3832 var others = await projectFiles . ValueOrDefault ! . Others
39- . Where ( x =>
40- {
41- if ( changedFiles . SkipDecisionOrDefault ? . ShouldSkip == true )
42- {
43- return true ;
44- }
45-
46- return ProjectHasChanged ( x ,
47- changedFiles . ValueOrDefault ! , context ) ;
48- } )
4933 . ToAsyncProcessorBuilder ( )
5034 . SelectAsync ( async projectFile => await Pack ( context , cancellationToken , projectFile , packageVersion ) )
5135 . ProcessInParallel ( ) ;
5236
5337 return dependencies . Concat ( others ) . ToArray ( ) ;
5438 }
5539
56- private bool ProjectHasChanged ( File projectFile , IEnumerable < File > changedFiles ,
57- IModuleContext context )
58- {
59- var projectDirectory = projectFile . Folder ! ;
60-
61- if ( ! changedFiles . Any ( x => x . Path . Contains ( projectDirectory . Path ) ) )
62- {
63- context . Logger . LogInformation ( "{Project} has not changed so not packing it" , projectFile . Name ) ;
64- return false ;
65- }
66-
67- context . Logger . LogInformation ( "{Project} has changed so packing it" , projectFile . Name ) ;
68-
69- return true ;
70- }
71-
7240 private static async Task < CommandResult > Pack ( IModuleContext context , CancellationToken cancellationToken , File projectFile , ModuleResult < string > packageVersion )
7341 {
7442 return await context . DotNet ( ) . Pack ( new DotNetPackOptions
0 commit comments