@@ -182,11 +182,11 @@ private async Task CleanLibrariesAsync(ProjectItem configProjectItem, Cancellati
182
182
Project project = VsHelpers . GetDTEProjectFromConfig ( configFileName ) ;
183
183
184
184
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 > > ( ) ;
186
186
187
187
if ( manifest != null )
188
188
{
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 ) ;
190
190
191
191
if ( ! validationResults . All ( r => r . Success ) )
192
192
{
@@ -234,7 +234,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
234
234
235
235
Logger . LogEvent ( string . Format ( LibraryManager . Resources . Text . Restore_LibrariesForProject , project ? . Name ) , LogLevel . Operation ) ;
236
236
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 ) ;
238
238
if ( ! validationResults . All ( r => r . Success ) )
239
239
{
240
240
swLocal . Stop ( ) ;
@@ -244,7 +244,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
244
244
}
245
245
else
246
246
{
247
- IEnumerable < ILibraryOperationResult > results = await RestoreLibrariesAsync ( manifest . Value , cancellationToken ) . ConfigureAwait ( false ) ;
247
+ var results = await RestoreLibrariesAsync ( manifest . Value , cancellationToken ) . ConfigureAwait ( false ) ;
248
248
await AddFilesToProjectAsync ( manifest . Key , project , results . Where ( r => r . Success && ! r . UpToDate ) , cancellationToken ) . ConfigureAwait ( false ) ;
249
249
250
250
swLocal . Stop ( ) ;
@@ -264,7 +264,7 @@ private async Task RestoreInternalAsync(IDictionary<string, Manifest> manifests,
264
264
}
265
265
}
266
266
267
- private async Task < IEnumerable < ILibraryOperationResult > > RestoreLibrariesAsync ( Manifest manifest , CancellationToken cancellationToken )
267
+ private async Task < IEnumerable < OperationResult < LibraryInstallationGoalState > > > RestoreLibrariesAsync ( Manifest manifest , CancellationToken cancellationToken )
268
268
{
269
269
return await manifest . RestoreAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
270
270
}
@@ -281,11 +281,11 @@ private async Task UninstallLibraryAsync(string configFilePath, string libraryNa
281
281
282
282
var dependencies = _dependenciesFactory . FromConfigFile ( configFilePath ) ;
283
283
Manifest manifest = await Manifest . FromFileAsync ( configFilePath , dependencies , cancellationToken ) . ConfigureAwait ( false ) ;
284
- ILibraryOperationResult result = null ;
284
+ OperationResult < LibraryInstallationGoalState > result = null ;
285
285
286
286
if ( manifest == null )
287
287
{
288
- result = LibraryOperationResult . FromError ( PredefinedErrors . ManifestMalformed ( ) ) ;
288
+ result = OperationResult < LibraryInstallationGoalState > . FromError ( PredefinedErrors . ManifestMalformed ( ) ) ;
289
289
}
290
290
else
291
291
{
@@ -297,14 +297,14 @@ private async Task UninstallLibraryAsync(string configFilePath, string libraryNa
297
297
298
298
if ( result . Errors . Any ( ) )
299
299
{
300
- Logger . LogErrorsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall ) ;
300
+ Logger . LogErrorsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall ) ;
301
301
}
302
302
else
303
303
{
304
- Logger . LogEventsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall , sw . Elapsed ) ;
304
+ Logger . LogEventsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall , sw . Elapsed ) ;
305
305
}
306
306
307
- Telemetry . LogEventsSummary ( new List < ILibraryOperationResult > { result } , OperationType . Uninstall , sw . Elapsed ) ;
307
+ Telemetry . LogEventsSummary ( new List < OperationResult < LibraryInstallationGoalState > > { result } , OperationType . Uninstall , sw . Elapsed ) ;
308
308
}
309
309
catch ( OperationCanceledException ex )
310
310
{
@@ -333,26 +333,24 @@ private string GetTaskTitle(OperationType operation, string libraryId)
333
333
return string . Empty ;
334
334
}
335
335
336
- private void AddErrorsToErrorList ( string projectName , string configFile , IEnumerable < ILibraryOperationResult > results )
336
+ private void AddErrorsToErrorList ( string projectName , string configFile , IEnumerable < OperationResult < LibraryInstallationGoalState > > results )
337
337
{
338
338
var errorList = new ErrorListPropagator ( projectName , configFile ) ;
339
339
errorList . HandleErrors ( results ) ;
340
340
}
341
341
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 )
343
343
{
344
344
string workingDirectory = Path . GetDirectoryName ( configFilePath ) ;
345
345
var files = new List < string > ( ) ;
346
346
347
347
if ( project != null )
348
348
{
349
- foreach ( ILibraryOperationResult state in results )
349
+ foreach ( OperationResult < LibraryInstallationGoalState > goalStateResult in results )
350
350
{
351
- if ( state . Success && ! state . UpToDate && state . InstallationState . Files != null )
351
+ if ( goalStateResult . Success && ! goalStateResult . UpToDate && goalStateResult . Result . InstallationState . Files != null )
352
352
{
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 ;
356
354
files . AddRange ( absoluteFiles ) ;
357
355
}
358
356
}
0 commit comments