Class: HMap::Target

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/hmap/xc/target/target.rb,
lib/hmap/xc/target/target_helper.rb,
lib/hmap/xc/target/target_context.rb

Defined Under Namespace

Modules: Helper Classes: TargetContext

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#build_as_framework?, #build_as_framework_swift?, #build_dir, #build_root, #context, #defines_module?, #full_product_name, #hmap_root, #product_name, #target_name, #temp_dir, #temp_name, #uses_swift?

Methods included from HeaderType

#headers_hash, #private_entrys, #project_entrys, #public_entrys, #use_vfs?

Constructor Details

#initialize(entrys, target, project) ⇒ Target

Returns a new instance of Target.



13
14
15
16
17
# File 'lib/hmap/xc/target/target.rb', line 13

def initialize(entrys, target, project)
  @entrys = entrys || []
  @target = target
  @project = project
end

Instance Attribute Details

#entrysObject (readonly)

Returns the value of attribute entrys.



11
12
13
# File 'lib/hmap/xc/target/target.rb', line 11

def entrys
  @entrys
end

#projectObject (readonly)

Returns the value of attribute project.



11
12
13
# File 'lib/hmap/xc/target/target.rb', line 11

def project
  @project
end

#targetObject (readonly)

Returns the value of attribute target.



11
12
13
# File 'lib/hmap/xc/target/target.rb', line 11

def target
  @target
end

Instance Method Details

#platformsObject



19
20
21
# File 'lib/hmap/xc/target/target.rb', line 19

def platforms
  project.platforms
end

#remove_hmap_settings!Object



36
37
38
# File 'lib/hmap/xc/target/target.rb', line 36

def remove_hmap_settings!
  xcconfig_paths.each { |path| HMap::XcodeprojHelper.new(path).remove_build_settings_and_save }
end

#save_hmap_settings!Object



29
30
31
32
33
34
# File 'lib/hmap/xc/target/target.rb', line 29

def save_hmap_settings!
  xcconfig_paths.each do |path|
    settings = Constants.instance.hmap_build_settings(build_as_framework?)
    XcodeprojHelper.new(path).add_build_settings_and_save(settings, use_origin: Resolver.instance.use_origin)
  end
end

#write_hmapfile!Object



23
24
25
26
27
# File 'lib/hmap/xc/target/target.rb', line 23

def write_hmapfile!
  datas = headers_hash(:own_target_headers)
  build_settings = BuildSettingsWriter.new(platforms, context)
  build_settings.write_or_symlink(project.context.hmap_root, datas, Constants::HMAP_FILE_TYPE)
end