From 939a3d7ce6078db3e321e3ee7ff3ade5b2997236 Mon Sep 17 00:00:00 2001 From: Marcin Krzyzanowski Date: Fri, 4 Oct 2019 13:23:40 +0200 Subject: [PATCH] Lipsticks --- .github/CODEOWNERS | 2 +- .github/ISSUE_TEMPLATE.md | 8 +- .github/ISSUE_TEMPLATE/bug_report.md | 8 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .pre-commit-config.yaml | 11 ++ .swift-version | 2 +- CNAME | 2 +- CryptoSwift-TestHostApp/AppDelegate.swift | 1 - CryptoSwift.playground/contents.xcplayground | 2 +- LICENSE | 6 +- README.md | 30 ++--- Sources/CryptoSwift/BlockDecryptor.swift | 2 +- Sources/CryptoSwift/BlockMode/GCM.swift | 4 +- Sources/CryptoSwift/ChaCha20.swift | 2 +- Tests/Tests/AESTests.swift | 26 ++--- Tests/Tests/ScryptTests.swift | 8 +- Tests/Tests/ScryptTestsPerf.swift | 2 +- Tests/TestsPerformance/TestsPerformance.swift | 10 +- _config.yml | 2 +- config/CryptoSwift-Debug.xcconfig | 4 +- config/CryptoSwift-Release.xcconfig | 16 +-- config/CryptoSwift-Shared.xcconfig | 26 ++--- config/CryptoSwift-Test.xcconfig | 14 +-- config/CryptoSwift-TestHostApp-Debug.xcconfig | 20 ++-- .../CryptoSwift-TestHostApp-Release.xcconfig | 12 +- .../CryptoSwift-TestHostApp-Shared.xcconfig | 10 +- config/CryptoSwift-TestHostApp-Test.xcconfig | 12 +- config/Project-Debug.xcconfig | 10 +- config/Project-Release.xcconfig | 14 +-- config/Project-Shared.xcconfig | 106 +++++++++--------- config/Project-Test.xcconfig | 16 +-- config/Tests-Debug.xcconfig | 4 +- config/Tests-Release.xcconfig | 14 +-- config/Tests-Shared.xcconfig | 13 +-- config/Tests-Test.xcconfig | 14 +-- scripts/build-framework.sh | 2 +- scripts/swiftformat.sh | 2 +- 37 files changed, 224 insertions(+), 215 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f0b3586b..2904e51a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @krzyzanowskim \ No newline at end of file +* @krzyzanowskim diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index d4f8a83e..1d385ab1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,7 @@ -- CryptoSwift version: -- Swift version: -- Platform (iOS/macOS/Linux/...): -- Installation method (CocoaPods/Carthage/SPM/...): +- CryptoSwift version: +- Swift version: +- Platform (iOS/macOS/Linux/...): +- Installation method (CocoaPods/Carthage/SPM/...): - Project name: # Description diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 574425a5..e8d970c1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,7 +9,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: -1. +1. **Sample code** @@ -23,9 +23,9 @@ Steps to reproduce the behavior: **Environment (please complete the following information):** -- Swift version: -- Platform (iOS/macOS/Linux/...): -- Installation method (CocoaPods/Carthage/SPM/...): +- Swift version: +- Platform (iOS/macOS/Linux/...): +- Installation method (CocoaPods/Carthage/SPM/...): - Project name: **Additional context** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e3b0b5f4..8d172fd9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,4 +6,4 @@ Checklist: - [ ] Tests added. Changes proposed in this pull request: -- +- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..ddf6ce49 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/psf/black + rev: 19.3b0 + hooks: + - id: black diff --git a/.swift-version b/.swift-version index 6e636605..819e07a2 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.0 \ No newline at end of file +5.0 diff --git a/CNAME b/CNAME index 6eb5932c..d7c8ffd4 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -cryptoswift.io \ No newline at end of file +cryptoswift.io diff --git a/CryptoSwift-TestHostApp/AppDelegate.swift b/CryptoSwift-TestHostApp/AppDelegate.swift index 104a9cc2..1ed9e965 100644 --- a/CryptoSwift-TestHostApp/AppDelegate.swift +++ b/CryptoSwift-TestHostApp/AppDelegate.swift @@ -49,4 +49,3 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } - diff --git a/CryptoSwift.playground/contents.xcplayground b/CryptoSwift.playground/contents.xcplayground index 3a493ef2..b2b05bb4 100644 --- a/CryptoSwift.playground/contents.xcplayground +++ b/CryptoSwift.playground/contents.xcplayground @@ -1,4 +1,4 @@ - \ No newline at end of file + diff --git a/LICENSE b/LICENSE index b70d6de9..e52af7df 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,11 @@ Copyright (C) 2014-2017 Marcin Krzyżanowski -This software is provided 'as-is', without any express or implied warranty. +This software is provided 'as-is', without any express or implied warranty. -In no event will the authors be held liable for any damages arising from the use of this software. +In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required. - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - This notice may not be removed or altered from any source or binary distribution. -- Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).' \ No newline at end of file +- Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).' diff --git a/README.md b/README.md index 044c7984..46d1bba3 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Check out [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to help To install CryptoSwift, add it as a submodule to your project (on the top level project directory): git submodule add https://github.com/krzyzanowskim/CryptoSwift.git - + It is recommended to enable [Whole-Module Optimization](https://swift.org/blog/whole-module-optimizations/) to gain better performance. Non-optimized build results in significantly worse performance. #### Embedded Framework @@ -160,8 +160,8 @@ pod 'CryptoSwift', :git => "https://github.com/krzyzanowskim/CryptoSwift", :bran Bear in mind that CocoaPods will build CryptoSwift without [Whole-Module Optimization](https://swift.org/blog/whole-module-optimizations/) that may impact performance. You can change it manually after installation, or use [cocoapods-wholemodule](https://github.com/jedlewison/cocoapods-wholemodule) plugin. -#### Carthage -You can use [Carthage](https://github.com/Carthage/Carthage). +#### Carthage +You can use [Carthage](https://github.com/Carthage/Carthage). Specify in Cartfile: ```ruby @@ -170,8 +170,8 @@ github "krzyzanowskim/CryptoSwift" Run `carthage` to build the framework and drag the built CryptoSwift.framework into your Xcode project. Follow [build instructions](https://github.com/Carthage/Carthage#getting-started). [Common issues](https://github.com/krzyzanowskim/CryptoSwift/issues/492#issuecomment-330822874). -#### Accio -You can use [Accio](https://github.com/JamitLabs/Accio). +#### Accio +You can use [Accio](https://github.com/JamitLabs/Accio). Specify in Package.swift: ```swift @@ -211,7 +211,7 @@ dependencies: [ See: [Package.swift - manual](http://blog.krzyzanowskim.com/2016/08/09/package-swift-manual/) --- - + ## How-to * [Basics (data types, conversion, ...)](#basics) @@ -290,7 +290,7 @@ let hash = data.sha1() let hash = data.sha224() let hash = data.sha256() let hash = data.sha384() -let hash = data.sha512() +let hash = data.sha512() ``` ```swift do { @@ -300,7 +300,7 @@ do { let result = try digest.finish() } catch { } ``` - + Hashing a String and printing result ```swift @@ -356,7 +356,7 @@ let key = try HKDF(password: password, salt: salt, variant: .sha256).calculate() ##### Data Padding - + Some content-encryption algorithms assume the input length is a multiple of `k` octets, where `k` is greater than one. For such algorithms, the input shall be padded. ```swift @@ -409,7 +409,7 @@ do { ###### Incremental updates -Incremental operations use instance of Cryptor and encrypt/decrypt one part at a time, this way you can save on memory for large files. +Incremental operations use instance of Cryptor and encrypt/decrypt one part at a time, this way you can save on memory for large files. ```swift do { @@ -443,9 +443,9 @@ do { let decrypted = try AES(key: key, blockMode: CBC(iv: iv), padding: .pkcs7).decrypt(encrypted) } catch { print(error) -} +} ``` - + AES without data padding ```swift @@ -454,7 +454,7 @@ let encrypted: Array = try! AES(key: Array("secret0key000000".utf8), bloc ``` Using convenience extensions - + ```swift let plain = Data( [0x01, 0x02, 0x03]) let encrypted = try! plain.encrypt(ChaCha20(key: key, iv: iv)) @@ -532,9 +532,9 @@ This distribution includes cryptographic software. The country in which you curr ## License Copyright (C) 2014-2017 Marcin Krzyżanowski -This software is provided 'as-is', without any express or implied warranty. +This software is provided 'as-is', without any express or implied warranty. -In no event will the authors be held liable for any damages arising from the use of this software. +In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: diff --git a/Sources/CryptoSwift/BlockDecryptor.swift b/Sources/CryptoSwift/BlockDecryptor.swift index 7990a402..3794c117 100644 --- a/Sources/CryptoSwift/BlockDecryptor.swift +++ b/Sources/CryptoSwift/BlockDecryptor.swift @@ -47,7 +47,7 @@ public class BlockDecryptor: Cryptor, Updatable { for var chunk in accumulatedWithoutSuffix.batched(by: blockSize) { if isLast || (accumulatedWithoutSuffix.count - processedBytesCount) >= blockSize { let isLastChunk = processedBytesCount + chunk.count == accumulatedWithoutSuffix.count - + if isLast, isLastChunk, var finalizingWorker = worker as? FinalizingDecryptModeWorker { chunk = try finalizingWorker.willDecryptLast(bytes: chunk + accumulated.suffix(worker.additionalBufferSize)) // tag size } diff --git a/Sources/CryptoSwift/BlockMode/GCM.swift b/Sources/CryptoSwift/BlockMode/GCM.swift index d9bf5d94..1d6d4afa 100644 --- a/Sources/CryptoSwift/BlockMode/GCM.swift +++ b/Sources/CryptoSwift/BlockMode/GCM.swift @@ -38,7 +38,7 @@ public final class GCM: BlockMode { private let iv: Array private let additionalAuthenticatedData: Array? private let mode: Mode - + /// Length of authentication tag, in bytes. /// For encryption, the value is given as init parameter. /// For decryption, the lenght of given authentication tag is used. @@ -126,7 +126,7 @@ final class GCMModeWorker: BlockModeWorker, FinalizingEncryptModeWorker, Finaliz } else { self.additionalBufferSize = 0 } - + // Assume nonce is 12 bytes long, otherwise initial counter would be calulated from GHASH // counter = GF.ghash(aad: [UInt8](), ciphertext: nonce) if iv.count == GCMModeWorker.nonceSize { diff --git a/Sources/CryptoSwift/ChaCha20.swift b/Sources/CryptoSwift/ChaCha20.swift index 250ee9d0..25c2323b 100644 --- a/Sources/CryptoSwift/ChaCha20.swift +++ b/Sources/CryptoSwift/ChaCha20.swift @@ -336,7 +336,7 @@ extension ChaCha20 { extension ChaCha20: Cryptors { //TODO: Use BlockEncryptor/BlockDecryptor - + public func makeEncryptor() -> Cryptor & Updatable { return ChaCha20.ChaChaEncryptor(chacha: self) } diff --git a/Tests/Tests/AESTests.swift b/Tests/Tests/AESTests.swift index c88c9a2c..1755cef9 100644 --- a/Tests/Tests/AESTests.swift +++ b/Tests/Tests/AESTests.swift @@ -320,7 +320,7 @@ final class AESTests: XCTestCase { do { let aes = try AES(key: key, blockMode: CTR(iv: iv), padding: .noPadding) var encryptor = try aes.makeEncryptor() - + let encrypted1 = try encryptor.update(withBytes: [0x00, 0x01, 0x02, 0x03] as [UInt8]) XCTAssertEqual(encrypted1, Array(hex: "d79d0344")) let encrypted2 = try encryptor.update(withBytes: [0x04, 0x05, 0x06, 0x07] as [UInt8]) @@ -521,69 +521,69 @@ extension AESTests { XCTAssertEqual(Array(encrypted), [UInt8](hex: "")) // C XCTAssertEqual(gcm.authenticationTag, [UInt8](hex: "0xcd33b28ac773f74ba00ed1f312572435")) // T (128-bit) } - + func testAESGCMTagLengthDetached() { // Test Case 2 let key = Array(hex: "0x00000000000000000000000000000000") let plaintext = Array(hex: "0x00000000000000000000000000000000") let iv = Array(hex: "0x000000000000000000000000") - + let gcm = GCM(iv: iv, tagLength: 12, mode: .detached) let aes = try! AES(key: key, blockMode: gcm, padding: .noPadding) let encrypted = try! aes.encrypt(plaintext) XCTAssertEqual(Array(encrypted), [UInt8](hex: "0388dace60b6a392f328c2b971b2fe78")) // C XCTAssertEqual(gcm.authenticationTag, [UInt8](hex: "ab6e47d42cec13bdf53a67b2")) // T (96-bit) - + // decrypt func decrypt(_ encrypted: Array) -> Array { let decGCM = GCM(iv: iv, authenticationTag: gcm.authenticationTag!, mode: .detached) let aes = try! AES(key: key, blockMode: decGCM, padding: .noPadding) return try! aes.decrypt(encrypted) } - + let decrypted = decrypt(encrypted) XCTAssertEqual(decrypted, plaintext) } - + func testAESGCMTagLengthCombined() { // Test Case 2 let key = Array(hex: "0x00000000000000000000000000000000") let plaintext = Array(hex: "0x00000000000000000000000000000000") let iv = Array(hex: "0x000000000000000000000000") - + let gcm = GCM(iv: iv, tagLength: 12, mode: .combined) let aes = try! AES(key: key, blockMode: gcm, padding: .noPadding) let encrypted = try! aes.encrypt(plaintext) XCTAssertEqual(Array(encrypted), [UInt8](hex: "0388dace60b6a392f328c2b971b2fe78ab6e47d42cec13bdf53a67b2")) // C XCTAssertEqual(gcm.authenticationTag, [UInt8](hex: "ab6e47d42cec13bdf53a67b2")) // T (96-bit) - + // decrypt func decrypt(_ encrypted: Array) -> Array { let decGCM = GCM(iv: iv, authenticationTag: gcm.authenticationTag!, mode: .combined) let aes = try! AES(key: key, blockMode: decGCM, padding: .noPadding) return try! aes.decrypt(encrypted) } - + let decrypted = decrypt(encrypted) XCTAssertEqual(decrypted, plaintext) } - + func testAESGCMTagLengthCombined2() { let key = Array(hex: "0x00000000000000000000000000000000") let plaintext = Array(hex: "0x0000000000000000000000000000000000000000") let iv = Array(hex: "0x000000000000") - + let gcm = GCM(iv: iv, tagLength: 12, mode: .combined) let aes = try! AES(key: key, blockMode: gcm, padding: .noPadding) let encrypted = try! aes.encrypt(plaintext) - + // decrypt func decrypt(_ encrypted: Array) -> Array { let decGCM = GCM(iv: iv, authenticationTag: gcm.authenticationTag!, mode: .combined) let aes = try! AES(key: key, blockMode: decGCM, padding: .noPadding) return try! aes.decrypt(encrypted) } - + let decrypted = decrypt(encrypted) XCTAssertEqual(decrypted, plaintext) } diff --git a/Tests/Tests/ScryptTests.swift b/Tests/Tests/ScryptTests.swift index 7a495cef..07c36b5f 100644 --- a/Tests/Tests/ScryptTests.swift +++ b/Tests/Tests/ScryptTests.swift @@ -17,7 +17,7 @@ import XCTest class Scrypt: XCTestCase { - + func testScrypt_0() { let password = Array("password".data(using: .ascii)!) let salt = Array("NaCl".data(using: .ascii)!) @@ -31,7 +31,7 @@ class Scrypt: XCTestCase { """.replacingOccurrences(of: " ", with: "").replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\t", with: "")) XCTAssertEqual(derived, expected) } - + func testScrypt_1() { let password = Array("pleaseletmein".data(using: .ascii)!) let salt = Array("SodiumChloride".data(using: .ascii)!) @@ -45,7 +45,7 @@ class Scrypt: XCTestCase { """.replacingOccurrences(of: " ", with: "").replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\t", with: "")) XCTAssertEqual(derived, expected) } - + // Takes too long to run in debug mode! func testScrypt_2() { #if !DEBUG @@ -62,7 +62,7 @@ class Scrypt: XCTestCase { XCTAssertEqual(derived, expected) #endif } - + static let allTests = [ ("testScrypt_0", testScrypt_0), ("testScrypt_1", testScrypt_1), diff --git a/Tests/Tests/ScryptTestsPerf.swift b/Tests/Tests/ScryptTestsPerf.swift index 4016e13a..3f498a70 100644 --- a/Tests/Tests/ScryptTestsPerf.swift +++ b/Tests/Tests/ScryptTestsPerf.swift @@ -26,7 +26,7 @@ class ScryptTestsPeft: XCTestCase { _ = try! CryptoSwift.Scrypt(password: password, salt: salt, dkLen: 64, N: N, r: 8, p: 1).calculate() } } - + } extension ScryptTestsPeft { diff --git a/Tests/TestsPerformance/TestsPerformance.swift b/Tests/TestsPerformance/TestsPerformance.swift index 90e50553..7b91e44a 100644 --- a/Tests/TestsPerformance/TestsPerformance.swift +++ b/Tests/TestsPerformance/TestsPerformance.swift @@ -9,27 +9,27 @@ import XCTest class TestsPerformance: XCTestCase { - + override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } - + override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } - + func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } - + func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } - + } diff --git a/_config.yml b/_config.yml index c4192631..277f1f2c 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-cayman \ No newline at end of file +theme: jekyll-theme-cayman diff --git a/config/CryptoSwift-Debug.xcconfig b/config/CryptoSwift-Debug.xcconfig index d54da94d..151c73bd 100644 --- a/config/CryptoSwift-Debug.xcconfig +++ b/config/CryptoSwift-Debug.xcconfig @@ -9,7 +9,7 @@ // Other Swift Flags -// +// // A list of additional flags to pass to the Swift compiler. OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -debug-time-function-bodies @@ -30,7 +30,7 @@ SWIFT_OPTIMIZATION_LEVEL = -Onone // Exclusive Access to Memory -// +// // Enforce exclusive access to memory SWIFT_ENFORCE_EXCLUSIVE_ACCESS = none diff --git a/config/CryptoSwift-Release.xcconfig b/config/CryptoSwift-Release.xcconfig index 891a8953..53869c4f 100644 --- a/config/CryptoSwift-Release.xcconfig +++ b/config/CryptoSwift-Release.xcconfig @@ -13,7 +13,7 @@ BITCODE_GENERATION_MODE = bitcode // Use Optimization Profile -// +// // When this setting is enabled, `clang` will use the optimization profile collected for // a target when building it. @@ -22,7 +22,7 @@ CLANG_USE_OPTIMIZATION_PROFILE = NO // Generate Debug Symbols -// +// // Enables or disables generation of debug symbols. When debug symbols are enabled, the // level of detail can be controlled by the `DEBUG_INFORMATION_FORMAT` setting. @@ -31,7 +31,7 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = NO // Unroll Loops -// +// // Unrolls loops. Unrolling makes the code larger, but may make it faster by reducing the // number of branches executed. @@ -40,9 +40,9 @@ GCC_UNROLL_LOOPS = YES // Link-Time Optimization -// +// // Enabling this setting allows optimization across file boundaries during linking. -// +// // * *No:* Disabled. Do not use link-time optimization. // * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time // optimization of binaries, combining all executable code into a single unit and running @@ -57,7 +57,7 @@ LLVM_LTO = YES // Disable Safety Checks -// +// // Disable runtime safety checks when optimizing. SWIFT_DISABLE_SAFETY_CHECKS = YES @@ -65,7 +65,7 @@ SWIFT_DISABLE_SAFETY_CHECKS = YES // Exclusive Access to Memory -// +// // Enforce exclusive access to memory SWIFT_ENFORCE_EXCLUSIVE_ACCESS = compile-time @@ -73,7 +73,7 @@ SWIFT_ENFORCE_EXCLUSIVE_ACCESS = compile-time // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] diff --git a/config/CryptoSwift-Shared.xcconfig b/config/CryptoSwift-Shared.xcconfig index 6dd3c3a4..a890b12a 100644 --- a/config/CryptoSwift-Shared.xcconfig +++ b/config/CryptoSwift-Shared.xcconfig @@ -8,7 +8,7 @@ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES // Require Only App-Extension-Safe API -// +// // When enabled, this causes the compiler and linker to disallow use of APIs that are not // available to app extensions and to disallow linking to frameworks that have not been // built with this setting enabled. @@ -18,7 +18,7 @@ APPLICATION_EXTENSION_API_ONLY = YES // Compatibility Version -// +// // Determines the compatibility version of the resulting library, bundle, or framework // binary. See [Dynamic Library Design // Guidelines](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW19) @@ -31,7 +31,7 @@ DYLIB_COMPATIBILITY_VERSION = 1 // Current Library Version -// +// // This setting defines the current version of any framework built by the project. As // with `CURRENT_PROJECT_VERSION`, the value must be an integer or floating point number, // such as `57` or `365.8`. By default, it is set to `$(CURRENT_PROJECT_VERSION)`. See @@ -46,7 +46,7 @@ DYLIB_CURRENT_VERSION = 1 // Dynamic Library Install Name Base -// +// // Sets the base value for the internal `install path` (`LC_ID_DYLIB`) in a dynamic // library. This will be combined with the `EXECUTABLE_PATH` to form the full install // path. Setting `LD_DYLIB_INSTALL_NAME` directly will override this setting. This @@ -58,7 +58,7 @@ DYLIB_INSTALL_NAME_BASE = @rpath // Enable Bitcode -// +// // Activating this setting indicates that the target or project should generate bitcode // during compilation for platforms and architectures that support it. For Archive // builds, bitcode will be generated in the linked binary for submission to the App @@ -70,7 +70,7 @@ ENABLE_BITCODE = YES // Enable Bitcode -// +// // Activating this setting indicates that the target or project should generate bitcode // during compilation for platforms and architectures that support it. For Archive // builds, bitcode will be generated in the linked binary for submission to the App @@ -82,7 +82,7 @@ ENABLE_BITCODE[sdk=macosx*] = NO // Installation Directory -// +// // The directory in which to install the build products. This path is prepended by the // `DSTROOT`. @@ -90,7 +90,7 @@ INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks // Runpath Search Paths -// +// // This is a list of paths to be added to the `runpath` search path list for the image // being created. At runtime, `dyld` uses the `runpath` when searching for dylibs whose // load path begins with `@rpath/`. See [Dynamic Library Programming @@ -110,7 +110,7 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/ INFOPLIST_FILE = Sources/CryptoSwift/Info.plist // Product Bundle Identifier -// +// // A string that uniquely identifies the bundle. The string should be in reverse DNS // format using only alphanumeric characters (`A-Z`, `a-z`, `0-9`), the dot (`.`), and // the hyphen (`-`). This value is used as the `CFBundleIdentifier` in the `Info.plist` @@ -121,7 +121,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.krzyzanowskim.${PRODUCT_NAME:rfc1034identifier} // Product Name -// +// // This is the basename of the product generated by the target. PRODUCT_NAME = $(TARGET_NAME) @@ -129,7 +129,7 @@ PRODUCT_NAME = $(TARGET_NAME) // Skip Install -// +// // If enabled, don't install built products even if deployment locations are active. SKIP_INSTALL = YES @@ -137,8 +137,8 @@ SKIP_INSTALL = YES // Swift Language Version -// -// +// +// SWIFT_VERSION = 5.0 diff --git a/config/CryptoSwift-Test.xcconfig b/config/CryptoSwift-Test.xcconfig index a5fd16b5..87f66648 100644 --- a/config/CryptoSwift-Test.xcconfig +++ b/config/CryptoSwift-Test.xcconfig @@ -13,7 +13,7 @@ BITCODE_GENERATION_MODE = bitcode // Unroll Loops -// +// // Unrolls loops. Unrolling makes the code larger, but may make it faster by reducing the // number of branches executed. @@ -22,9 +22,9 @@ GCC_UNROLL_LOOPS = YES // Link-Time Optimization -// +// // Enabling this setting allows optimization across file boundaries during linking. -// +// // * *No:* Disabled. Do not use link-time optimization. // * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time // optimization of binaries, combining all executable code into a single unit and running @@ -39,7 +39,7 @@ LLVM_LTO = YES // Other Swift Flags -// +// // A list of additional flags to pass to the Swift compiler. OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -debug-time-function-bodies @@ -47,7 +47,7 @@ OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -debug-time-function-bodies // Disable Safety Checks -// +// // Disable runtime safety checks when optimizing. SWIFT_DISABLE_SAFETY_CHECKS = YES @@ -55,7 +55,7 @@ SWIFT_DISABLE_SAFETY_CHECKS = YES // Exclusive Access to Memory -// +// // Enforce exclusive access to memory SWIFT_ENFORCE_EXCLUSIVE_ACCESS = compile-time @@ -63,7 +63,7 @@ SWIFT_ENFORCE_EXCLUSIVE_ACCESS = compile-time // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] diff --git a/config/CryptoSwift-TestHostApp-Debug.xcconfig b/config/CryptoSwift-TestHostApp-Debug.xcconfig index 04f3bb21..c00ea0a8 100644 --- a/config/CryptoSwift-TestHostApp-Debug.xcconfig +++ b/config/CryptoSwift-TestHostApp-Debug.xcconfig @@ -9,9 +9,9 @@ // Debug Information Format -// +// // The type of debug information to produce. -// +// // * *DWARF:* Object files and linked products will use DWARF as the debug information // format. [dwarf] // * *DWARF with dSYM File:* Object files and linked products will use DWARF as the debug @@ -24,7 +24,7 @@ DEBUG_INFORMATION_FORMAT = dwarf // Enable Testability -// +// // When this setting is activated, the product will be built with options appropriate for // running automated tests, such as making private interfaces accessible to the tests. // This may result in tests running slower than they would without testability enabled. @@ -34,7 +34,7 @@ ENABLE_TESTABILITY = YES // Generate Position-Dependent Code -// +// // Faster function calls for applications. Not appropriate for shared libraries, which // need to be position-independent. @@ -43,10 +43,10 @@ GCC_DYNAMIC_NO_PIC = NO // Optimization Level -// +// // Specifies the degree to which the generated code is optimized for speed and binary // size. -// +// // * *None:* Do not optimize. [-O0] // With this setting, the compiler's goal is to reduce the cost of compilation and to // make debugging produce the expected results. Statements are independent—if you stop @@ -79,7 +79,7 @@ GCC_OPTIMIZATION_LEVEL = 0 // Preprocessor Macros -// +// // Space-separated list of preprocessor macros of the form `foo` or `foo=bar`. GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 @@ -87,7 +87,7 @@ GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 // Produce debugging information -// +// // Produce debugging information. This information is required for shader profiling. MTL_ENABLE_DEBUG_INFO = YES @@ -95,7 +95,7 @@ MTL_ENABLE_DEBUG_INFO = YES // Build Active Architecture Only -// +// // If enabled, only the active architecture is built. ONLY_ACTIVE_ARCH = YES @@ -103,7 +103,7 @@ ONLY_ACTIVE_ARCH = YES // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] diff --git a/config/CryptoSwift-TestHostApp-Release.xcconfig b/config/CryptoSwift-TestHostApp-Release.xcconfig index 3f9e2994..6f71b49b 100644 --- a/config/CryptoSwift-TestHostApp-Release.xcconfig +++ b/config/CryptoSwift-TestHostApp-Release.xcconfig @@ -9,9 +9,9 @@ // Debug Information Format -// +// // The type of debug information to produce. -// +// // * *DWARF:* Object files and linked products will use DWARF as the debug information // format. [dwarf] // * *DWARF with dSYM File:* Object files and linked products will use DWARF as the debug @@ -24,7 +24,7 @@ DEBUG_INFORMATION_FORMAT = dwarf-with-dsym // Enable Foundation Assertions -// +// // Controls whether assertion logic provided by `NSAssert` is included in the // preprocessed source code or is elided during preprocessing. Disabling assertions can // improve code performance. @@ -34,7 +34,7 @@ ENABLE_NS_ASSERTIONS = NO // Produce debugging information -// +// // Produce debugging information. This information is required for shader profiling. MTL_ENABLE_DEBUG_INFO = NO @@ -42,7 +42,7 @@ MTL_ENABLE_DEBUG_INFO = NO // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] @@ -53,7 +53,7 @@ SWIFT_OPTIMIZATION_LEVEL = -O // Validate Built Product -// +// // If enabled, perform validation checks on the product as part of the build process. VALIDATE_PRODUCT = YES diff --git a/config/CryptoSwift-TestHostApp-Shared.xcconfig b/config/CryptoSwift-TestHostApp-Shared.xcconfig index a1ab57d7..18748bc9 100644 --- a/config/CryptoSwift-TestHostApp-Shared.xcconfig +++ b/config/CryptoSwift-TestHostApp-Shared.xcconfig @@ -12,7 +12,7 @@ PROVISIONING_PROFILE_SPECIFIER = ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES // Asset Catalog App Icon Set Name -// +// // Name of an asset catalog app icon set whose contents will be merged into the // `Info.plist`. @@ -20,7 +20,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = // Info.plist File -// +// // The project-relative path to the property list file that contains the `Info.plist` // information used by bundles. For details on information property list files, see // [Information Property List @@ -33,7 +33,7 @@ INFOPLIST_FILE = CryptoSwift-TestHostApp/Info.plist // Runpath Search Paths -// +// // This is a list of paths to be added to the `runpath` search path list for the image // being created. At runtime, `dyld` uses the `runpath` when searching for dylibs whose // load path begins with `@rpath/`. See [Dynamic Library Programming @@ -44,7 +44,7 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks // Product Bundle Identifier -// +// // A string that uniquely identifies the bundle. The string should be in reverse DNS // format using only alphanumeric characters (`A-Z`, `a-z`, `0-9`), the dot (`.`), and // the hyphen (`-`). This value is used as the `CFBundleIdentifier` in the `Info.plist` @@ -54,7 +54,7 @@ PRODUCT_BUNDLE_IDENTIFIER = CryptoSwiftTestHostApp // Base SDK -// +// // The name or path of the base SDK being used during the build. The product will be // built against the headers and libraries located inside the indicated SDK. This path // will be prepended to all search paths, and will be passed through the environment to diff --git a/config/CryptoSwift-TestHostApp-Test.xcconfig b/config/CryptoSwift-TestHostApp-Test.xcconfig index ebb165ae..a1265fb5 100644 --- a/config/CryptoSwift-TestHostApp-Test.xcconfig +++ b/config/CryptoSwift-TestHostApp-Test.xcconfig @@ -9,9 +9,9 @@ // Debug Information Format -// +// // The type of debug information to produce. -// +// // * *DWARF:* Object files and linked products will use DWARF as the debug information // format. [dwarf] // * *DWARF with dSYM File:* Object files and linked products will use DWARF as the debug @@ -24,7 +24,7 @@ DEBUG_INFORMATION_FORMAT = dwarf-with-dsym // Enable Foundation Assertions -// +// // Controls whether assertion logic provided by `NSAssert` is included in the // preprocessed source code or is elided during preprocessing. Disabling assertions can // improve code performance. @@ -34,7 +34,7 @@ ENABLE_NS_ASSERTIONS = NO // Produce debugging information -// +// // Produce debugging information. This information is required for shader profiling. MTL_ENABLE_DEBUG_INFO = NO @@ -42,7 +42,7 @@ MTL_ENABLE_DEBUG_INFO = NO // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] @@ -53,7 +53,7 @@ SWIFT_OPTIMIZATION_LEVEL = -O // Validate Built Product -// +// // If enabled, perform validation checks on the product as part of the build process. VALIDATE_PRODUCT = YES diff --git a/config/Project-Debug.xcconfig b/config/Project-Debug.xcconfig index 3c81a2e4..69ea1a7f 100644 --- a/config/Project-Debug.xcconfig +++ b/config/Project-Debug.xcconfig @@ -9,7 +9,7 @@ // Strip Debug Symbols During Copy -// +// // Specifies whether binary files that are copied during the build, such as in a Copy // Bundle Resources or Copy Files build phase, should be stripped of debugging symbols. // It does not cause the linked product of a target to be stripped—use @@ -20,7 +20,7 @@ COPY_PHASE_STRIP = NO // Enable Testability -// +// // When this setting is activated, the product will be built with options appropriate for // running automated tests, such as making private interfaces accessible to the tests. // This may result in tests running slower than they would without testability enabled. @@ -30,7 +30,7 @@ ENABLE_TESTABILITY = YES // Generate Position-Dependent Code -// +// // Faster function calls for applications. Not appropriate for shared libraries, which // need to be position-independent. @@ -39,7 +39,7 @@ GCC_DYNAMIC_NO_PIC = NO // Preprocessor Macros -// +// // Space-separated list of preprocessor macros of the form `foo` or `foo=bar`. GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 @@ -55,7 +55,7 @@ METAL_ENABLE_DEBUG_INFO = YES // Build Active Architecture Only -// +// // If enabled, only the active architecture is built. ONLY_ACTIVE_ARCH = YES diff --git a/config/Project-Release.xcconfig b/config/Project-Release.xcconfig index 57162a54..7b7b99ca 100644 --- a/config/Project-Release.xcconfig +++ b/config/Project-Release.xcconfig @@ -9,7 +9,7 @@ // Use Optimization Profile -// +// // When this setting is enabled, `clang` will use the optimization profile collected for // a target when building it. @@ -18,7 +18,7 @@ CLANG_USE_OPTIMIZATION_PROFILE = YES // Strip Debug Symbols During Copy -// +// // Specifies whether binary files that are copied during the build, such as in a Copy // Bundle Resources or Copy Files build phase, should be stripped of debugging symbols. // It does not cause the linked product of a target to be stripped—use @@ -29,7 +29,7 @@ COPY_PHASE_STRIP = YES // Enable Foundation Assertions -// +// // Controls whether assertion logic provided by `NSAssert` is included in the // preprocessed source code or is elided during preprocessing. Disabling assertions can // improve code performance. @@ -39,10 +39,10 @@ ENABLE_NS_ASSERTIONS = NO // Optimization Level -// +// // Specifies the degree to which the generated code is optimized for speed and binary // size. -// +// // * *None:* Do not optimize. [-O0] // With this setting, the compiler's goal is to reduce the cost of compilation and to // make debugging produce the expected results. Statements are independent—if you stop @@ -79,7 +79,7 @@ METAL_ENABLE_DEBUG_INFO = NO // Validate Built Product -// +// // If enabled, perform validation checks on the product as part of the build process. -VALIDATE_PRODUCT = YES \ No newline at end of file +VALIDATE_PRODUCT = YES diff --git a/config/Project-Shared.xcconfig b/config/Project-Shared.xcconfig index b6b20502..3403c280 100644 --- a/config/Project-Shared.xcconfig +++ b/config/Project-Shared.xcconfig @@ -28,10 +28,10 @@ CLANG_ANALYZER_NONNULL = YES CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE // Always Search User Paths (Deprecated) -// +// // This setting is deprecated as of Xcode 8.3 and may not be supported in future // versions. It is recommended that you disable the setting. -// +// // If enabled, both `#include `-style and `#include "header.h"`-style // directives search the paths in `USER_HEADER_SEARCH_PATHS` before // `HEADER_SEARCH_PATHS`. As a consequence, user headers, such as your own `String.h` @@ -39,7 +39,7 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE // done using the `-iquote` flag for the paths provided in `USER_HEADER_SEARCH_PATHS`. If // disabled and your compiler fully supports separate user paths, user headers are only // accessible with `#include "header.h"`-style preprocessor directives. -// +// // For backwards compatibility reasons, this setting is enabled by default. Disabling it // is strongly recommended. @@ -48,9 +48,9 @@ ALWAYS_SEARCH_USER_PATHS = NO // C++ Language Dialect -// +// // Choose a standard or non-standard C++ language dialect. Options include: -// +// // * *C++98:* Accept ISO C++ 1998 with amendments, but not GNU extensions. [-std=c++98] // * *GNU++98:* Accept ISO C++ 1998 with amendments and GNU extensions. [-std=gnu++98] // * *C++11:* Accept the ISO C++ 2011 standard with amendments, but not GNU extensions. @@ -74,9 +74,9 @@ CLANG_CXX_LANGUAGE_STANDARD = gnu++0x // C++ Standard Library -// +// // Choose a version of the C++ standard library to use. -// +// // * *libstdc++:* A traditional C++ standard library that works with GCC and the LLVM // Compiler (default). // * *libc++:* A highly optimized C++ standard library that works only with the LLVM @@ -87,7 +87,7 @@ CLANG_CXX_LIBRARY = libc++ // Enable Modules (C and Objective-C) -// +// // Enables the use of modules for system APIs. System headers are imported as semantic // modules instead of raw headers. This can result in faster builds and project indexing. @@ -96,7 +96,7 @@ CLANG_ENABLE_MODULES = YES // Objective-C Automatic Reference Counting -// +// // Compiles reference-counted Objective-C code (when garbage collection is not enabled) // to use Automatic Reference Counting. Code compiled using automated reference counting // is compatible with other code (such as frameworks) compiled using either manual @@ -116,7 +116,7 @@ CLANG_ENABLE_OBJC_WEAK = YES // Duplicate Method Definitions -// +// // Warn about declaring the same method more than once within the same `@interface`. CLANG_WARN__DUPLICATE_METHOD_MATCH = YES @@ -124,7 +124,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES // Block Capture of Autoreleasing -// +// // Warn about block captures of implicitly autoreleasing parameters. CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES @@ -132,7 +132,7 @@ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES // Implicit Boolean Conversions -// +// // Warn about implicit conversions to boolean values that are suspicious. For example, // writing `if (foo)` where `foo` is the name a function will trigger a warning. @@ -141,7 +141,7 @@ CLANG_WARN_BOOL_CONVERSION = YES // Suspicious Commas -// +// // Warn about suspicious uses of the comma operator. CLANG_WARN_COMMA = YES @@ -149,7 +149,7 @@ CLANG_WARN_COMMA = YES // Implicit Constant Conversions -// +// // Warn about implicit conversions of constant values that cause the constant value to // change, either through a loss of precision, or entirely in its meaning. @@ -158,7 +158,7 @@ CLANG_WARN_CONSTANT_CONVERSION = YES // Overriding Deprecated Objective-C Methods -// +// // Warn if an Objective-C class either subclasses a deprecated class or overrides a // method that has been marked deprecated or unavailable. @@ -167,7 +167,7 @@ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES // Direct usage of 'isa' -// +// // Warn about direct accesses to the Objective-C `isa` pointer instead of using a runtime // API. @@ -176,7 +176,7 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR // Empty Loop Bodies -// +// // Warn about loop bodies that are suspiciously empty. CLANG_WARN_EMPTY_BODY = YES @@ -184,7 +184,7 @@ CLANG_WARN_EMPTY_BODY = YES // Implicit Enum Conversions -// +// // Warn about implicit conversions between different kinds of enum values. For example, // this can catch issues when using the wrong enum flag as an argument to a function or // method. @@ -194,7 +194,7 @@ CLANG_WARN_ENUM_CONVERSION = YES // Infinite Recursion -// +// // Warn if all paths through a function call itself. CLANG_WARN_INFINITE_RECURSION = YES @@ -202,7 +202,7 @@ CLANG_WARN_INFINITE_RECURSION = YES // Implicit Integer to Pointer Conversions -// +// // Warn about implicit conversions between pointers and integers. For example, this can // catch issues when one incorrectly intermixes using `NSNumber*`'s and raw integers. @@ -211,7 +211,7 @@ CLANG_WARN_INT_CONVERSION = YES // Implicit Non-Literal Null Conversions -// +// // Warn about non-literal expressions that evaluate to zero being treated as a null // pointer. @@ -220,7 +220,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES // Implicit retain of 'self' within blocks -// +// // Warn about implicit retains of `self` within blocks, which can create a retain-cycle. CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES @@ -228,7 +228,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES // Implicit Objective-C Literal Conversions -// +// // Warn about implicit conversions from Objective-C literals to values of incompatible // type. @@ -237,7 +237,7 @@ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES // Unintentional Root Class -// +// // Warn about classes that unintentionally do not subclass a root class, such as // `NSObject`. @@ -246,7 +246,7 @@ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR // Range-based For Loops -// +// // Warn about ranged-based for loops. CLANG_WARN_RANGE_LOOP_ANALYSIS = YES @@ -254,7 +254,7 @@ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES // Strict Prototypes -// +// // Warn about non-prototype declarations. CLANG_WARN_STRICT_PROTOTYPES = YES @@ -262,7 +262,7 @@ CLANG_WARN_STRICT_PROTOTYPES = YES // Suspicious Moves -// +// // Warn about suspicious uses of `std::move`. CLANG_WARN_SUSPICIOUS_MOVE = YES @@ -270,7 +270,7 @@ CLANG_WARN_SUSPICIOUS_MOVE = YES // Unreachable Code -// +// // Warns about potentially unreachable code. CLANG_WARN_UNREACHABLE_CODE = YES @@ -298,7 +298,7 @@ CODE_SIGNING_REQUIRED = NO // Current Project Version -// +// // This setting defines the current version of the project. The value must be a integer // or floating point number, such as `57` or `365.8`. @@ -307,9 +307,9 @@ CURRENT_PROJECT_VERSION = 1 // Debug Information Format -// +// // The type of debug information to produce. -// +// // * *DWARF:* Object files and linked products will use DWARF as the debug information // format. [dwarf] // * *DWARF with dSYM File:* Object files and linked products will use DWARF as the debug @@ -322,7 +322,7 @@ DEBUG_INFORMATION_FORMAT = dwarf // Defines Module -// +// // If enabled, the product will be treated as defining its own module. This enables // automatic production of LLVM module map files when appropriate, and allows the product // to be imported as a module. @@ -332,7 +332,7 @@ DEFINES_MODULE = YES // Enable Strict Checking of objc_msgSend Calls -// +// // Controls whether `objc_msgSend` calls must be cast to the appropriate function pointer // type before being called. @@ -341,9 +341,9 @@ ENABLE_STRICT_OBJC_MSGSEND = YES // C Language Dialect -// +// // Choose a standard or non-standard C language dialect. -// +// // * *ANSI C:* Accept ISO C90 and ISO C++, turning off GNU extensions that are // incompatible. [-ansi] // Incompatible GNU extensions include the `asm`, `inline`, and `typeof` keywords (but @@ -365,7 +365,7 @@ GCC_C_LANGUAGE_STANDARD = gnu99 // No Common Blocks -// +// // In C, allocate even uninitialized global variables in the data section of the object // file, rather than generating them as common blocks. This has the effect that if the // same variable is declared (without `extern`) in two different compilations, you will @@ -376,7 +376,7 @@ GCC_NO_COMMON_BLOCKS = YES // Implicit Conversion to 32 Bit Type -// +// // Warn if a value is implicitly converted from a 64-bit type to a 32-bit type. This is a // subset of the warnings provided by -Wconversion. @@ -385,7 +385,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES // Mismatched Return Type -// +// // Causes warnings to be emitted when a function with a defined return type (not `void`) // contains a return statement without a return-value. Also emits a warning when a // function is defined without specifying a return type. @@ -395,7 +395,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR // Undeclared Selector -// +// // Warn if a `@selector(...)` expression referring to an undeclared selector is found. A // selector is considered undeclared if no method with that name has been declared before // the `@selector(...)` expression, either explicitly in an `@interface` or `@protocol` @@ -410,10 +410,10 @@ GCC_WARN_UNDECLARED_SELECTOR = YES // Uninitialized Variables -// +// // Warn if a variable might be clobbered by a `setjmp` call or if an automatic variable // is used without prior initialization. -// +// // The compiler may not detect all cases where an automatic variable is initialized or // all usage patterns that may lead to use prior to initialization. You can toggle // between the normal uninitialized value checking or the more aggressive (conservative) @@ -424,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE // Unused Functions -// +// // Warn whenever a static function is declared but not defined or a noninline static // function is unused. @@ -433,7 +433,7 @@ GCC_WARN_UNUSED_FUNCTION = YES // Unused Labels -// +// // Warn whenever a label is declared but not used. GCC_WARN_UNUSED_LABEL = YES @@ -441,7 +441,7 @@ GCC_WARN_UNUSED_LABEL = YES // Unused Variables -// +// // Warn whenever a local variable or nonconstant static variable is unused aside from its // declaration. @@ -453,7 +453,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0 // macOS Deployment Target -// +// // Code will load on this and later versions of macOS. Framework APIs that are // unavailable in earlier versions will be weak-linked; your code should check for `null` // function pointers or specific system versions before calling newer APIs. @@ -463,7 +463,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10 // Supported Platforms -// +// // The list of supported platforms from which a base SDK can be used. This setting is // used if the product can be built for multiple platforms using different SDKs. @@ -476,15 +476,15 @@ SWIFT_COMPILATION_MODE = wholemodule // Swift Language Version -// -// +// +// SWIFT_VERSION = 5.0 // Targeted Device Family -// +// // The build system uses the selected device to set the correct value for the // `UIDeviceFamily` key it adds to the target's `Info.plist` file. This also drives the // --target-device flag to actool, which determines the idioms selected during catalog @@ -499,19 +499,19 @@ TVOS_DEPLOYMENT_TARGET = 9.0 // Versioning Name Prefix -// +// // Used as a prefix for the name of the version info symbol in the generated versioning // source file. If you prefix your exported symbols you will probably want to set this to // the same prefix. -VERSION_INFO_PREFIX = +VERSION_INFO_PREFIX = // Versioning System -// +// // Selects the process used for version-stamping generated files. -// +// // * *None:* Use no versioning system. // * *Apple Generic:* Use the current project version setting. [apple-generic] diff --git a/config/Project-Test.xcconfig b/config/Project-Test.xcconfig index 1504bc42..768e9a33 100644 --- a/config/Project-Test.xcconfig +++ b/config/Project-Test.xcconfig @@ -9,7 +9,7 @@ // Strip Debug Symbols During Copy -// +// // Specifies whether binary files that are copied during the build, such as in a Copy // Bundle Resources or Copy Files build phase, should be stripped of debugging symbols. // It does not cause the linked product of a target to be stripped—use @@ -20,7 +20,7 @@ COPY_PHASE_STRIP = NO // Enable Foundation Assertions -// +// // Controls whether assertion logic provided by `NSAssert` is included in the // preprocessed source code or is elided during preprocessing. Disabling assertions can // improve code performance. @@ -30,7 +30,7 @@ ENABLE_NS_ASSERTIONS = NO // Enable Testability -// +// // When this setting is activated, the product will be built with options appropriate for // running automated tests, such as making private interfaces accessible to the tests. // This may result in tests running slower than they would without testability enabled. @@ -40,10 +40,10 @@ ENABLE_TESTABILITY = YES // Optimization Level -// +// // Specifies the degree to which the generated code is optimized for speed and binary // size. -// +// // * *None:* Do not optimize. [-O0] // With this setting, the compiler's goal is to reduce the cost of compilation and to // make debugging produce the expected results. Statements are independent—if you stop @@ -76,7 +76,7 @@ GCC_OPTIMIZATION_LEVEL = fast // Preprocessor Macros -// +// // Space-separated list of preprocessor macros of the form `foo` or `foo=bar`. GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1 CI=1 @@ -94,7 +94,7 @@ METAL_ENABLE_DEBUG_INFO = NO // Build Active Architecture Only -// +// // If enabled, only the active architecture is built. ONLY_ACTIVE_ARCH = YES @@ -102,7 +102,7 @@ ONLY_ACTIVE_ARCH = YES // Validate Built Product -// +// // If enabled, perform validation checks on the product as part of the build process. VALIDATE_PRODUCT = YES diff --git a/config/Tests-Debug.xcconfig b/config/Tests-Debug.xcconfig index a3f4b524..c47c0d56 100644 --- a/config/Tests-Debug.xcconfig +++ b/config/Tests-Debug.xcconfig @@ -9,9 +9,9 @@ // Link-Time Optimization -// +// // Enabling this setting allows optimization across file boundaries during linking. -// +// // * *No:* Disabled. Do not use link-time optimization. // * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time // optimization of binaries, combining all executable code into a single unit and running diff --git a/config/Tests-Release.xcconfig b/config/Tests-Release.xcconfig index ecc45474..91b5b192 100644 --- a/config/Tests-Release.xcconfig +++ b/config/Tests-Release.xcconfig @@ -9,10 +9,10 @@ // Optimization Level -// +// // Specifies the degree to which the generated code is optimized for speed and binary // size. -// +// // * *None:* Do not optimize. [-O0] // With this setting, the compiler's goal is to reduce the cost of compilation and to // make debugging produce the expected results. Statements are independent—if you stop @@ -45,7 +45,7 @@ GCC_OPTIMIZATION_LEVEL = fast // Unroll Loops -// +// // Unrolls loops. Unrolling makes the code larger, but may make it faster by reducing the // number of branches executed. @@ -54,9 +54,9 @@ GCC_UNROLL_LOOPS = YES // Link-Time Optimization -// +// // Enabling this setting allows optimization across file boundaries during linking. -// +// // * *No:* Disabled. Do not use link-time optimization. // * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time // optimization of binaries, combining all executable code into a single unit and running @@ -75,7 +75,7 @@ METAL_ENABLE_DEBUG_INFO = NO // Disable Safety Checks -// +// // Disable runtime safety checks when optimizing. SWIFT_DISABLE_SAFETY_CHECKS = YES @@ -83,7 +83,7 @@ SWIFT_DISABLE_SAFETY_CHECKS = YES // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] diff --git a/config/Tests-Shared.xcconfig b/config/Tests-Shared.xcconfig index 304e28b4..3965a726 100644 --- a/config/Tests-Shared.xcconfig +++ b/config/Tests-Shared.xcconfig @@ -7,7 +7,7 @@ // Always Embed Swift Standard Libraries -// +// // Always embed the Swift standard libraries in the target's products, even if the target // does not contain any Swift code. For example, this should be enabled if the target is // embedding other products which contain Swift, or if it is a test target which does not @@ -19,7 +19,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES // Header Search Paths -// +// // This is a list of paths to folders to be searched by the compiler for included or // imported header files when compiling C, Objective-C, C++, or Objective-C++. Paths are // delimited by whitespace, so any paths with spaces in them need to be properly quoted. @@ -29,7 +29,7 @@ HEADER_SEARCH_PATHS = $(inherited) includes/** // Info.plist File -// +// // The project-relative path to the property list file that contains the `Info.plist` // information used by bundles. For details on information property list files, see // [Information Property List @@ -42,7 +42,7 @@ INFOPLIST_FILE = Tests/${TARGET_NAME}/Info.plist // Runpath Search Paths -// +// // This is a list of paths to be added to the `runpath` search path list for the image // being created. At runtime, `dyld` uses the `runpath` when searching for dylibs whose // load path begins with `@rpath/`. See [Dynamic Library Programming @@ -53,7 +53,7 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/ // Product Bundle Identifier -// +// // A string that uniquely identifies the bundle. The string should be in reverse DNS // format using only alphanumeric characters (`A-Z`, `a-z`, `0-9`), the dot (`.`), and // the hyphen (`-`). This value is used as the `CFBundleIdentifier` in the `Info.plist` @@ -64,8 +64,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.krzyzanowskim.${PRODUCT_NAME:rfc1034identifier} // Objective-C Bridging Header -// +// // Path to the header defining the Objective-C interfaces to be exposed in Swift. SWIFT_OBJC_BRIDGING_HEADER = Tests/${TARGET_NAME}/Bridging.h - diff --git a/config/Tests-Test.xcconfig b/config/Tests-Test.xcconfig index eb65b72d..fcaebf1f 100644 --- a/config/Tests-Test.xcconfig +++ b/config/Tests-Test.xcconfig @@ -9,10 +9,10 @@ // Optimization Level -// +// // Specifies the degree to which the generated code is optimized for speed and binary // size. -// +// // * *None:* Do not optimize. [-O0] // With this setting, the compiler's goal is to reduce the cost of compilation and to // make debugging produce the expected results. Statements are independent—if you stop @@ -45,7 +45,7 @@ GCC_OPTIMIZATION_LEVEL = fast // Unroll Loops -// +// // Unrolls loops. Unrolling makes the code larger, but may make it faster by reducing the // number of branches executed. @@ -54,9 +54,9 @@ GCC_UNROLL_LOOPS = YES // Link-Time Optimization -// +// // Enabling this setting allows optimization across file boundaries during linking. -// +// // * *No:* Disabled. Do not use link-time optimization. // * *Monolithic Link-Time Optimization:* This mode performs monolithic link-time // optimization of binaries, combining all executable code into a single unit and running @@ -75,7 +75,7 @@ METAL_ENABLE_DEBUG_INFO = NO // Disable Safety Checks -// +// // Disable runtime safety checks when optimizing. SWIFT_DISABLE_SAFETY_CHECKS = YES @@ -83,7 +83,7 @@ SWIFT_DISABLE_SAFETY_CHECKS = YES // Swift Optimization Level -// +// // * *None:* Compile without any optimization. [-Onone] // * *Optimize for Speed:* [-O] // * *Optimize for Size:* [-Osize] diff --git a/scripts/build-framework.sh b/scripts/build-framework.sh index 57f8fc3b..721a48f5 100755 --- a/scripts/build-framework.sh +++ b/scripts/build-framework.sh @@ -4,4 +4,4 @@ set -ex echo "Build frameworks in directory $(pwd)" -carthage build --no-skip-current --configuration "Release" --platform all \ No newline at end of file +carthage build --no-skip-current --configuration "Release" --platform all diff --git a/scripts/swiftformat.sh b/scripts/swiftformat.sh index 452e251b..90d1db0f 100755 --- a/scripts/swiftformat.sh +++ b/scripts/swiftformat.sh @@ -1,3 +1,3 @@ #!/bin/bash -swiftformat --hexliteralcase lowercase --hexgrouping none --ranges nospace --wrapelements beforefirst --self remove $1 \ No newline at end of file +swiftformat --hexliteralcase lowercase --hexgrouping none --ranges nospace --wrapelements beforefirst --self remove $1