@@ -43,7 +43,7 @@ defmodule Mix.Tasks.Lvn.SwiftUI.Install do
4343 targets: % {
4444 type: :multiselect ,
4545 label: "Select any number of deployment targets for your app." ,
46- options: [ "iOS" , "macOS" , "watchOS" ] ,
46+ options: [ "iOS" , "macOS" , "watchOS" , "tvOS (Experimental)" ] ,
4747 default: [ "iOS" ] ,
4848 default_label: "1"
4949 }
@@ -136,14 +136,16 @@ defmodule Mix.Tasks.Lvn.SwiftUI.Install do
136136 end
137137
138138 defp run_xcodegen ( % { app_namespace: app_namespace , native_path: native_path } , % { targets: targets } ) do
139- lvn_ios_include_path = if "iOS" in targets , do: "project_ios.yml" , else: "skip_spec.yml"
140- lvn_macos_include_path = if "macOS" in targets , do: "project_macos.yml" , else: "skip_spec.yml"
139+ lvn_ios = if "iOS" in targets , do: "iOS" , else: ""
140+ lvn_macos = if "macOS" in targets , do: "macOS" , else: ""
141+ lvn_tvos = if "tvOS (Experimental)" in targets , do: "tvOS" , else: ""
141142 lvn_watchos_include_path = if "watchOS" in targets , do: "project_watchos.yml" , else: "skip_spec.yml"
142143 xcodegen_env = [
143144 { "LVN_APP_NAME" , app_namespace } ,
144- { "LVN_BUNDLE_IDENTIFIER" , "com.myorg.#{ app_namespace } " } ,
145- { "LVN_IOS_INCLUDE_PATH" , lvn_ios_include_path } ,
146- { "LVN_MACOS_INCLUDE_PATH" , lvn_macos_include_path } ,
145+ { "LVN_BUNDLE_IDENTIFIER" , "com.example.#{ app_namespace } " } ,
146+ { "LVN_IOS" , lvn_ios } ,
147+ { "LVN_MACOS" , lvn_macos } ,
148+ { "LVN_TVOS" , lvn_tvos } ,
147149 { "LVN_WATCHOS_INCLUDE_PATH" , lvn_watchos_include_path }
148150 ]
149151 native_project_path = Path . join ( native_path , "swiftui" )
@@ -160,7 +162,7 @@ defmodule Mix.Tasks.Lvn.SwiftUI.Install do
160162 defp remove_xcodegen_files ( % { native_path: native_path } ) do
161163 client_path = Path . join ( native_path , "swiftui" )
162164
163- [ "base_spec.yml" , "project_ios.yml" , "project_macos.yml" , " project_watchos.yml", "project.yml" , "skip_spec.yml" ]
165+ [ "base_spec.yml" , "project_watchos.yml" , "project.yml" , "skip_spec.yml" ]
164166 |> Enum . map ( & ( Path . join ( client_path , & 1 ) ) )
165167 |> Enum . map ( & File . rm / 1 )
166168 end
0 commit comments