Class: Phoenx::ApplicationTargetBuilder

Inherits:
TestableTargetBuilder show all
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

Methods inherited from TestableTargetBuilder

#add_schemes, #add_test_targets, #generate_target_scheme, #sort_build_phases

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, #initialize

Constructor Details

This class inherits a constructor from Phoenx::TargetBuilder

Instance Method Details

#add_sub_projectsObject



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/phoenx/use_cases/generate_target.rb', line 381

def add_sub_projects

	super
	
	frameworks_group = @project.main_group.find_subpath(FRAMEWORKS_ROOT,false)
	
	@target_spec.dependencies.each do |dp|
	
		file = nil
		
		if dp.embed == false
		
			next
		
		end
		
		if dp.path == nil
		
			# Copy internal references
		
			target = Phoenx.target_for_name(@project,dp.target_name)
			
			build_file = @copy_frameworks.add_file_reference(target.product_reference)
			build_file.settings = ATTRIBUTES_CODE_SIGN_ON_COPY
		
		else
		
			# Copy external products
		
			proj_file = frameworks_group.find_file_by_path(dp.path)
			proj = Xcodeproj::Project::open(dp.path)
			
			target = Phoenx.target_for_name(proj,dp.target_name)
			
			proj_file.file_reference_proxies.each do |e|
			
				if e.remote_ref.remote_global_id_string == target.product_reference.uuid
					
					build_file = @copy_frameworks.add_file_reference(e)
					build_file.settings = ATTRIBUTES_CODE_SIGN_ON_COPY
				
				end
			
			end
			
		end
		
		
	
	end
	
end

#buildObject



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/phoenx/use_cases/generate_target.rb', line 434

def build

	@target = @project.new_target(@target_spec.target_type, @target_spec.name, @target_spec.platform, @target_spec.version)
	@copy_frameworks = @target.new_copy_files_build_phase "Embed Frameworks"
	@copy_frameworks.symbol_dst_subfolder_spec = :frameworks

	super()
	
	self.framework_files.each do |file|

		build_file = @copy_frameworks.add_file_reference(file)
		build_file.settings = ATTRIBUTES_CODE_SIGN_ON_COPY

	end
end

#targetObject



450
451
452
453
454
# File 'lib/phoenx/use_cases/generate_target.rb', line 450

def target

	return @target

end