@@ -3284,6 +3284,18 @@ private static int SortConfigurationForLink(Configuration l, Configuration r)
3284
3284
return string . Compare ( l . Project . FullClassName , r . Project . FullClassName , StringComparison . Ordinal ) ;
3285
3285
}
3286
3286
3287
+ private static int SortDotNetDependencyForLink ( DotNetDependency l , DotNetDependency r )
3288
+ {
3289
+ return SortConfigurationForLink ( l . Configuration , r . Configuration ) ;
3290
+ }
3291
+ private static int SortDependencyForLink ( ( DependencyNode , DependencyType ) l , ( DependencyNode , DependencyType ) r )
3292
+ {
3293
+ int cmpType = l . Item2 . CompareTo ( r . Item2 ) ;
3294
+ if ( cmpType != 0 )
3295
+ return - cmpType ; // reverse order (public first, private last)
3296
+ return SortConfigurationForLink ( l . Item1 . _configuration , r . Item1 . _configuration ) ;
3297
+ }
3298
+
3287
3299
internal class DependencyNode
3288
3300
{
3289
3301
internal DependencyNode ( Configuration inConfiguration , DependencySetting inDependencySetting )
@@ -3815,6 +3827,10 @@ IConfigurationTasks GetConfigurationTasks(Platform platform)
3815
3827
3816
3828
DotNetPublicDependencies = resolvedDotNetPublicDependencies . ToList ( ) ;
3817
3829
DotNetPrivateDependencies = resolvedDotNetPrivateDependencies . ToList ( ) ;
3830
+
3831
+ DotNetPublicDependencies . Sort ( SortDotNetDependencyForLink ) ;
3832
+ DotNetPrivateDependencies . Sort ( SortDotNetDependencyForLink ) ;
3833
+
3818
3834
if ( configurationsSwappedToDll is not null )
3819
3835
{
3820
3836
ConfigurationsSwappedToDll = configurationsSwappedToDll ;
@@ -3905,6 +3921,7 @@ static private DependencyNode BuildDependencyNodeTree(Builder builder, Configura
3905
3921
visiting . Push ( childNode ) ;
3906
3922
}
3907
3923
}
3924
+ visitedNode . _childNodes . Sort ( SortDependencyForLink ) ;
3908
3925
}
3909
3926
3910
3927
return rootNode ;
0 commit comments