Skip to content

Commit

Permalink
Add support for Swift 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mtynior committed Nov 2, 2016
1 parent a74c76d commit 066daa9
Show file tree
Hide file tree
Showing 17 changed files with 253 additions and 226 deletions.
28 changes: 28 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
disabled_rules: # rule identifiers to exclude from running
- force_cast
- trailing_whitespace
- control_statement
- type_name
- variable_name
- force_try
# Find all the available rules by running:
# swiftlint rules

included: # paths to include during linting. `--path` is ignored if present.


excluded: # paths to ignore during linting. Takes precedence over `included`.

# parameterized rules can be customized from this configuration file
line_length: 256

function_parameter_count:
- 30
- 40

# parameterized rules are first parameterized as a warning level, then error level.
type_body_length:
- 500 # warning
- 1000 # error

#reporter: "csv" # reporter type (xcode, json, csv, checkstyle)
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Change Log

#### 1.x Releases
- `1.x.x` Releases - [1.x.0](#1xx)
- `1.x.x` Releases - [1.4.0](#140)
- `1.3.x` Releases - [1.3.0](#130)
- `1.2.x` Releases - [1.2.0](#120)
- `1.1.x` Releases - [1.1.0](#110)
- `1.0.x` Releases - [1.0.0](#100)

---
## [1.X.X](https://github.com/mtynior/Felucia/releases/tag/1.X.X)#
Released on 2016-XX-XX.
## [1.4.0](https://github.com/mtynior/Felucia/releases/tag/1.4.0)
Released on 2016-11-01.

#### Added
- Support for Swift Package Manager
Expand Down
87 changes: 72 additions & 15 deletions Felucia.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
900EE6D51CAFF124004AF16A /* Felucia.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Felucia.framework; sourceTree = BUILT_PRODUCTS_DIR; };
900FFDBA1C0E1B6200B0A2B5 /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = "<group>"; };
900FFDBC1C135BCE00B0A2B5 /* FeluciaTestsHSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeluciaTestsHSL.swift; sourceTree = "<group>"; };
901927F91DCA1741000481D7 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .swiftlint.yml; sourceTree = "<group>"; };
901927FE1DCA1A90000481D7 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
901927FF1DCA1A90000481D7 /* Felucia.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Felucia.podspec; sourceTree = "<group>"; };
901928001DCA1A90000481D7 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = "<group>"; };
901928011DCA1A90000481D7 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
9061C9241BD5602900A191B7 /* Felucia.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Felucia.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9061C92E1BD5602900A191B7 /* FeluciaTests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FeluciaTests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9061C9331BD5602900A191B7 /* FeluciaTestsRGBAInteger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeluciaTestsRGBAInteger.swift; sourceTree = "<group>"; };
Expand All @@ -48,9 +53,7 @@
90A178191C0BB4F30096F9BE /* FeluciaTestsHexColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeluciaTestsHexColor.swift; sourceTree = "<group>"; };
90F814781D23B22700583FA0 /* Felucia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Felucia.h; sourceTree = "<group>"; };
90F814791D23B22700583FA0 /* Felucia.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Felucia.swift; sourceTree = "<group>"; };
90F8147A1D23B22700583FA0 /* Info-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
90F8147B1D23B22700583FA0 /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = "<group>"; };
90F8147C1D23B22700583FA0 /* Info-watchOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-watchOS.plist"; sourceTree = "<group>"; };
90F8147A1D23B22700583FA0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
90F814861D23B2DD00583FA0 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -90,6 +93,11 @@
9061C91A1BD5602900A191B7 = {
isa = PBXGroup;
children = (
901927FE1DCA1A90000481D7 /* CHANGELOG.md */,
901927FF1DCA1A90000481D7 /* Felucia.podspec */,
901928001DCA1A90000481D7 /* LICENSE.md */,
901928011DCA1A90000481D7 /* README.md */,
901927F91DCA1741000481D7 /* .swiftlint.yml */,
90F814861D23B2DD00583FA0 /* Package.swift */,
90F814771D23B22700583FA0 /* Source */,
9061C9321BD5602900A191B7 /* FeluciaTests */,
Expand Down Expand Up @@ -128,9 +136,7 @@
children = (
90F814781D23B22700583FA0 /* Felucia.h */,
90F814791D23B22700583FA0 /* Felucia.swift */,
90F8147A1D23B22700583FA0 /* Info-iOS.plist */,
90F8147B1D23B22700583FA0 /* Info-tvOS.plist */,
90F8147C1D23B22700583FA0 /* Info-watchOS.plist */,
90F8147A1D23B22700583FA0 /* Info.plist */,
);
path = Source;
sourceTree = "<group>";
Expand Down Expand Up @@ -173,6 +179,7 @@
900EE6BF1CAFEFF9004AF16A /* Frameworks */,
900EE6C01CAFEFF9004AF16A /* Headers */,
900EE6C11CAFEFF9004AF16A /* Resources */,
901927FC1DCA1794000481D7 /* ShellScript */,
);
buildRules = (
);
Expand All @@ -191,6 +198,7 @@
900EE6D11CAFF124004AF16A /* Frameworks */,
900EE6D21CAFF124004AF16A /* Headers */,
900EE6D31CAFF124004AF16A /* Resources */,
901927FD1DCA17A1000481D7 /* ShellScript */,
);
buildRules = (
);
Expand All @@ -209,6 +217,7 @@
9061C9201BD5602900A191B7 /* Frameworks */,
9061C9211BD5602900A191B7 /* Headers */,
9061C9221BD5602900A191B7 /* Resources */,
901927FB1DCA1780000481D7 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -243,7 +252,7 @@
9061C91B1BD5602900A191B7 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "Michał Tynior";
TargetAttributes = {
900EE6C21CAFEFF9004AF16A = {
Expand All @@ -257,10 +266,12 @@
};
9061C9231BD5602900A191B7 = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 0810;
};
9061C92D1BD5602900A191B7 = {
CreatedOnToolsVersion = 7.1;
DevelopmentTeam = SGZ6FVQB6B;
LastSwiftMigration = 0810;
};
};
};
Expand Down Expand Up @@ -315,6 +326,48 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
901927FB1DCA1780000481D7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
901927FC1DCA1794000481D7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
901927FD1DCA17A1000481D7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
900EE6BE1CAFEFF9004AF16A /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -375,14 +428,13 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-watchOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
PRODUCT_NAME = Felucia;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
Expand All @@ -398,15 +450,14 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-watchOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
PRODUCT_NAME = Felucia;
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
Expand All @@ -421,7 +472,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-tvOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
Expand All @@ -442,7 +493,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-tvOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
Expand All @@ -468,8 +519,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -497,6 +550,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0.1;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -516,8 +570,10 @@
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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -537,6 +593,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 3.0.1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -553,7 +610,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-iOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
Expand All @@ -572,7 +629,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info-iOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.tynior.Felucia;
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 = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "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 = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "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 = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
16 changes: 8 additions & 8 deletions FeluciaTests/FeluciaTestsCMYK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import XCTest
class FeluciaTestsCMYK: XCTestCase {

func test_ShouldCreateColorFromCMYK() {
let expectedTuple : (r: Float, g:Float, b:Float, a:Float) = (0.5, 0.25, 0.125, 1.0)
let accuracy:Float = 0.005
let expectedTuple : (r: Float, g: Float, b: Float, a: Float) = (0.5, 0.25, 0.125, 1.0)
let accuracy: Float = 0.005

let color = UIColor(cyan: 0, magneta: 0.5, yellow: 0.75, black: 0.498)

Expand All @@ -23,8 +23,8 @@ class FeluciaTestsCMYK: XCTestCase {
}

func test_ShouldReturnTupleWithCMYKCompoments() {
let expectedTuple : (c: Float, m:Float, y:Float, k:Float) = (0, 0.5, 0.75, 0.498)
let accuracy:Float = 0.001
let expectedTuple : (c: Float, m: Float, y: Float, k: Float) = (0, 0.5, 0.75, 0.498)
let accuracy: Float = 0.001

let color = UIColor(cyan: 0, magneta: 0.5, yellow: 0.75, black: 0.498)

Expand All @@ -34,8 +34,8 @@ class FeluciaTestsCMYK: XCTestCase {
}

func test_ShouldReturnTupleWithCMYKCompomentsFromRGBAColor() {
let expectedTuple : (c: Float, m:Float, y:Float, k:Float) = (0.711, 0.533, 0.0, 0.118)
let accuracy:Float = 0.001
let expectedTuple : (c: Float, m: Float, y: Float, k: Float) = (0.711, 0.533, 0.0, 0.118)
let accuracy: Float = 0.001

let color = UIColor(r: 65, g: 105, b: 225, a: 255)

Expand All @@ -45,8 +45,8 @@ class FeluciaTestsCMYK: XCTestCase {
}

func test_ShouldReturnArrayWithCMYKCompoments() {
let expectedArray:[Float] = [0, 0.5, 0.75, 0.498]
let accuracy:Float = 0.001
let expectedArray: [Float] = [0, 0.5, 0.75, 0.498]
let accuracy: Float = 0.001

let color = UIColor(cyan: 0, magneta: 0.5, yellow: 0.75, black: 0.498)

Expand Down
Loading

0 comments on commit 066daa9

Please sign in to comment.