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

Update to Xcode 9.3 #86

Merged
merged 6 commits into from
Apr 27, 2018
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defaults:
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
BUNDLE_PATH: vendor/bundle
macos:
xcode: "9.2.0"
xcode: "9.3.0"
shell: /bin/bash --login -eo pipefail
- &prepare-storage
run:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.4.2
2.3.7
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
[Ilya Puchka](https://github.com/ilyapuchka)
[#85](https://github.com/SwiftGen/StencilSwiftKit/pull/85)

### Breaking Changes

_None_

### New Features

_None_

### Internal Changes

* Updated to latest Xcode (9.3.0).
[David Jennes](https://github.com/djbe)
[#86](https://github.com/SwiftGen/StencilSwiftKit/pull/86)

## 2.5.0

### New Features
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ GEM
colored2 (3.1.2)
concurrent-ruby (1.0.5)
escape (0.0.4)
faraday (0.14.0)
faraday (0.15.0)
multipart-post (>= 1.2, < 3)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
Expand All @@ -64,14 +64,14 @@ GEM
octokit (4.8.0)
sawyer (~> 0.8.0, >= 0.5.3)
parallel (1.12.1)
parser (2.5.0.5)
parser (2.5.1.0)
ast (~> 2.4.0)
powerpack (0.1.1)
public_suffix (3.0.2)
rainbow (3.0.0)
rake (10.5.0)
rouge (2.0.7)
rubocop (0.54.0)
rubocop (0.55.0)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
Expand All @@ -86,7 +86,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
unicode-display_width (1.3.2)
xcodeproj (1.5.7)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ SPEC CHECKSUMS:
StencilSwiftKit: 6bad36133ce4dc2ef41728f35a5008e88e5fabf4
SwiftLint: ce933681be10c3266e82576dad676fa815a602e9

PODFILE CHECKSUM: 91d9757662443f93dea7d29530c891687e8c9248
PODFILE CHECKSUM: 0bd9ec310bace9d5b62e785ea1fb74547c15074d

COCOAPODS: 1.5.0
2 changes: 1 addition & 1 deletion Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Sources/Filters+Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ extension Filters.Strings {
/// e.g. "PeoplePicker" gives "peoplePicker" but "URLChooser" gives "urlChooser"
static func lowerFirstWord(_ value: Any?) throws -> Any? {
let string = try Filters.parseString(from: value)
let cs = CharacterSet.uppercaseLetters
let characterSet = CharacterSet.uppercaseLetters
let scalars = string.unicodeScalars
let start = scalars.startIndex
var idx = start
while let scalar = UnicodeScalar(scalars[idx].value), cs.contains(scalar) && idx <= scalars.endIndex {
while let scalar = UnicodeScalar(scalars[idx].value), characterSet.contains(scalar) && idx <= scalars.endIndex {
idx = scalars.index(after: idx)
}
if idx > scalars.index(after: start) && idx < scalars.endIndex,
Expand Down
10 changes: 2 additions & 8 deletions Sources/SwiftIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@ enum SwiftIdentifier {
let mappedParts = parts.map { (string: String) -> String in
// Can't use capitalizedString here because it will lowercase all letters after the first
// e.g. "SomeNiceIdentifier".capitalizedString will because "Someniceidentifier" which is not what we want
let ns = NSString(string: string)
if ns.length > 0 {
let firstLetter = ns.substring(to: 1)
let rest = ns.substring(from: 1)
return firstLetter.uppercased() + rest
} else {
return ""
}
guard let first = string.unicodeScalars.first else { return string }
return String(first).uppercased() + String(string.unicodeScalars.dropFirst())
}

let result = mappedParts.joined(separator: replacement)
Expand Down
6 changes: 5 additions & 1 deletion StencilSwiftKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = AliSoftware;
TargetAttributes = {
09A87B4F1BCCA2C600D9B9F5 = {
Expand Down Expand Up @@ -323,12 +323,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -375,12 +377,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand All @@ -47,7 +46,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Tests/StencilSwiftKitTests/CallNodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CallNodeTests: XCTestCase {
}

XCTAssertEqual(node.variableName, "myFunc")
let variables = node.arguments.flatMap { $0 as? FilterExpression }.flatMap { $0.variable }
let variables = node.arguments.compactMap { $0 as? FilterExpression }.compactMap { $0.variable }
XCTAssertEqual(variables, [Variable("a"), Variable("b"), Variable("c")])
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/StencilSwiftKitTests/TestsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ private let koCode = (num: colorCode("fg127,127,127") + colorCode("bg127,0,0"),
func diff(_ result: String, _ expected: String) -> String? {
guard result != expected else { return nil }
var firstDiff: Int? = nil
let nl = CharacterSet.newlines
let lhsLines = result.components(separatedBy: nl)
let rhsLines = expected.components(separatedBy: nl)
let newlines = CharacterSet.newlines
let lhsLines = result.components(separatedBy: newlines)
let rhsLines = expected.components(separatedBy: newlines)

for (idx, pair) in zip(lhsLines, rhsLines).enumerated() where pair.0 != pair.1 {
firstDiff = idx
Expand Down