diff --git a/.rubocop.yml b/.rubocop.yml index 8d72959f8..de26cbba0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -221,6 +221,9 @@ Metrics/ModuleLength: Metrics/BlockLength: Enabled: false +Metrics/ParameterLists: + CountKeywordArgs: false + Style/NumericPredicate: Enabled: false diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index ea45eb198..324bf6233 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -13,16 +13,17 @@ class Config # rubocop:disable Naming/AccessorMethodName class Attribute attr_reader :name, :description, :command_line, :config_file_key, - :default, :parse + :default, :parse, :per_module def initialize(name, description: nil, command_line: nil, - default: nil, parse: ->(x) { x }) + default: nil, parse: ->(x) { x }, per_module: false) @name = name.to_s @description = Array(description) @command_line = Array(command_line) @default = default @parse = parse @config_file_key = full_command_line_name || @name + @per_module = per_module end def get(config) @@ -51,7 +52,6 @@ def configured?(config) end def attach_to_option_parser(config, opt) - return if command_line.empty? opt.on(*command_line, *description) do |val| @@ -135,22 +135,26 @@ def hide_objc? config_attr :objc_mode, command_line: '--[no-]objc', description: 'Generate docs for Objective-C.', - default: false + default: false, + per_module: true config_attr :umbrella_header, command_line: '--umbrella-header PATH', description: 'Umbrella header for your Objective-C framework.', - parse: ->(uh) { expand_path(uh) } + parse: ->(uh) { expand_path(uh) }, + per_module: true config_attr :framework_root, command_line: '--framework-root PATH', description: 'The root path to your Objective-C framework.', - parse: ->(fr) { expand_path(fr) } + parse: ->(fr) { expand_path(fr) }, + per_module: true config_attr :sdk, command_line: '--sdk [iphone|watch|appletv][os|simulator]|macosx', description: 'The SDK for which your code should be built.', - default: 'macosx' + default: 'macosx', + per_module: true config_attr :hide_declarations, command_line: '--hide-declarations [objc|swift] ', @@ -176,12 +180,14 @@ def hide_objc? command_line: ['-b', '--build-tool-arguments arg1,arg2,…argN', Array], description: 'Arguments to forward to xcodebuild, swift build, or ' \ 'sourcekitten.', - default: [] + default: [], + per_module: true config_attr :modules, - description: 'Array of modules that are going to be documented ' \ - 'It will contain arguments: - name, build-tool-arguments arg1,arg2,…argN, source_directory.', - default: false + command_line: ['--modules Mod1,Mod2,…ModN', Array], + description: 'List of modules to document. Use the config file to set per-module ' \ + 'build flags, see xxxREADMExxx.', + default: [] alias_config_attr :xcodebuild_arguments, :build_tool_arguments, command_line: ['-x', '--xcodebuild-arguments arg1,arg2,…argN', Array], @@ -191,19 +197,23 @@ def hide_objc? command_line: ['-s', '--sourcekitten-sourcefile filepath1,…filepathN', Array], description: 'File(s) generated from sourcekitten output to parse', - parse: ->(paths) { [paths].flatten.map { |path| expand_path(path) } } + parse: ->(paths) { [paths].flatten.map { |path| expand_path(path) } }, + default: [], + per_module: true config_attr :source_directory, command_line: '--source-directory DIRPATH', description: 'The directory that contains the source to be documented', default: Pathname.pwd, - parse: ->(sd) { expand_path(sd) } + parse: ->(sd) { expand_path(sd) }, + per_module: true config_attr :symbolgraph_directory, command_line: '--symbolgraph-directory DIRPATH', description: 'A directory containing a set of Swift Symbolgraph files ' \ 'representing the module to be documented', - parse: ->(sd) { expand_path(sd) } + parse: ->(sd) { expand_path(sd) }, + per_module: true config_attr :excluded_files, command_line: ['-e', '--exclude filepath1,filepath2,…filepathN', Array], @@ -267,7 +277,8 @@ def hide_objc? config_attr :module_name, command_line: ['-m', '--module MODULE_NAME'], description: 'Name of module being documented. (e.g. RealmSwift)', - default: '' + default: '', + per_module: true config_attr :version, command_line: '--module-version VERSION', @@ -516,10 +527,12 @@ def self.parse! if config.root_url config.dash_url ||= URI.join( config.root_url, - "docsets/#{config.module_name}.xml", + "docsets/#{config.module_name}.xml", # XXX help ) end - + + config.set_module_configs + config.validate config @@ -575,12 +588,13 @@ def parse_config_file puts "Using config file #{config_path}" config_file = read_config_file(config_path) - attrs_by_conf_key, attrs_by_name = %i[config_file_key name].map do |prop| - self.class.all_config_attrs.group_by(&prop) - end + attrs_by_conf_key, attrs_by_name = grouped_attributes + parse_config_hash(config_file, attrs_by_conf_key, attrs_by_name) + end - config_file.each do |key, value| + def parse_config_hash(hash, attrs_by_conf_key, attrs_by_name, override: false) + hash.each do |key, value| unless attr = attrs_by_conf_key[key] message = "Unknown config file attribute #{key.inspect}" if matching_name = attrs_by_name[key] @@ -590,10 +604,19 @@ def parse_config_file warning message next end - attr.first.set_if_unconfigured(self, value) + setter = override ? :set : :set_if_unconfigured + attr.first.method(setter).call(self, value) end + end - self.base_path = nil + # Find keyed versions of the attributes, by config file key and then name-in-code + # Optional block allows filtering/overriding of attribute list. + def grouped_attributes + attrs = self.class.all_config_attrs + attrs = yield attrs if block_given? + %i[config_file_key name].map do |property| + attrs.group_by(&property) + end end def validate @@ -604,20 +627,95 @@ def validate '`source_host_url` or `source_host_files_url`.' end + if modules_configured && module_name_configured + raise 'Options `modules` and `module` are both set. See ' \ + 'XXX readme URL XXX.' + end + + if modules_configured && podspec_configured + raise 'Options `modules` and `podspec` are both set. See ' \ + 'XXX readme URL XXX.' + end + + module_configs.each(&:validate_module) + end + + def validate_module if objc_mode && build_tool_arguments_configured && (framework_root_configured || umbrella_header_configured) warning 'Option `build_tool_arguments` is set: values passed to ' \ '`framework_root` or `umbrella_header` may be ignored.' end + end - if modules_configured && module_name_configured - raise 'Jazzy only allows the use of a single command for generating documentation.' \ - 'Using both module configuration and modules configuration together is not supported.' + # rubocop:enable Metrics/MethodLength + + # Module Configs + # + # The user can enter module information in three different ways. This + # consolidates them into one view for the rest of the code. + # + # 1) Single module, back-compatible + # --module Foo etc etc (or not given at all) + # + # 2) Multiple modules, simple, sharing build params + # --modules Foo,Bar,Baz --source-directory Xyz + # + # 3) Multiple modules, custom, different build params but + # inheriting others from the top level. + # This is config-file only. + # - modules + # - module: Foo + # source_directory: Xyz + # build_tool_arguments: [a, b, c] + # + # After this we're left with `config.module_configs` that is an + # array of `Config` objects. + + attr_reader :module_configs + attr_reader :module_names + + def set_module_configs + @module_configs = parse_module_configs + @module_names = module_configs.map(&:module_name) + @module_names_set = Set.new(module_names) + end + + def module_name?(name) + @module_names_set.include?(name) + end + + def parse_module_configs + return [self] unless modules_configured + + raise 'Config file key `modules` must be an array' unless modules.is_a?(Array) + + if modules.first.is_a?(String) + # Massage format (2) into (3) + self.modules = modules.map { { 'module' => _1 } } + end + + # Allow per-module overrides of only some config options + attrs_by_conf_key, attrs_by_name = + grouped_attributes { _1.select(&:per_module) } + + modules.map do |module_hash| + mod_name = module_hash['module'] || '' + raise 'Missing `modules.module` config key' if mod_name.empty? + + dup.tap do |module_config| + module_config.parse_config_hash( + module_hash, attrs_by_conf_key, attrs_by_name, override: true + ) + end end end - # rubocop:enable Metrics/MethodLength + # For podspec query + def module_name_known? + module_name_configured || modules_configured + end def locate_config_file return config_file if config_file diff --git a/lib/jazzy/doc.rb b/lib/jazzy/doc.rb index 69b18842b..d5c499290 100644 --- a/lib/jazzy/doc.rb +++ b/lib/jazzy/doc.rb @@ -48,9 +48,9 @@ def docs_title elsif config.version_configured # Fake version for integration tests version = ENV['JAZZY_FAKE_MODULE_VERSION'] || config.version - "#{config.module_name} #{version} Docs" + "#{config.module_configs.first.module_name} #{version} Docs" # XXX help else - "#{config.module_name} Docs" + "#{config.module_configs.first.module_name} Docs" # XXX end end diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb index 81903a7a5..e396c4531 100644 --- a/lib/jazzy/doc_builder.rb +++ b/lib/jazzy/doc_builder.rb @@ -67,40 +67,25 @@ def self.children_for_doc(doc) # Build documentation from the given options # @param [Config] options - # @return [SourceModule] the documented source module def self.build(options) - if options.modules_configured - stdout = multiple_modules(options) - elsif options.sourcekitten_sourcefile_configured - stdout = "[#{options.sourcekitten_sourcefile.map(&:read).join(',')}]" - elsif options.podspec_configured - pod_documenter = PodspecDocumenter.new(options.podspec) - stdout = pod_documenter.sourcekitten_output(options) - elsif options.swift_build_tool == :symbolgraph - stdout = SymbolGraph.build(options) - else - stdout = Dir.chdir(options.source_directory) do - arguments = SourceKitten.arguments_from_options(options) - SourceKitten.run_sourcekitten(arguments) + module_jsons = options.module_configs.map do |module_config| + if module_config.podspec_configured + # Config#validate guarantees not multi-module here + pod_documenter = PodspecDocumenter.new(options.podspec) + pod_documenter.sourcekitten_output(options) + elsif !module_config.sourcekitten_sourcefile.empty? + "[#{module_config.sourcekitten_sourcefile.map(&:read).join(',')}]" + elsif module_config.swift_build_tool == :symbolgraph + SymbolGraph.build(module_config) + else + Dir.chdir(module_config.source_directory) do + arguments = SourceKitten.arguments_from_options(module_config) + SourceKitten.run_sourcekitten(arguments) + end end end - build_docs_for_sourcekitten_output(stdout, options) - end - - # Build Xcode project for multiple modules and parse the api documentation into a string - # @param [Config] options - # @return String the documented source module - def self.multiple_modules(options) - modules_parsed = Array[] - options.modules.each do |arguments| - module_parsed_string = Dir.chdir(arguments['source_directory']) do - arguments = SourceKitten.arguments_from_options(options) + (arguments['build_tool_arguments']||[]) - SourceKitten.run_sourcekitten(arguments) - end - modules_parsed.push(module_parsed_string) - end - stdout = "[#{modules_parsed.join(',')}]" + build_docs_for_sourcekitten_output(module_jsons, options) end # Build & write HTML docs to disk from structured docs array @@ -165,16 +150,15 @@ def self.build_site(docs, coverage, options) end # Build docs given sourcekitten output - # @param [String] sourcekitten_output Output of sourcekitten command + # @param [Array] sourcekitten_output Output of sourcekitten command for each module # @param [Config] options Build options - # @return [SourceModule] the documented source module def self.build_docs_for_sourcekitten_output(sourcekitten_output, options) (docs, stats) = SourceKitten.parse( sourcekitten_output, options, DocumentationGenerator.source_docs, ) - + prepare_output_dir(options.output, options.clean) stats.report @@ -464,4 +448,4 @@ def self.document(source_module, doc_model, path_to_root) end # rubocop:enable Metrics/MethodLength end -end \ No newline at end of file +end diff --git a/lib/jazzy/podspec_documenter.rb b/lib/jazzy/podspec_documenter.rb index c6a3587ec..382d40e33 100644 --- a/lib/jazzy/podspec_documenter.rb +++ b/lib/jazzy/podspec_documenter.rb @@ -52,7 +52,7 @@ def self.apply_config_defaults(podspec, config) config.author_name = author_name(podspec) config.author_name_configured = true end - unless config.module_name_configured + unless config.module_name_known? config.module_name = podspec.module_name config.module_name_configured = true end diff --git a/lib/jazzy/source_declaration.rb b/lib/jazzy/source_declaration.rb index 7643b3351..7578bbb52 100644 --- a/lib/jazzy/source_declaration.rb +++ b/lib/jazzy/source_declaration.rb @@ -114,7 +114,7 @@ def display_other_language_declaration attr_accessor :column attr_accessor :usr attr_accessor :type_usr - attr_accessor :modulename + attr_accessor :module_name attr_accessor :name attr_accessor :objc_name attr_accessor :declaration @@ -140,6 +140,11 @@ def display_other_language_declaration attr_accessor :inherited_types attr_accessor :async + # The name of the module being documented that contains this + # declaration. Only different from module_name when this is + # an extension of a type from another module. Nil for guides. + attr_accessor :doc_module_name + def usage_discouraged? unavailable || deprecated end @@ -183,12 +188,20 @@ def other_inherited_types?(unwanted) inherited_types.any? { |t| !unwanted.include?(t) } end - # Pre-Swift 5.6: SourceKit only sets modulename for imported modules - # Swift 5.6+: modulename is always set + # Pre-Swift 5.6: SourceKit only sets module_name for imported modules + # Swift 5.6+: module_name is always set def type_from_doc_module? !type.extension? || (swift? && usr && - (modulename.nil? || modulename == Config.instance.module_name)) + (module_name.nil? || module_name == doc_module_name)) + end + + # Don't ask the user to write documentation for types being extended + # from other modules. Compile errors leave no docs and a `nil` USR. + def mark_undocumented? + !swift? || (usr && + (module_name.nil? || + Config.instance.module_name?(module_name))) end # Info text for contents page by collapsed item name diff --git a/lib/jazzy/source_module.rb b/lib/jazzy/source_module.rb index c0cc63376..c9d4991ab 100644 --- a/lib/jazzy/source_module.rb +++ b/lib/jazzy/source_module.rb @@ -21,7 +21,7 @@ def initialize(options, docs, doc_structure, doc_coverage) self.docs = docs self.doc_structure = doc_structure self.doc_coverage = doc_coverage - self.name = options.module_name + self.name = options.module_configs.first.module_name # XXX what actually is this type for self.author_name = options.author_name self.author_url = options.author_url self.host = SourceHost.create(options) diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb index 5c51e4d87..f2417dfda 100644 --- a/lib/jazzy/sourcekitten.rb +++ b/lib/jazzy/sourcekitten.rb @@ -71,13 +71,12 @@ def self.group_docs(docs) end # Group root-level docs by module name - def self.group_docs_per_module(docs, modules) - modules = modules.map { |mod| mod['name']} + def self.group_docs_per_module(docs, config) categories, extra = navigation_module_section( - docs, modules + docs, config.module_names ) - merge_categories(categories) + self.group_docs(extra) + merge_categories(categories) + group_docs(extra) end def self.group_custom_categories(docs) @@ -110,32 +109,36 @@ def self.group_type_categories(docs, type_category_prefix) [group.compact, docs] end + # rubocop:disable Metrics/MethodLength XXX tmp def self.navigation_module_section(docs, modules) - group = modules.map do |modulename| - children, docs = docs.partition { |doc| doc.modulename == modulename } + group = modules.map do |module_name| + children, docs = docs.partition { |doc| doc.module_name == module_name } make_group( children, - modulename, - "", + module_name, + '', ) end # Get from the remaining docs if there are extensions that should also be part of this module. - group = group.compact.map { |group| - newDocs = docs - .select { |doc| doc.children.map { |doc| doc.modulename }.include?(group.name) } - .map { |doc| + group = group.compact.map do |group2| + new_docs = docs + .select { |doc| doc.children.map(&:module_name).include?(group2.name) } + .map do |doc| newdoc = doc.clone - newdoc.children, doc.children = doc.children.partition { |doc| doc.modulename == group.name } - newdoc.name = group.name + "+" + newdoc.name + newdoc.children, doc.children = + doc.children.partition { _1.module_name == group2.name } + newdoc.name = group2.name + '+' + newdoc.name + newdoc.doc_module_name = group2.name # XXX not really but for now newdoc - } - group.children = group.children + newDocs - group - } + end + group2.children = group2.children + new_docs + group2 + end - [group, docs.select { |doc| !doc.children.empty?()}] + [group, docs.reject { |doc| doc.children.empty? }] end + # rubocop:enable Metrics/MethodLength XXX tmp # Join categories with the same name (eg. ObjC and Swift classes) def self.merge_categories(categories) @@ -247,48 +250,42 @@ def self.rec_path(path) end.select { |x| x }.flatten(1) end - def self.use_spm?(options) - options.swift_build_tool == :spm || - (!options.swift_build_tool_configured && + def self.use_spm?(module_config) + module_config.swift_build_tool == :spm || + (!module_config.swift_build_tool_configured && Dir['*.xcodeproj', '*.xcworkspace'].empty? && - !options.build_tool_arguments.include?('-project') && - !options.build_tool_arguments.include?('-workspace')) + !module_config.build_tool_arguments.include?('-project') && + !module_config.build_tool_arguments.include?('-workspace')) end # Builds SourceKitten arguments based on Jazzy options - def self.arguments_from_options(options) + def self.arguments_from_options(module_config) arguments = ['doc'] - if options.objc_mode - arguments += objc_arguments_from_options(options) + if module_config.objc_mode + arguments += objc_arguments_from_options(module_config) else - arguments += ['--spm'] if use_spm?(options) - unless options.module_name.empty? - arguments += ['--module-name', options.module_name] + arguments += ['--spm'] if use_spm?(module_config) + unless module_config.module_name.empty? + arguments += ['--module-name', module_config.module_name] end arguments += ['--'] end - - if options.modules_configured - arguments - else - arguments + options.build_tool_arguments - end - end - + arguments + module_config.build_tool_arguments + end - def self.objc_arguments_from_options(options) + def self.objc_arguments_from_options(module_config) arguments = [] - if options.build_tool_arguments.empty? - arguments += ['--objc', options.umbrella_header.to_s, '--', '-x', + if module_config.build_tool_arguments.empty? + arguments += ['--objc', module_config.umbrella_header.to_s, '--', '-x', 'objective-c', '-isysroot', - `xcrun --show-sdk-path --sdk #{options.sdk}`.chomp, - '-I', options.framework_root.to_s, + `xcrun --show-sdk-path --sdk #{module_config.sdk}`.chomp, + '-I', module_config.framework_root.to_s, '-fmodules'] end # add additional -I arguments for each subdirectory of framework_root - unless options.framework_root.nil? - rec_path(Pathname.new(options.framework_root.to_s)).collect do |child| + unless module_config.framework_root.nil? + rec_path(Pathname.new(module_config.framework_root.to_s)).collect do |child| if child.directory? arguments += ['-I', child.to_s] end @@ -395,18 +392,10 @@ def self.should_document_swift_extension?(doc) end end - # Call things undocumented if they were compiled properly - # and came from our module. - def self.should_mark_undocumented(declaration) - declaration.usr && - (declaration.modulename.nil? || - declaration.modulename == Config.instance.module_name) - end - def self.process_undocumented_token(doc, declaration) make_default_doc_info(declaration) - if !declaration.swift? || should_mark_undocumented(declaration) + if declaration.mark_undocumented? @stats.add_undocumented(declaration) return nil if @skip_undocumented @@ -664,7 +653,14 @@ def self.make_source_declarations(docs, parent = nil, mark = SourceMark.new) declaration.file = Pathname(doc['key.filepath']) if doc['key.filepath'] declaration.usr = doc['key.usr'] declaration.type_usr = doc['key.typeusr'] - declaration.modulename = doc['key.modulename'] + declaration.module_name = + if declaration.swift? + doc['key.modulename'] + else + # ObjC best effort, category original module is unavailable + @current_module_name + end + declaration.doc_module_name = @current_module_name declaration.name = documented_name declaration.mark = current_mark declaration.access_control_level = @@ -732,7 +728,8 @@ def self.expand_extension(extension, name_parts, decls) SourceDeclaration.new.tap do |decl| make_default_doc_info(decl) decl.name = name - decl.modulename = extension.modulename + decl.module_name = extension.module_name + decl.doc_module_name = extension.doc_module_name decl.type = extension.type decl.mark = extension.mark decl.usr = candidates.first.usr unless candidates.empty? @@ -763,9 +760,9 @@ def self.deduplicate_declarations(declarations) # Returns true if an Objective-C declaration is mergeable. def self.mergeable_objc?(decl, root_decls) - decl.type.objc_class? \ - || (decl.type.objc_category? \ - && name_match(decl.objc_category_name[0], root_decls)) + decl.type.objc_class? || + (decl.type.objc_category? && + name_match(decl.objc_category_name[0], root_decls)) end # Returns if a Swift declaration is mergeable. @@ -1128,13 +1125,20 @@ def self.reject_objc_types(docs) # Parse sourcekitten STDOUT output as JSON # @return [Hash] structured docs + # rubocop:disable Metrics/MethodLength XXX tmp def self.parse(sourcekitten_output, options, inject_docs) @min_acl = options.min_acl @skip_undocumented = options.skip_undocumented @stats = Stats.new @inaccessible_protocols = [] - sourcekitten_json = filter_files(JSON.parse(sourcekitten_output).flatten) - docs = make_source_declarations(sourcekitten_json).concat inject_docs + + # Process each module separately to inject the source module name + docs = sourcekitten_output.zip(options.module_names).map do |json, name| + @current_module_name = name + sourcekitten_dicts = filter_files(JSON.parse(json).flatten) + make_source_declarations(sourcekitten_dicts) + end.flatten + inject_docs + docs = expand_extensions(docs) docs = deduplicate_declarations(docs) docs = reject_objc_types(docs) @@ -1142,16 +1146,18 @@ def self.parse(sourcekitten_output, options, inject_docs) # than min_acl docs = docs.reject { |doc| doc.type.swift_enum_element? } ungrouped_docs = docs - if options.modules_configured - docs = group_docs_per_module(docs, options.modules) - else - docs = group_docs(docs) - end - + docs = + if options.module_configs.count > 1 # XXX need a --merge-modules or something + group_docs_per_module(docs, options) + else + group_docs(docs) + end + merge_consecutive_marks(docs) make_doc_urls(docs) autolink(docs, ungrouped_docs) [docs, @stats] end + # rubocop:enable Metrics/MethodLength XXX tmp end end diff --git a/lib/jazzy/symbol_graph.rb b/lib/jazzy/symbol_graph.rb index abe228ed0..38e5e0bfa 100644 --- a/lib/jazzy/symbol_graph.rb +++ b/lib/jazzy/symbol_graph.rb @@ -20,10 +20,10 @@ module SymbolGraph # with configured args. # Then parse the results, and return as JSON in SourceKit[ten] # format. - def self.build(config) - if config.symbolgraph_directory.nil? + def self.build(module_config) + if module_config.symbolgraph_directory.nil? Dir.mktmpdir do |tmp_dir| - args = arguments(config, tmp_dir) + args = arguments(module_config, tmp_dir) Executable.execute_command('swift', args.unshift('symbolgraph-extract'), @@ -32,17 +32,17 @@ def self.build(config) parse_symbols(tmp_dir) end else - parse_symbols(config.symbolgraph_directory.to_s) + parse_symbols(module_config.symbolgraph_directory.to_s) end end # Figure out the args to pass to symbolgraph-extract - def self.arguments(config, output_path) - if config.module_name.empty? + def self.arguments(module_config, output_path) + if module_config.module_name.empty? raise 'error: `--swift-build-tool symbolgraph` requires `--module`.' end - user_args = config.build_tool_arguments.join + user_args = module_config.build_tool_arguments.join if user_args =~ /-(?:module-name|minimum-access-level|output-dir)/ raise 'error: `--build-tool-arguments` for ' \ @@ -52,19 +52,19 @@ def self.arguments(config, output_path) # Default set args = [ - '-module-name', config.module_name, + '-module-name', module_config.module_name, '-minimum-access-level', 'private', '-output-dir', output_path, '-skip-synthesized-members' ] # Things user can override - args += ['-sdk', sdk(config)] unless user_args =~ /-sdk/ + args += ['-sdk', sdk(module_config)] unless user_args =~ /-sdk/ args += ['-target', target] unless user_args =~ /-target/ - args += ['-F', config.source_directory.to_s] unless user_args =~ /-F(?!s)/ - args += ['-I', config.source_directory.to_s] unless user_args =~ /-I/ + args += ['-F', module_config.source_directory.to_s] unless user_args =~ /-F(?!s)/ + args += ['-I', module_config.source_directory.to_s] unless user_args =~ /-I/ - args + config.build_tool_arguments + args + module_config.build_tool_arguments end # Parse the symbol files in the given directory @@ -84,8 +84,8 @@ def self.parse_symbols(directory) end # Get the SDK path. On !darwin this just isn't needed. - def self.sdk(config) - `xcrun --show-sdk-path --sdk #{config.sdk}`.chomp + def self.sdk(module_config) + `xcrun --show-sdk-path --sdk #{module_config.sdk}`.chomp end # Guess a default LLVM target. Feels like the tool should figure this