@@ -25,17 +25,35 @@ IPA_PATH = "#{OUTPUT_DIR}/Lunch.ipa"
2525# Fix Tauri iOS project issue where Externals folder in sources causes
2626# "Multiple commands produce libapp.a" error (both debug and release copied)
2727# See: https://github.com/tauri-apps/tauri/issues/13578
28+ # Also ensures ASSETCATALOG_COMPILER_APPICON_NAME is set so icons appear in builds
2829def fix_tauri_project_yml
2930 project_yml_path = "#{ ROOT_DIR } /src-tauri/gen/apple/project.yml"
3031 return unless File . exist? ( project_yml_path )
3132
3233 content = File . read ( project_yml_path )
34+ modified = false
35+
3336 # Remove "- path: Externals" from sources to prevent duplicate libapp.a
3437 # libapp.a is already linked via dependencies, no need to copy as resource
3538 if content . include? ( "- path: Externals" )
3639 content . gsub! ( /^\s *- path: Externals\n / , "" )
37- File . write ( project_yml_path , content )
3840 UI . message ( "Fixed project.yml: removed Externals from sources" )
41+ modified = true
42+ end
43+
44+ # Add ASSETCATALOG_COMPILER_APPICON_NAME setting to ensure icons are included
45+ # This setting gets lost when xcodegen regenerates the project
46+ unless content . include? ( "ASSETCATALOG_COMPILER_APPICON_NAME" )
47+ # Find the base: section under settings: and add the icon setting
48+ content . gsub! ( /(settings:\s +base:\s +.*?VALID_ARCHS:.*?\n )/m ) do |match |
49+ "#{ match } ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon\n "
50+ end
51+ UI . message ( "Fixed project.yml: added ASSETCATALOG_COMPILER_APPICON_NAME setting" )
52+ modified = true
53+ end
54+
55+ if modified
56+ File . write ( project_yml_path , content )
3957 # Regenerate Xcode project with xcodegen
4058 sh ( "cd #{ ROOT_DIR } /src-tauri/gen/apple && xcodegen generate" )
4159 end
0 commit comments