dotnet / xcsync

xcsync is designed to provide .NET developers with improved support for editing Apple specific files for MAUI and .NET for iOS/tvOS/macOS/macCatalyst projects.
MIT License
14 stars 1 forks source link

Exception in ConsumeAsync: Could not find a part of the path '/Users/harithamohan/yur/p1/obj/xcode/AppDelegate.h' #160

Open haritha-mohan opened 1 week ago

haritha-mohan commented 1 week ago

this: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/Commands/BaseCommand.cs#L204

isn't doing what it is supposed to when executing the generate command for the very first time..it results in:

./xcsync generate -p /Users/harithamohan/yur/p1/p1.csproj -tfm net9.0-ios -f -v Detailed xcSync v42.42.42.42, (c) Microsoft Corporation. All rights reserved. [16:04:58 INF xcsync (1)] Using Xcode from /Applications/Xcode_15.4.0.app. [16:04:59 INF xcsync (1)] Using the dotnet located at . [16:04:59 INF xcsync (1)] Generating files from project '/Users/harithamohan/yur/p1/p1.csproj' to target '/Users/harithamohan/yur/p1/obj/xcode' [16:04:59 DBG xcsync (1)] Generating Xcode project files... Executing: dotnet msbuild /Users/harithamohan/yur/p1/p1.csproj -getProperty:UseMaui,OutputType -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmp1LATWI.tmp [16:05:04 DBG xcsync (9)] Generated Xcode header and implementation files [16:05:04 FTL xcsync (18)] Exception in ConsumeAsync: Could not find a part of the path '/Users/harithamohan/yur/p1/obj/xcode/AppDelegate.h'. Executing: dotnet msbuild /Users/harithamohan/yur/p1/p1.csproj -getItem:Compile,None -property:TargetFramework=ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmpZztvRo.tmp [16:05:04 FTL xcsync (18)] Exception in ConsumeAsync: Could not find a part of the path '/Users/harithamohan/yur/p1/obj/xcode/AppDelegate.m'. Executing: dotnet msbuild /Users/harithamohan/yur/p1/p1.csproj -getItem:BundleResource -property:TargetFramework=net9.0-ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmptoprQU.tmp Executing: dotnet msbuild /Users/harithamohan/yur/p1/p1.csproj -getProperty:SupportedOSPlatformVersion -property:TargetFramework=net9.0-ios -getResultOutputFile:/var/folders/qc/z5px468n56j2pnk6ltpctn5c0000gn/T/tmpDDP5Fd.tmp [16:05:07 INF xcsync (9)] Generated Xcode project at '/Users/harithamohan/yur/p1/obj/xcode' [16:05:07 DBG xcsync (18)] Synchronization complete.

in the above stack trace, we only see issues with the AppDelegate files..why not any of the static ones like Info.plist? because we ensure the directory is created for apple-specific files: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/SyncContext.cs#L173

also, I don't think we should be manually handling the DirectorySeparatorChar in: https://github.com/dotnet/xcsync/blob/7e95dff4ec8a211a26f9e6b69bcbb20c26b51950/src/xcsync/Commands/BaseCommand.cs#L52

I believe this might be contributing to the issue here..regardless, the logic here should be more consistent

mcumming commented 1 week ago

Can you provide a repro steps?

mcumming commented 1 week ago

Affected by: https://github.com/dotnet/xcsync/pull/154