Skip to content

Commit

Permalink
Merge pull request #888 from realm/jp-xcode9
Browse files Browse the repository at this point in the history
Improve Xcode 9 / Swift 4 support
  • Loading branch information
jpsim authored Sep 27, 2017
2 parents 8d2f551 + 06688fd commit 2e57c32
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
[#789](https://github.com/realm/jazzy/issues/789)
[#805](https://github.com/realm/jazzy/issues/805)

* Fix Swift 4 declarations containing ampersands (`&`) being truncated.
[JP Simard](https://github.com/jpsim)

## 0.8.3

##### Breaking
Expand Down
2 changes: 1 addition & 1 deletion SourceKitten
Submodule SourceKitten updated 46 files
+15 −1 .travis.yml
+36 −0 CHANGELOG.md
+4 −4 Cartfile.resolved
+1 −1 Carthage/Checkouts/Result
+1 −1 Carthage/Checkouts/SWXMLHash
+1 −1 Carthage/Checkouts/Yams
+1 −1 Carthage/Checkouts/xcconfigs
+1 −1 Makefile
+3 −3 [email protected]
+1 −1 README.md
+9 −2 Source/SourceKittenFramework/Clang+SourceKitten.swift
+0 −8 Source/SourceKittenFramework/CodeCompletionItem.swift
+3 −17 Source/SourceKittenFramework/File.swift
+1 −1 Source/SourceKittenFramework/Info.plist
+0 −13 Source/SourceKittenFramework/Language.swift
+31 −33 Source/SourceKittenFramework/LinuxCompatibility.swift
+0 −63 Source/SourceKittenFramework/ObjCDeclarationKind.swift
+0 −8 Source/SourceKittenFramework/OffsetMap.swift
+25 −58 Source/SourceKittenFramework/Request.swift
+41 −35 Source/SourceKittenFramework/SourceDeclaration.swift
+0 −8 Source/SourceKittenFramework/SourceLocation.swift
+0 −30 Source/SourceKittenFramework/StatementKind.swift
+9 −60 Source/SourceKittenFramework/String+SourceKitten.swift
+0 −120 Source/SourceKittenFramework/SwiftDeclarationKind.swift
+0 −108 Source/SourceKittenFramework/SwiftDocKey.swift
+0 −60 Source/SourceKittenFramework/SyntaxKind.swift
+0 −8 Source/SourceKittenFramework/SyntaxMap.swift
+1 −1 Source/SourceKittenFramework/Version.swift
+0 −6 Source/SourceKittenFramework/Xcode.swift
+5 −1 Source/SourceKittenFramework/library_wrapper.swift
+1 −1 Source/sourcekitten/Info.plist
+107 −92 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+0 −5,940 Tests/SourceKittenFrameworkTests/Fixtures/CommandantSPM.json
+0 −4,772 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+145 −145 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+252 −252 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+366 −366 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+268 −268 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+0 −5,347 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+198 −197 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+150 −150 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+30 −30 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+45 −45 Tests/SourceKittenFrameworkTests/Fixtures/[email protected]
+1 −20 Tests/SourceKittenFrameworkTests/ModuleTests.swift
+7 −7 sourcekitten.xcodeproj/project.pbxproj
+2 −0 sourcekitten.xcodeproj/xcshareddata/xcschemes/sourcekitten.xcscheme
Binary file modified bin/sourcekitten
Binary file not shown.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
xcode:
version: "8.3.2"
version: "9.0"

checkout:
post:
Expand Down
12 changes: 9 additions & 3 deletions lib/jazzy/podspec_documenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'json'

module Jazzy
# rubocop:disable Metrics/ClassLength
class PodspecDocumenter
attr_reader :podspec

Expand All @@ -14,7 +15,8 @@ def initialize(podspec)
def sourcekitten_output(config)
installation_root = Pathname(Dir.mktmpdir(['jazzy', podspec.name]))
installation_root.rmtree if installation_root.exist?
Pod::Config.instance.with_changes(installation_root: installation_root) do
Pod::Config.instance.with_changes(installation_root: installation_root,
verbose: false) do
sandbox = Pod::Sandbox.new(Pod::Config.instance.sandbox_root)
installer = Pod::Installer.new(sandbox, podfile)
installer.install!
Expand All @@ -25,7 +27,7 @@ def sourcekitten_output(config)

targets.map do |t|
args = %W[doc --module-name #{podspec.module_name} -- -target #{t}]
swift_version = (config.swift_version || '3')[0] + '.0'
swift_version = (config.swift_version || '4')[0] + '.0'
args << "SWIFT_VERSION=\"#{swift_version}\""
SourceKitten.run_sourcekitten(args)
end
Expand Down Expand Up @@ -117,8 +119,12 @@ def podfile
ss.available_platforms.each do |p|
# Travis builds take too long when building docs for all available
# platforms for the Moya integration spec, so we just document OSX.
# Also Moya's RxSwift subspec doesn't yet support Swift 4, so skip
# that too while we're at it.
# TODO: remove once jazzy is fast enough.
next if ENV['JAZZY_INTEGRATION_SPECS'] && p.name != :osx
if ENV['JAZZY_INTEGRATION_SPECS']
next if (p.name != :osx) || (ss.name == 'Moya/RxSwift')
end
target("Jazzy-#{ss.name.gsub('/', '__')}-#{p.name}") do
use_frameworks!
platform p.name, p.deployment_target
Expand Down
4 changes: 2 additions & 2 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@
behaves_like cli_spec 'document_siesta',
# Siesta already has Docs/
'--output api-docs',
# Use default Swift rather than the specified 3.0.2
'--swift-version='
# Use Swift 4 rather than the specified 3.0.2
'--swift-version=4'
end

describe 'Creates docs for Swift project with a variety of contents' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 484 files

0 comments on commit 2e57c32

Please sign in to comment.