You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unrecognized arguments: -I, -I, -I
from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.0/lib/jazzy/sourcekitten.rb:221:in `run_sourcekitten'
from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.0/lib/jazzy/doc_builder.rb:66:in `block in build'
from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.0/lib/jazzy/doc_builder.rb:64:in `chdir'
from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.0/lib/jazzy/doc_builder.rb:64:in `build'
from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.0/bin/jazzy:15:in `<top (required)>'
from /usr/local/bin/jazzy:22:in `load'
from /usr/local/bin/jazzy:22:in `<main>'
The -I flags are required to go at the end so a valid command is:
# Builds SourceKitten arguments based on Jazzy options
def self.arguments_from_options(options)
arguments = ['doc']
arguments += if options.objc_mode
objc_arguments_from_options(options) ### <---------- 1) This is called
elsif !options.module_name.empty?
['--module-name', options.module_name, '--']
else
['--']
end
arguments + options.xcodebuild_arguments ### <---------- 3) Before this
end
def self.objc_arguments_from_options(options)
arguments = []
if options.xcodebuild_arguments.empty?
arguments += ['--objc', options.umbrella_header.to_s, '--', '-x',
'objective-c', '-isysroot',
`xcrun --show-sdk-path --sdk #{options.sdk}`.chomp,
'-I', options.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|
if child.directory?
arguments += ['-I', child.to_s] ### <---------- 2) Which adds these
end
end
end
arguments
end
Meaning that you could probably do:
# Builds SourceKitten arguments based on Jazzy options
def self.arguments_from_options(options)
arguments = ['doc']
arguments += if options.objc_mode
objc_arguments_from_options(options)
elsif !options.module_name.empty?
['--module-name', options.module_name, '--']
else
['--']
end
arguments + options.xcodebuild_arguments
# 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|
if child.directory?
arguments += ['-I', child.to_s]
end
end
end
end
def self.objc_arguments_from_options(options)
arguments = []
if options.xcodebuild_arguments.empty?
arguments += ['--objc', options.umbrella_header.to_s, '--', '-x',
'objective-c', '-isysroot',
`xcrun --show-sdk-path --sdk #{options.sdk}`.chomp,
'-I', options.framework_root.to_s,
'-fmodules']
end
arguments
end
The text was updated successfully, but these errors were encountered:
Thanks for the report. Jazzy doesn't expect the user to do both --xcodebuild-arguments and --framework-root. We definitely need to improve the documentation of Objective-C mode and make the code more robust.
johnfairh
changed the title
objc_arguments_from_options is prepending -I which causes Unrecognized arguments: -I error
Objc mode bad handling of -x and --framework-root together
Nov 10, 2017
It looks like the #603 #518 added the ability to recursively add subdirs, by added
-I
parameters.However, if you also specify
xcodebuild-arguments
then the additional arguments are prepended to the command creating:Which fails with the following error:
The
-I
flags are required to go at the end so a valid command is:I've highlighted where I think the problem lies:
Meaning that you could probably do:
The text was updated successfully, but these errors were encountered: