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

Support Swift 1.2 #213

Merged
merged 4 commits into from
Apr 23, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 0.2.0

##### Breaking

* Jazzy now only supports projects using Swift 1.2.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two spaces

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are two spaces.

[JP Simard](https://github.com/jpsim)
[#170](https://github.com/realm/jazzy/issues/170)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

* Increase default minimum ACL to public.
[JP Simard](https://github.com/jpsim)
[#186](https://github.com/realm/jazzy/issues/186)

##### Enhancements

* Use key.accessibility to determine ACL.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either surround key.accessibility in backticks, or describe the what of the change rather than the how

[JP Simard](https://github.com/jpsim)
[#185](https://github.com/realm/jazzy/issues/185)

##### Bug Fixes

* None.


## 0.1.6

##### Breaking
Expand Down
2 changes: 1 addition & 1 deletion SourceKitten
Submodule SourceKitten updated 51 files
+4 −1 .gitmodules
+16 −0 CHANGELOG.md
+2 −1 Cartfile
+2 −2 Cartfile.private
+5 −4 Cartfile.resolved
+1 −1 Carthage/Checkouts/Commandant
+1 −1 Carthage/Checkouts/LlamaKit
+1 −0 Carthage/Checkouts/SWXMLHash
+1 −1 Carthage/Checkouts/SwiftXPC
+1 −1 Carthage/Checkouts/xcconfigs
+2 −2 README.md
+4 −5 Source/SourceKittenFramework/Array+SourceKitten.swift
+2 −2 Source/SourceKittenFramework/ClangTranslationUnit.swift
+29 −30 Source/SourceKittenFramework/File.swift
+1 −1 Source/SourceKittenFramework/Info.plist
+1 −1 Source/SourceKittenFramework/Language.swift
+1 −1 Source/SourceKittenFramework/Module.swift
+3 −4 Source/SourceKittenFramework/OffsetMap.swift
+0 −15 Source/SourceKittenFramework/Optional+SourceKitten.swift
+1 −2 Source/SourceKittenFramework/Request.swift
+0 −387 Source/SourceKittenFramework/SWXMLHash.swift
+1 −0 Source/SourceKittenFramework/SourceKittenFramework.h
+12 −12 Source/SourceKittenFramework/String+SourceKitten.swift
+3 −3 Source/SourceKittenFramework/Structure.swift
+1 −1 Source/SourceKittenFramework/SwiftDocKey.swift
+1 −1 Source/SourceKittenFramework/SwiftDocs.swift
+5 −4 Source/SourceKittenFramework/SwiftXPC+JSON.swift
+1 −1 Source/SourceKittenFramework/SyntaxKind.swift
+7 −11 Source/SourceKittenFramework/SyntaxMap.swift
+68 −69 Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json
+3,167 −0 Source/SourceKittenFrameworkTests/Fixtures/Commandant.json
+2 −1 Source/SourceKittenFrameworkTests/Fixtures/Subscript.json
+21 −11 Source/SourceKittenFrameworkTests/ModuleTests.swift
+3 −3 Source/SourceKittenFrameworkTests/OffsetMapTests.swift
+6 −2 Source/SourceKittenFrameworkTests/StructureTests.swift
+1 −1 Source/SourceKittenFrameworkTests/SwiftDocsTests.swift
+2 −2 Source/SourceKittenFrameworkTests/SyntaxTests.swift
+6 −0 Source/sourcekitten/Components.plist
+18 −23 Source/sourcekitten/Doc.swift
+14 −29 Source/sourcekitten/Errors.swift
+1 −1 Source/sourcekitten/Info.plist
+0 −63 Source/sourcekitten/Module+MultiProcess.swift
+11 −9 Source/sourcekitten/Structure.swift
+9 −9 Source/sourcekitten/Syntax.swift
+4 −4 Source/sourcekitten/Version.swift
+3 −4 Source/sourcekitten/main.swift
+3 −0 SourceKitten.xcworkspace/contents.xcworkspacedata
+2 −2 jazzy.sh
+25 −23 sourcekitten.xcodeproj/project.pbxproj
+1 −1 sourcekitten.xcodeproj/xcshareddata/xcschemes/SourceKittenFramework.xcscheme
+5 −3 sourcekitten.xcodeproj/xcshareddata/xcschemes/sourcekitten.xcscheme
1 change: 0 additions & 1 deletion lib/jazzy/SourceKitten/Commandant.framework/Modules

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14C1514</string>
<string>14D136</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -25,17 +25,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14A383</string>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0620</string>
<string>0631</string>
<key>DTXcodeBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 Carthage. All rights reserved.</string>
</dict>
Expand Down
1 change: 0 additions & 1 deletion lib/jazzy/SourceKitten/LlamaKit.framework/Modules

This file was deleted.

Binary file modified lib/jazzy/SourceKitten/LlamaKit.framework/Versions/A/LlamaKit
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14C1514</string>
<string>14D136</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -25,17 +25,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14A383</string>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0620</string>
<string>0631</string>
<key>DTXcodeBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 Rob Napier. All rights reserved.</string>
<key>UIDeviceFamily</key>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14D136</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>SWXMLHash</string>
<key>CFBundleIdentifier</key>
<string>drmohundro.SWXMLHash</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>SWXMLHash</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6D1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0631</string>
<key>DTXcodeBuild</key>
<string>6D1002</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
</plist>
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14C1514</string>
<string>14D136</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -17,25 +17,25 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14A383</string>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0620</string>
<string>0631</string>
<key>DTXcodeBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2014 JP Simard. All rights reserved.</string>
</dict>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>14C1514</string>
<string>14D136</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -17,25 +17,25 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.3.0</string>
<string>0.4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14A383</string>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0620</string>
<string>0631</string>
<key>DTXcodeBuild</key>
<string>6C131e</string>
<string>6D1002</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 SourceKitten. All rights reserved.</string>
</dict>
Expand Down
Binary file not shown.
Binary file modified lib/jazzy/SourceKitten/sourcekitten
Binary file not shown.
8 changes: 4 additions & 4 deletions lib/jazzy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize
self.clean = false
self.docset_platform = 'jazzy'
self.version = '1.0'
self.min_acl = SourceDeclaration::AccessControlLevel.internal
self.min_acl = SourceDeclaration::AccessControlLevel.public
self.skip_undocumented = false
self.source_directory = Pathname.pwd
end
Expand Down Expand Up @@ -126,11 +126,11 @@ def self.parse!

opt.on('--min-acl [private | internal | public]',
'minimum access control level to document \
(default is internal)') do |acl|
(default is public)') do |acl|
if acl == 'private'
config.min_acl = SourceDeclaration::AccessControlLevel.private
elsif acl == 'public'
config.min_acl = SourceDeclaration::AccessControlLevel.public
elsif acl == 'internal'
config.min_acl = SourceDeclaration::AccessControlLevel.internal
end
end

Expand Down
42 changes: 34 additions & 8 deletions lib/jazzy/source_declaration/access_control_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,52 @@ class AccessControlLevel

attr_reader :level

def initialize(declaration_string)
if declaration_string =~ /private\ /
ACCESSIBILITY_PRIVATE = 'source.lang.swift.accessibility.private'
ACCESSIBILITY_INTERNAL = 'source.lang.swift.accessibility.internal'
ACCESSIBILITY_PUBLIC = 'source.lang.swift.accessibility.public'

def initialize(accessibility)
if accessibility == ACCESSIBILITY_PRIVATE
@level = :private
elsif declaration_string =~ /public\ /
@level = :public
else
elsif accessibility == ACCESSIBILITY_INTERNAL
@level = :internal
elsif accessibility == ACCESSIBILITY_PUBLIC
@level = :public
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably throw an exception if its something unexpected?

end

def self.from_doc(doc)
accessibility = doc['key.accessibility']
if accessibility
acl = new(accessibility)
if acl
return acl
end
end
acl = from_explicit_declaration(doc['key.parsed_declaration'])
acl || AccessControlLevel.public # fallback on public ACL
end

def self.from_explicit_declaration(declaration_string)
if declaration_string =~ /private\ /
return AccessControlLevel.private
elsif declaration_string =~ /public\ /
return AccessControlLevel.public
elsif declaration_string =~ /internal\ /
return AccessControlLevel.internal
end
end

def self.private
AccessControlLevel.new('private ')
new(ACCESSIBILITY_PRIVATE)
end

def self.internal
AccessControlLevel.new('internal ')
new(ACCESSIBILITY_INTERNAL)
end

def self.public
AccessControlLevel.new('public ')
new(ACCESSIBILITY_PUBLIC)
end

LEVELS = {
Expand Down
Loading