@@ -198,7 +198,7 @@ void ProcessNativeReference (ITaskItem item, string name, List<ITaskItem> native
198198
199199 // (compressed) xcframework
200200 if ( name . EndsWith ( ".xcframework" , StringComparison . OrdinalIgnoreCase ) || name . EndsWith ( ".xcframework.zip" , StringComparison . OrdinalIgnoreCase ) ) {
201- if ( ! TryResolveXCFramework ( Log , TargetFrameworkMoniker , SdkIsSimulator , Architectures , name , GetIntermediateDecompressionDir ( item ) , createdFiles , cancellationToken , out var nativeLibraryPath ) )
201+ if ( ! TryResolveXCFramework ( this , TargetFrameworkMoniker , SdkIsSimulator , Architectures , name , GetIntermediateDecompressionDir ( item ) , createdFiles , cancellationToken , out var nativeLibraryPath ) )
202202 return ;
203203 var nr = new TaskItem ( item ) ;
204204 SetMetadataNativeLibrary ( nr , nativeLibraryPath ) ;
@@ -208,7 +208,7 @@ void ProcessNativeReference (ITaskItem item, string name, List<ITaskItem> native
208208
209209 // compressed framework
210210 if ( name . EndsWith ( ".framework.zip" , StringComparison . OrdinalIgnoreCase ) ) {
211- if ( ! CompressionHelper . TryDecompress ( Log , name , Path . GetFileNameWithoutExtension ( name ) , GetIntermediateDecompressionDir ( item ) , createdFiles , cancellationToken , out var frameworkPath ) )
211+ if ( ! CompressionHelper . TryDecompress ( this , name , Path . GetFileNameWithoutExtension ( name ) , GetIntermediateDecompressionDir ( item ) , createdFiles , cancellationToken , out var frameworkPath ) )
212212 return ;
213213 var nr = new TaskItem ( item ) ;
214214 nr . ItemSpec = GetActualLibrary ( frameworkPath ) ;
@@ -311,14 +311,14 @@ void ProcessSidecar (ITaskItem r, string resources, List<ITaskItem> native_frame
311311 ITaskItem t = new TaskItem ( r ) ;
312312 var name = referenceNode . Attributes [ "Name" ] . Value . Trim ( '\\ ' , '/' ) ;
313313 if ( name . EndsWith ( ".xcframework" , StringComparison . Ordinal ) || name . EndsWith ( ".xcframework.zip" , StringComparison . Ordinal ) ) {
314- if ( ! TryResolveXCFramework ( Log , TargetFrameworkMoniker , SdkIsSimulator , Architectures , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out var nativeLibraryPath ) )
314+ if ( ! TryResolveXCFramework ( this , TargetFrameworkMoniker , SdkIsSimulator , Architectures , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out var nativeLibraryPath ) )
315315 continue ;
316316 SetMetadataNativeLibrary ( t , nativeLibraryPath ) ;
317317 } else if ( name . EndsWith ( ".framework" , StringComparison . Ordinal ) ) {
318318 string ? frameworkPath ;
319319 if ( ! isCompressed ) {
320320 frameworkPath = Path . Combine ( resources , name ) ;
321- } else if ( ! CompressionHelper . TryDecompress ( Log , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out frameworkPath ) ) {
321+ } else if ( ! CompressionHelper . TryDecompress ( this , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out frameworkPath ) ) {
322322 continue ;
323323 }
324324 t . ItemSpec = GetActualLibrary ( frameworkPath ) ;
@@ -330,7 +330,7 @@ void ProcessSidecar (ITaskItem r, string resources, List<ITaskItem> native_frame
330330 string ? dylibPath ;
331331 if ( ! isCompressed ) {
332332 dylibPath = Path . Combine ( resources , name ) ;
333- } else if ( ! CompressionHelper . TryDecompress ( Log , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out dylibPath ) ) {
333+ } else if ( ! CompressionHelper . TryDecompress ( this , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out dylibPath ) ) {
334334 continue ;
335335 }
336336 t . ItemSpec = dylibPath ;
@@ -341,7 +341,7 @@ void ProcessSidecar (ITaskItem r, string resources, List<ITaskItem> native_frame
341341 string ? aPath ;
342342 if ( ! isCompressed ) {
343343 aPath = Path . Combine ( resources , name ) ;
344- } else if ( ! CompressionHelper . TryDecompress ( Log , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out aPath ) ) {
344+ } else if ( ! CompressionHelper . TryDecompress ( this , resources , name , GetIntermediateDecompressionDir ( resources ) , createdFiles , cancellationToken , out aPath ) ) {
345345 continue ;
346346 }
347347 t . ItemSpec = aPath ;
@@ -378,7 +378,7 @@ void ProcessSidecar (ITaskItem r, string resources, List<ITaskItem> native_frame
378378 /// <param name="nativeLibraryPath">A full path to the resolved native library within the xcframework. If 'resourcePath' is compressed, this will point to where the native library is decompressed on disk.</param>
379379 /// <param name="intermediateDecompressionDir"></param>
380380 /// <returns>True if a native library was successfully found. Otherwise false, and an error will have been printed to the log.</returns>
381- public static bool TryResolveXCFramework ( TaskLoggingHelper log , string targetFrameworkMoniker , bool isSimulator , string ? architectures , string path , string intermediateDecompressionDir , List < string > createdFiles , CancellationToken ? cancellationToken , [ NotNullWhen ( true ) ] out string ? nativeLibraryPath )
381+ public static bool TryResolveXCFramework ( XamarinTask task , string targetFrameworkMoniker , bool isSimulator , string ? architectures , string path , string intermediateDecompressionDir , List < string > createdFiles , CancellationToken ? cancellationToken , [ NotNullWhen ( true ) ] out string ? nativeLibraryPath )
382382 {
383383 string resourcePath ;
384384 string xcframework ;
@@ -390,7 +390,7 @@ public static bool TryResolveXCFramework (TaskLoggingHelper log, string targetFr
390390 resourcePath = Path . GetDirectoryName ( path ) ;
391391 xcframework = Path . GetFileName ( path ) ;
392392 }
393- return TryResolveXCFramework ( log , targetFrameworkMoniker , isSimulator , architectures , resourcePath , xcframework , intermediateDecompressionDir , createdFiles , cancellationToken , out nativeLibraryPath ) ;
393+ return TryResolveXCFramework ( task , targetFrameworkMoniker , isSimulator , architectures , resourcePath , xcframework , intermediateDecompressionDir , createdFiles , cancellationToken , out nativeLibraryPath ) ;
394394 }
395395
396396 /// <summary>
@@ -405,8 +405,9 @@ public static bool TryResolveXCFramework (TaskLoggingHelper log, string targetFr
405405 /// <param name="nativeLibraryPath">A full path to the resolved native library within the xcframework. If 'resourcePath' is compressed, this will point to where the native library is decompressed on disk.</param>
406406 /// <param name="intermediateDecompressionDir"></param>
407407 /// <returns>True if a native library was successfully found. Otherwise false, and an error will have been printed to the log.</returns>
408- public static bool TryResolveXCFramework ( TaskLoggingHelper log , string targetFrameworkMoniker , bool isSimulator , string ? architectures , string resourcePath , string xcframework , string intermediateDecompressionDir , List < string > createdFiles , CancellationToken ? cancellationToken , [ NotNullWhen ( true ) ] out string ? nativeLibraryPath )
408+ public static bool TryResolveXCFramework ( XamarinTask task , string targetFrameworkMoniker , bool isSimulator , string ? architectures , string resourcePath , string xcframework , string intermediateDecompressionDir , List < string > createdFiles , CancellationToken ? cancellationToken , [ NotNullWhen ( true ) ] out string ? nativeLibraryPath )
409409 {
410+ var log = task . Log ;
410411 nativeLibraryPath = null ;
411412
412413 try {
@@ -421,7 +422,7 @@ public static bool TryResolveXCFramework (TaskLoggingHelper log, string targetFr
421422 if ( ! isCompressed && CompressionHelper . IsCompressed ( xcframework ) ) {
422423 var zipPath = Path . Combine ( resourcePath , xcframework ) ;
423424 var xcframeworkName = Path . GetFileNameWithoutExtension ( xcframework ) ;
424- if ( ! CompressionHelper . TryDecompress ( log , zipPath , xcframeworkName , intermediateDecompressionDir , createdFiles , cancellationToken , out var decompressedXcframeworkPath ) )
425+ if ( ! CompressionHelper . TryDecompress ( task , zipPath , xcframeworkName , intermediateDecompressionDir , createdFiles , cancellationToken , out var decompressedXcframeworkPath ) )
425426 return false ;
426427
427428 nativeLibraryPath = Path . Combine ( intermediateDecompressionDir , xcframeworkName , nativeLibraryRelativePath ) ;
@@ -434,7 +435,7 @@ public static bool TryResolveXCFramework (TaskLoggingHelper log, string targetFr
434435 }
435436
436437 var zipResource = Path . Combine ( xcframework , Path . GetDirectoryName ( nativeLibraryRelativePath ) ) ;
437- if ( ! CompressionHelper . TryDecompress ( log , resourcePath , zipResource , intermediateDecompressionDir , createdFiles , cancellationToken , out var decompressedPath ) )
438+ if ( ! CompressionHelper . TryDecompress ( task , resourcePath , zipResource , intermediateDecompressionDir , createdFiles , cancellationToken , out var decompressedPath ) )
438439 return false ;
439440
440441 nativeLibraryPath = Path . Combine ( intermediateDecompressionDir , xcframework , nativeLibraryRelativePath ) ;
0 commit comments