Class: Phoenx::TestTargetBuilder
- Inherits:
-
TargetBuilder
- Object
- TargetBuilder
- Phoenx::TestTargetBuilder
- Defined in:
- lib/phoenx/use_cases/generate_target.rb
Instance Attribute Summary
Attributes inherited from TargetBuilder
#framework_files, #project, #project_spec, #target_spec
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(main_target, project, target_spec, project_spec, main_target_spec, main_target_frameworks_files) ⇒ TestTargetBuilder
constructor
A new instance of TestTargetBuilder.
- #target ⇒ Object
Methods inherited from TargetBuilder
#add_build_phase_scripts, #add_config_files, #add_frameworks_and_libraries, #add_headers, #add_private_headers, #add_project_headers, #add_public_headers, #add_resources, #add_sources, #add_support_files, #add_system_dependencies, #configure_target
Constructor Details
#initialize(main_target, project, target_spec, project_spec, main_target_spec, main_target_frameworks_files) ⇒ TestTargetBuilder
Returns a new instance of TestTargetBuilder.
484 485 486 487 488 489 490 491 |
# File 'lib/phoenx/use_cases/generate_target.rb', line 484 def initialize(main_target, project, target_spec, project_spec, main_target_spec, main_target_frameworks_files) super(project, target_spec, project_spec) @main_target = main_target @main_target_spec = main_target_spec @main_target_frameworks_files = main_target_frameworks_files end |
Instance Method Details
#build ⇒ Object
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
# File 'lib/phoenx/use_cases/generate_target.rb', line 493 def build @target = @project.new(Xcodeproj::Project::PBXNativeTarget) @project.targets << @target @target.name = @target_spec.name @target.product_name = @target_spec.name @target.product_type = Xcodeproj::Constants::PRODUCT_TYPE_UTI[:unit_test_bundle] @target.build_configuration_list = Xcodeproj::Project::ProjectHelper.configuration_list(@project, @main_target_spec.platform, @main_target_spec.version) product_ref = @project.products_group.new_reference(@target_spec.name + '.' + XCTEST_EXTENSION, :built_products) product_ref.include_in_index = '0' product_ref.set_explicit_file_type @target.product_reference = product_ref @target.build_phases << @project.new(Xcodeproj::Project::PBXSourcesBuildPhase) @target.build_phases << @project.new(Xcodeproj::Project::PBXFrameworksBuildPhase) @target.build_phases << @project.new(Xcodeproj::Project::PBXResourcesBuildPhase) self.add_sources self.add_config_files self.add_frameworks_and_libraries self.add_system_dependencies self.add_build_phase_scripts self.add_resources self.add_support_files copy_frameworks = @target.new_copy_files_build_phase "Embed Frameworks" copy_frameworks.symbol_dst_subfolder_spec = :frameworks frameworks_group = @project.main_group.find_subpath(FRAMEWORKS_ROOT, false) self.framework_files.each do |file| build_file = copy_frameworks.add_file_reference(file) build_file.settings = ATTRIBUTES_CODE_SIGN_ON_COPY end @main_target_frameworks_files.each do |file| build_file = copy_frameworks.add_file_reference(file) build_file.settings = ATTRIBUTES_CODE_SIGN_ON_COPY end # Add target dependency. @target.add_dependency(@main_target) self.configure_target end |
#target ⇒ Object
545 546 547 548 549 |
# File 'lib/phoenx/use_cases/generate_target.rb', line 545 def target return @target end |