@@ -53,7 +53,7 @@ static int Execute(bool binlog, bool debug)
53
53
var foundPackage = false ;
54
54
55
55
foreach ( var metadata in items . Root . Descendants ( "PackageMetadata" )
56
- . Distinct ( AnonymousEqualityComparer . Create < XElement > (
56
+ . Distinct ( AnonymousComparer . Create < XElement > (
57
57
( x , y ) => x . Element ( "PackageId" ) ? . Value == y . Element ( "PackageId" ) ? . Value ,
58
58
x => x . Element ( "PackageId" ) ? . Value . GetHashCode ( ) ?? 0 ) ) )
59
59
{
@@ -102,12 +102,12 @@ static int Execute(bool binlog, bool debug)
102
102
. Where ( x =>
103
103
x . Element ( "PackagePath" ) != null &&
104
104
x . Element ( "PackageId" ) ? . Value == packageId )
105
- . Select ( x => x . Element ( "PackagePath" ) . Value )
106
- . Distinct ( )
107
- . OrderBy ( x => Path . GetDirectoryName ( x ) )
108
- . ThenBy ( x => x ) ;
105
+ // .Select(x => x.Element("PackagePath").Value)
106
+ . Distinct ( AnonymousComparer . Create < XElement > ( x => x . Element ( "PackagePath" ) . Value ) )
107
+ . OrderBy ( x => Path . GetDirectoryName ( x . Element ( "PackagePath" ) . Value ) )
108
+ . ThenBy ( x => x . Element ( "PackagePath" ) . Value ) ;
109
109
110
- RenderContents ( contents . ToList ( ) , 0 , 0 , "" ) ;
110
+ Render ( contents . ToList ( ) , 0 , 0 , "" ) ;
111
111
Console . WriteLine ( ) ;
112
112
}
113
113
@@ -123,12 +123,12 @@ static int Execute(bool binlog, bool debug)
123
123
return 0 ;
124
124
}
125
125
126
- static int RenderContents ( IList < string > files , int index , int level , string path )
126
+ static int Render ( IList < XElement > files , int index , int level , string path )
127
127
{
128
128
while ( index < files . Count )
129
-
130
129
{
131
- var file = files [ index ] ;
130
+ var element = files [ index ] ;
131
+ var file = element . Element ( "PackagePath" ) . Value ;
132
132
var dir = Path . GetDirectoryName ( file ) ;
133
133
var paths = dir . Split ( new [ ] { Path . DirectorySeparatorChar , Path . AltDirectorySeparatorChar } , StringSplitOptions . RemoveEmptyEntries ) ;
134
134
@@ -143,15 +143,28 @@ static int RenderContents(IList<string> files, int index, int level, string path
143
143
ColorConsole . Write ( "/" . Gray ( ) ) ;
144
144
145
145
ColorConsole . WriteLine ( paths [ level ] . Green ( ) , "/" . Gray ( ) ) ;
146
- index = RenderContents ( files , index , level + 1 , string . Join ( Path . DirectorySeparatorChar , paths [ ..( level + 1 ) ] ) ) ;
146
+ index = Render ( files , index , level + 1 , string . Join ( Path . DirectorySeparatorChar , paths [ ..( level + 1 ) ] ) ) ;
147
147
}
148
148
else
149
149
{
150
150
Console . Write ( new string ( ' ' , ( level + 1 ) * 2 + 2 ) ) ;
151
151
if ( level == 0 )
152
152
ColorConsole . Write ( "/" . Gray ( ) ) ;
153
153
154
- ColorConsole . WriteLine ( Path . GetFileName ( file ) . White ( ) ) ;
154
+ var attributes = new List < string > ( ) ;
155
+ if ( element . Element ( "BuildAction" ) ? . Value is string buildAction )
156
+ attributes . Add ( "buildAction=" + buildAction ) ;
157
+ if ( element . Element ( "CopyToOutput" ) ? . Value is string copyToOutput )
158
+ attributes . Add ( "copyToOutput=" + copyToOutput ) ;
159
+ if ( element . Element ( "Flatten" ) ? . Value is string flatten )
160
+ attributes . Add ( "flatten=" + flatten ) ;
161
+
162
+ ColorConsole . Write ( Path . GetFileName ( file ) . White ( ) ) ;
163
+ if ( attributes . Count > 0 )
164
+ ColorConsole . Write ( ( " (" + string . Join ( ',' , attributes ) + ")" ) . Gray ( ) ) ;
165
+
166
+ Console . WriteLine ( ) ;
167
+
155
168
index ++ ;
156
169
}
157
170
}
@@ -183,10 +196,13 @@ static bool Execute(string program, string arguments, bool debug = false)
183
196
return proc . ExitCode == 0 ;
184
197
}
185
198
186
- static class AnonymousEqualityComparer
199
+ static class AnonymousComparer
187
200
{
188
201
public static IEqualityComparer < T > Create < T > ( Func < T , T , bool > equals , Func < T , int > getHashCode )
189
202
=> new AnonymousEqualityComparer < T > ( equals , getHashCode ) ;
203
+
204
+ public static IEqualityComparer < T > Create < T > ( Func < T , object > value )
205
+ => new AnonymousEqualityComparer < T > ( ( x , y ) => Equals ( value ( x ) , value ( y ) ) , x => value ( x ) . GetHashCode ( ) ) ;
190
206
}
191
207
192
208
class AnonymousEqualityComparer < T > : IEqualityComparer < T >
0 commit comments