1- using System ;
1+ using System ;
22using System . Collections . Concurrent ;
33using System . Collections . Generic ;
44using System . IO ;
@@ -31,6 +31,7 @@ public sealed class DependencyManager : IDisposable
3131 private readonly FileContent fileContent ;
3232 private readonly TemporaryDirectory packageDirectory ;
3333 private TemporaryDirectory ? razorWorkingDirectory ;
34+ private readonly Git git ;
3435
3536
3637 /// <summary>
@@ -48,7 +49,7 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
4849
4950 try
5051 {
51- this . dotnet = new DotNet ( progressMonitor ) ;
52+ this . dotnet = new DotNet ( options , progressMonitor ) ;
5253 }
5354 catch
5455 {
@@ -68,7 +69,11 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
6869 ? new [ ] { options . SolutionFile }
6970 : allFiles . SelectFileNamesByExtension ( ".sln" ) ;
7071
71- var dllDirNames = options . DllDirs . Select ( Path . GetFullPath ) . ToList ( ) ;
72+ // If DLL reference paths are specified on the command-line, use those to discover
73+ // assemblies. Otherwise (the default), query the git CLI to determine which DLL files
74+ // are tracked as part of the repository.
75+ this . git = new Git ( this . progressMonitor ) ;
76+ var dllDirNames = options . DllDirs . Count == 0 ? this . git . ListFiles ( "*.dll" ) : options . DllDirs . Select ( Path . GetFullPath ) . ToList ( ) ;
7277
7378 // Find DLLs in the .Net / Asp.Net Framework
7479 if ( options . ScanNetFrameworkDlls )
@@ -98,13 +103,9 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
98103 progressMonitor . MissingNuGet ( ) ;
99104 }
100105
101- // TODO: remove the below when the required SDK is installed
102- using ( new FileRenamer ( sourceDir . GetFiles ( "global.json" , SearchOption . AllDirectories ) ) )
103- {
104- Restore ( solutions ) ;
105- Restore ( allProjects ) ;
106- DownloadMissingPackages ( allFiles ) ;
107- }
106+ Restore ( solutions ) ;
107+ Restore ( allProjects ) ;
108+ DownloadMissingPackages ( allFiles ) ;
108109 }
109110
110111 assemblyCache = new AssemblyCache ( dllDirNames , progressMonitor ) ;
@@ -157,7 +158,6 @@ private void GenerateSourceFilesFromWebViews(List<FileInfo> allFiles)
157158 {
158159 progressMonitor . LogInfo ( $ "Found { views . Length } cshtml and razor files.") ;
159160
160- // TODO: use SDK specified in global.json
161161 var sdk = new Sdk ( dotnet ) . GetNewestSdk ( ) ;
162162 if ( sdk != null )
163163 {
0 commit comments