File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -100,16 +100,18 @@ private void AddPackageDependencies(JObject json, DependencyContainer dependenci
100
100
return ;
101
101
}
102
102
103
- // If this is a .NET framework reference then include everything.
104
- if ( FrameworkPackageNames . AllFrameworks . Any ( framework => name . StartsWith ( framework ) ) )
103
+ if ( info . Compile is null || ! info . Compile . Any ( ) )
105
104
{
106
- dependencies . AddFramework ( name ) ;
107
- }
108
- else
109
- {
110
- info . Compile ?
111
- . ForEach ( r => dependencies . Add ( name , r . Key ) ) ;
105
+ // If this is a framework reference then include everything.
106
+ if ( FrameworkPackageNames . AllFrameworks . Any ( framework => name . StartsWith ( framework ) ) )
107
+ {
108
+ dependencies . AddFramework ( name ) ;
109
+ }
110
+ return ;
112
111
}
112
+
113
+ info . Compile
114
+ . ForEach ( r => dependencies . Add ( name , r . Key ) ) ;
113
115
} ) ;
114
116
115
117
return ;
Original file line number Diff line number Diff line change @@ -20,10 +20,8 @@ internal class DependencyContainer
20
20
public HashSet < string > Packages { get ; } = new ( ) ;
21
21
22
22
/// <summary>
23
- /// In most cases paths in asset files point to dll's or the empty _._ file, which
24
- /// is sometimes there to avoid the directory being empty.
25
- /// That is, if the path specifically adds a .dll we use that, otherwise we as a fallback
26
- /// add the entire directory (which should be fine in case of _._ as well).
23
+ /// If the path specifically adds a .dll we use that, otherwise we as a fallback
24
+ /// add the entire directory.
27
25
/// </summary>
28
26
private static string ParseFilePath ( string path )
29
27
{
@@ -47,6 +45,13 @@ public void Add(string package, string dependency)
47
45
var p = package . Replace ( '/' , Path . DirectorySeparatorChar ) ;
48
46
var d = dependency . Replace ( '/' , Path . DirectorySeparatorChar ) ;
49
47
48
+ // In most cases paths in asset files point to dll's or the empty _._ file.
49
+ // That is, for _._ we don't need to add anything.
50
+ if ( Path . GetFileName ( d ) == "_._" )
51
+ {
52
+ return ;
53
+ }
54
+
50
55
var path = Path . Combine ( p , ParseFilePath ( d ) ) ;
51
56
Paths . Add ( path ) ;
52
57
Packages . Add ( GetPackageName ( p ) ) ;
You can’t perform that action at this time.
0 commit comments