Skip to content

Commit

Permalink
Remove CryptoSwift dependency if not needed (realm#2485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim authored Nov 27, 2018
1 parent 4f8838a commit 45dd66b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 27 deletions.
1 change: 0 additions & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github "Carthage/Commandant" ~> 0.15.0
github "jpsim/Yams" ~> 1.0.1
github "jspahrsummers/xcconfigs" ~> 0.12.0
github "krzyzanowskim/CryptoSwift" ~> 0.13.0
3 changes: 1 addition & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
github "Carthage/Commandant" "0.15.0"
github "antitypical/Result" "4.0.0"
github "drmohundro/SWXMLHash" "4.7.4"
github "drmohundro/SWXMLHash" "4.7.5"
github "jpsim/SourceKitten" "0.21.3"
github "jpsim/Yams" "1.0.1"
github "jspahrsummers/xcconfigs" "0.12"
github "krzyzanowskim/CryptoSwift" "0.13.0"
github "scottrhoyt/SwiftyTextTable" "0.8.2"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/SWXMLHash
13 changes: 2 additions & 11 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
"version": "0.15.0"
}
},
{
"package": "CryptoSwift",
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git",
"state": {
"branch": null,
"revision": "874280173e082cdd7ac6602be235914efe3f4dbc",
"version": "0.13.0"
}
},
{
"package": "Nimble",
"repositoryURL": "https://github.com/Quick/Nimble.git",
Expand Down Expand Up @@ -69,8 +60,8 @@
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
"state": {
"branch": null,
"revision": "b130217d81833cecd7ddf78b76d60200f1070d98",
"version": "4.7.4"
"revision": "26b7613546db50e1b260999ca1d8e74679c4ee9a",
"version": "4.7.5"
}
},
{
Expand Down
12 changes: 8 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// swift-tools-version:4.0
import PackageDescription

#if canImport(CommonCrypto)
private let addCryptoSwift = false
#else
private let addCryptoSwift = true
#endif

let package = Package(
name: "SwiftLint",
products: [
Expand All @@ -11,9 +17,8 @@ let package = Package(
.package(url: "https://github.com/Carthage/Commandant.git", from: "0.15.0"),
.package(url: "https://github.com/jpsim/SourceKitten.git", from: "0.21.3"),
.package(url: "https://github.com/jpsim/Yams.git", from: "1.0.1"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "0.13.0"),
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.8.2"),
],
] + (addCryptoSwift ? [.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "0.13.0")] : []),
targets: [
.target(
name: "swiftlint",
Expand All @@ -26,10 +31,9 @@ let package = Package(
.target(
name: "SwiftLintFramework",
dependencies: [
"CryptoSwift",
"SourceKittenFramework",
"Yams",
]
] + (addCryptoSwift ? ["CryptoSwift"] : [])
),
.testTarget(
name: "SwiftLintFrameworkTests",
Expand Down
4 changes: 0 additions & 4 deletions SwiftLint.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@
8F6B3154213CDCD100858E44 /* UnusedPrivateDeclarationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F6B3153213CDCD100858E44 /* UnusedPrivateDeclarationRule.swift */; };
8F715B83213B528B00427BD9 /* UnusedImportRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F715B82213B528B00427BD9 /* UnusedImportRule.swift */; };
8F8050821FFE0CBB006F5B93 /* Configuration+IndentationStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F8050811FFE0CBB006F5B93 /* Configuration+IndentationStyle.swift */; };
8FB2AE2F21A1F99200D380F3 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FB2AE2E21A1F99200D380F3 /* CryptoSwift.framework */; };
8FB2AE3021A1F99F00D380F3 /* CryptoSwift.framework in Embed Frameworks into SwiftLintFramework.framework */ = {isa = PBXBuildFile; fileRef = 8FB2AE2E21A1F99200D380F3 /* CryptoSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8FC8523B2117BDDE0015269B /* ExplicitSelfRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FC8523A2117BDDE0015269B /* ExplicitSelfRule.swift */; };
8FC9F5111F4B8E48006826C1 /* IsDisjointRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FC9F5101F4B8E48006826C1 /* IsDisjointRule.swift */; };
8FD216CC205584AF008ED13F /* CharacterSet+SwiftLint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD216CB205584AF008ED13F /* CharacterSet+SwiftLint.swift */; };
Expand Down Expand Up @@ -404,7 +402,6 @@
dstPath = SwiftLintFramework.framework/Versions/Current/Frameworks;
dstSubfolderSpec = 10;
files = (
8FB2AE3021A1F99F00D380F3 /* CryptoSwift.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2A1CFEF729003239EB /* Commandant.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2C1CFEF72D003239EB /* Result.framework in Embed Frameworks into SwiftLintFramework.framework */,
6CCFCF2D1CFEF731003239EB /* SourceKittenFramework.framework in Embed Frameworks into SwiftLintFramework.framework */,
Expand Down Expand Up @@ -827,7 +824,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8FB2AE2F21A1F99200D380F3 /* CryptoSwift.framework in Frameworks */,
E876BFBE1B07828500114ED5 /* SourceKittenFramework.framework in Frameworks */,
E8C0DFCD1AD349DB007EE3D4 /* SWXMLHash.framework in Frameworks */,
3BBF2F9D1C640A0F006CD775 /* SwiftyTextTable.framework in Frameworks */,
Expand Down
3 changes: 0 additions & 3 deletions SwiftLint.xcworkspace/contents.xcworkspacedata

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

1 change: 0 additions & 1 deletion SwiftLintFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Pod::Spec.new do |s|
s.platform = :osx, '10.10'
s.source_files = 'Source/SwiftLintFramework/**/*.swift'
s.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
s.dependency 'CryptoSwift', '~> 0.13'
s.dependency 'SourceKittenFramework', '~> 0.21'
s.dependency 'Yams', '~> 1.0'
end

0 comments on commit 45dd66b

Please sign in to comment.