@@ -182,11 +182,11 @@ private async Task CleanLibrariesAsync(ProjectItem configProjectItem, Cancellati
182182 Project project = VsHelpers . GetDTEProjectFromConfig ( configFileName ) ;
183183
184184 Manifest manifest = await Manifest . FromFileAsync ( configFileName , dependencies , CancellationToken . None ) . ConfigureAwait ( false ) ;
185- IEnumerable < ILibraryOperationResult > results = new List < ILibraryOperationResult > ( ) ;
185+ IEnumerable < OperationResult < LibraryInstallationGoalState > > results = new List < OperationResult < LibraryInstallationGoalState > > ( ) ;
186186
187187 if ( manifest != null )
188188 {
189- IEnumerable < ILibraryOperationResult > validationResults = await LibrariesValidator . GetManifestErrorsAsync ( manifest , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
189+ IEnumerable < OperationResult < LibraryInstallationGoalState > > validationResults = await LibrariesValidator . GetManifestErrorsAsync ( manifest , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
190190
191191 if ( ! validationResults . All ( r => r . Success ) )
192192 {
@@ -234,7 +234,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
234234
235235 Logger . LogEvent ( string . Format ( LibraryManager . Resources . Text . Restore_LibrariesForProject , project ? . Name ) , LogLevel . Operation ) ;
236236
237- IEnumerable < ILibraryOperationResult > validationResults = await LibrariesValidator . GetManifestErrorsAsync ( manifest . Value , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
237+ IEnumerable < OperationResult < LibraryInstallationGoalState > > validationResults = await LibrariesValidator . GetManifestErrorsAsync ( manifest . Value , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
238238 if ( ! validationResults . All ( r => r . Success ) )
239239 {
240240 swLocal . Stop ( ) ;
@@ -244,7 +244,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
244244 }
245245 else
246246 {
247- IEnumerable < ILibraryOperationResult > results = await RestoreLibrariesAsync ( manifest . Value , cancellationToken ) . ConfigureAwait ( false ) ;
247+ var results = await RestoreLibrariesAsync ( manifest . Value , cancellationToken ) . ConfigureAwait ( false ) ;
248248 await AddFilesToProjectAsync ( manifest . Key , project , results . Where ( r => r . Success && ! r . UpToDate ) , cancellationToken ) . ConfigureAwait ( false ) ;
249249
250250 swLocal . Stop ( ) ;
@@ -264,7 +264,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
264264 }
265265 }
266266
267- private async Task < IEnumerable < ILibraryOperationResult > > RestoreLibrariesAsync ( Manifest manifest , CancellationToken cancellationToken )
267+ private async Task < IEnumerable < OperationResult < LibraryInstallationGoalState > > > RestoreLibrariesAsync ( Manifest manifest , CancellationToken cancellationToken )
268268 {
269269 return await manifest . RestoreAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
270270 }
@@ -281,11 +281,11 @@ private async Task UninstallLibraryAsync(string configFilePath, string libraryNa
281281
282282 var dependencies = _dependenciesFactory . FromConfigFile ( configFilePath ) ;
283283 Manifest manifest = await Manifest . FromFileAsync ( configFilePath , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
284- ILibraryOperationResult result = null ;
284+ OperationResult < LibraryInstallationGoalState > result = null ;
285285
286286 if ( manifest == null )
287287 {
288- result = LibraryOperationResult . FromError ( PredefinedErrors . ManifestMalformed ( ) ) ;
288+ result = OperationResult < LibraryInstallationGoalState > . FromError ( PredefinedErrors . ManifestMalformed ( ) ) ;
289289 }
290290 else
291291 {
@@ -297,14 +297,14 @@ private async Task UninstallLibraryAsync(string configFilePath, string libraryNa
297297
298298 if ( result . Errors . Any ( ) )
299299 {
300- Logger . LogErrorsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall ) ;
300+ Logger . LogErrorsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall ) ;
301301 }
302302 else
303303 {
304- Logger . LogEventsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall , sw . Elapsed ) ;
304+ Logger . LogEventsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall , sw . Elapsed ) ;
305305 }
306306
307- Telemetry . LogEventsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall , sw . Elapsed ) ;
307+ Telemetry . LogEventsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall , sw . Elapsed ) ;
308308 }
309309 catch ( OperationCanceledException ex )
310310 {
@@ -333,26 +333,24 @@ private string GetTaskTitle(OperationType operation, string libraryId)
333333 return string . Empty ;
334334 }
335335
336- private void AddErrorsToErrorList ( string projectName , string configFile , IEnumerable < ILibraryOperationResult > results )
336+ private void AddErrorsToErrorList ( string projectName , string configFile , IEnumerable < OperationResult < LibraryInstallationGoalState > > results )
337337 {
338338 var errorList = new ErrorListPropagator ( projectName , configFile ) ;
339339 errorList . HandleErrors ( results ) ;
340340 }
341341
342- private async Task AddFilesToProjectAsync ( string configFilePath , Project project , IEnumerable < ILibraryOperationResult > results , CancellationToken cancellationToken )
342+ private async Task AddFilesToProjectAsync ( string configFilePath , Project project , IEnumerable < OperationResult < LibraryInstallationGoalState > > results , CancellationToken cancellationToken )
343343 {
344344 string workingDirectory = Path . GetDirectoryName ( configFilePath ) ;
345345 var files = new List < string > ( ) ;
346346
347347 if ( project != null )
348348 {
349- foreach ( ILibraryOperationResult state in results )
349+ foreach ( OperationResult < LibraryInstallationGoalState > goalStateResult in results )
350350 {
351- if ( state . Success && ! state . UpToDate && state . InstallationState . Files != null )
351+ if ( goalStateResult . Success && ! goalStateResult . UpToDate && goalStateResult . Result . InstallationState . Files != null )
352352 {
353- IEnumerable < string > absoluteFiles = state . InstallationState . Files
354- . Select ( file => Path . Combine ( workingDirectory , state . InstallationState . DestinationPath , file )
355- . Replace ( '/' , Path . DirectorySeparatorChar ) ) ;
353+ IEnumerable < string > absoluteFiles = goalStateResult . Result . InstalledFiles . Keys ;
356354 files . AddRange ( absoluteFiles ) ;
357355 }
358356 }
0 commit comments