Class: Xcake::TargetBuildPhaseGenerator
- Inherits:
-
Generator
show all
- Defined in:
- lib/xcake/generator/target_build_phase_generator.rb
Overview
TODO: In future this should just infer extra targets and add it to the DSL
we should then implement a 2nd pass generator which turns that DSL into
build phases
Instance Attribute Summary
Attributes inherited from Generator
#context
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Generator
#initialize, plugins_location
Methods included from Visitor
#item_name, #leave, #visit
Methods included from Plugin
included
Methods included from Dependency
included
Instance Method Details
#create_embed_watchapp_extension_phase(native_target, native_watchapp_extension_target) ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'lib/xcake/generator/target_build_phase_generator.rb', line 37
def create_embed_watchapp_extension_phase(native_target, native_watchapp_extension_target)
EventHooks.run_hook :before_adding_embed_watch_extension_phase
product_reference = native_watchapp_extension_target.product_reference
phase = native_target.new_copy_files_build_phase('Embed App Extensions')
phase.symbol_dst_subfolder_spec = :plug_ins
phase.add_file_reference(product_reference, true)
phase
end
|
#create_embed_watchapp_phase(native_target, native_watchapp_target) ⇒ Object
27
28
29
30
31
32
33
34
35
|
# File 'lib/xcake/generator/target_build_phase_generator.rb', line 27
def create_embed_watchapp_phase(native_target, native_watchapp_target)
EventHooks.run_hook :before_adding_embed_watch_app_phase
phase = native_target.new_copy_files_build_phase('Embed Watch Content')
phase.dst_path = '$(CONTENTS_FOLDER_PATH)/Watch'
phase.symbol_dst_subfolder_spec = :products_directory
phase.add_file_reference(native_watchapp_target.product_reference, true)
phase
end
|
#visit_target(target) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/xcake/generator/target_build_phase_generator.rb', line 10
def visit_target(target)
EventHooks.run_hook :before_adding_build_phases, target
native_target = @context.native_object_for(target)
target.target_dependencies.each do |dep|
native_dep = @context.native_object_for(dep)
case dep.type
when :watch2_app
create_embed_watchapp_phase(native_target, native_dep)
when :watch2_extension
create_embed_watchapp_extension_phase(native_target, native_dep)
end
end
end
|