Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually pass custom module name to SourceKitten #298

Merged
merged 2 commits into from
Sep 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Master

##### Breaking

* None.

##### Enhancements

* None.

##### Bug Fixes

* Fixed an issue that prevented building projects with different schema & module
names.
[JP Simard](https://github.com/jpsim)
[#259](https://github.com/realm/jazzy/issues/259)


## 0.3.1

##### Breaking
Expand Down
4 changes: 2 additions & 2 deletions lib/jazzy/doc_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def self.build(options)
if podspec = options.podspec
stdout = PodspecDocumenter.new(podspec).sourcekitten_output
else
stdout = Dir.chdir(Config.instance.source_directory) do
arguments = ['doc'] + options.xcodebuild_arguments
stdout = Dir.chdir(options.source_directory) do
arguments = SourceKitten.arguments_from_options(options)
SourceKitten.run_sourcekitten(arguments)
end
end
Expand Down
10 changes: 10 additions & 0 deletions lib/jazzy/sourcekitten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def self.subdir_for_doc(doc, parents)
end
end

# Builds SourceKitten arguments based on Jazzy options
def self.arguments_from_options(options)
arguments = ['doc']
unless options.module_name.empty?
arguments += ['--module-name', options.module_name]
end
arguments += options.xcodebuild_arguments
arguments
end

# Run sourcekitten with given arguments and return STDOUT
def self.run_sourcekitten(arguments)
xcode = XCInvoke::Xcode.find_swift_version(Config.instance.swift_version)
Expand Down