Class: XcodeArchiveCache::Injection::BuildFlagsChanger

Inherits:
Object
  • Object
show all
Includes:
Logs
Defined in:
lib/injection/build_flags_changer.rb

Instance Method Summary collapse

Methods included from Logs

#debug, #error, #info, #set_log_level

Instance Method Details

#add_capital_i_path(build_configuration, path) ⇒ Object

Parameters:



93
94
95
96
# File 'lib/injection/build_flags_changer.rb', line 93

def add_capital_i_path(build_configuration, path)
  debug("using -I path #{path}")
  add_cflag(build_configuration, path_to_capital_i(path))
end

#add_framework_headers_iquote(build_configuration, artifact_location, node) ⇒ Object

Parameters:



60
61
62
63
64
# File 'lib/injection/build_flags_changer.rb', line 60

def add_framework_headers_iquote(build_configuration, artifact_location, node)
  headers_search_path = get_framework_headers_iquote(artifact_location, node)
  debug("using -iquote path #{headers_search_path}")
  add_cflag(build_configuration, headers_search_path)
end

#add_framework_linker_flag(build_configuration, node) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/injection/build_flags_changer.rb', line 18

def add_framework_linker_flag(build_configuration, node)
  linker_flag = get_framework_linker_flag(node)
  if linker_flag
    debug("using linker flag #{linker_flag}")
    add_linker_flag(build_configuration, linker_flag)
  end
end

#add_headers_search_path(build_configuration, path) ⇒ Object

Parameters:



77
78
79
80
# File 'lib/injection/build_flags_changer.rb', line 77

def add_headers_search_path(build_configuration, path)
  debug("using headers search path #{path}")
  add_flag_to_configuration(build_configuration, HEADER_SEARCH_PATHS_KEY, path)
end

#add_iquote_path(build_configuration, path) ⇒ Object

Parameters:



85
86
87
88
# File 'lib/injection/build_flags_changer.rb', line 85

def add_iquote_path(build_configuration, path)
  debug("using -iquote path #{path}")
  add_cflag(build_configuration, path_to_iquote(path))
end

#add_static_lib_libtool_flag(build_configuration, node) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/injection/build_flags_changer.rb', line 40

def add_static_lib_libtool_flag(build_configuration, node)
  flag = get_linker_flag(node)
  if flag
    debug("using libtool flag #{flag}")
    add_libtool_flag(build_configuration, flag)
  end
end

#add_static_lib_linker_flag(build_configuration, node) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/injection/build_flags_changer.rb', line 29

def add_static_lib_linker_flag(build_configuration, node)
  flag = get_linker_flag(node)
  if flag
    debug("using ld flag #{flag}")
    add_linker_flag(build_configuration, flag)
  end
end

#add_swift_include_path(build_configuration, path) ⇒ Object

Parameters:



51
52
53
54
# File 'lib/injection/build_flags_changer.rb', line 51

def add_swift_include_path(build_configuration, path)
  debug("adding #{path} to SWIFT_INCLUDE_PATHS")
  add_flag_to_configuration(build_configuration, SWIFT_INCLUDE_PATHS_KEY, path_to_search_path(path))
end

#fix_module_map_path(build_configuration, old_modulemap_names, path) ⇒ Object

Parameters:



102
103
104
105
106
107
# File 'lib/injection/build_flags_changer.rb', line 102

def fix_module_map_path(build_configuration, old_modulemap_names, path)
  debug("using #{path}")

  settings_with_modulemaps = [OTHER_CFLAGS_KEY, OTHER_CPLUSPLUSFLAGS_KEY, OTHER_SWIFT_FLAGS_KEY]
  replace_or_add_flag(build_configuration, settings_with_modulemaps, MODULE_MAP_FLAG, old_modulemap_names, path_to_search_path(path), false)
end

#replace_or_add_framework_search_path(build_configuration, target_name, path) ⇒ Object

Parameters:



10
11
12
13
# File 'lib/injection/build_flags_changer.rb', line 10

def replace_or_add_framework_search_path(build_configuration, target_name, path)
  debug("using framework search path #{path}")
  replace_or_add_flag(build_configuration, [FRAMEWORK_SEARCH_PATHS_KEY], nil, [target_name], path_to_search_path(path), true)
end

#replace_or_add_library_search_path(build_configuration, target_name, path) ⇒ Object

Parameters:



69
70
71
72
# File 'lib/injection/build_flags_changer.rb', line 69

def replace_or_add_library_search_path(build_configuration, target_name, path)
  debug("using library search path #{path}")
  replace_or_add_flag(build_configuration, [LIBRARY_SEARCH_PATHS_KEY], nil, [target_name], path_to_search_path(path), true)
end