diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..5eec115 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,33 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: '*' + +env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + +jobs: + iOS: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: xcodebuild -scheme "Rswift-iOS" + tvOS: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: xcodebuild -scheme "Rswift-tvOS" + watchOS: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: xcodebuild -scheme "Rswift-watchOS" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ebf96c1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + release: + types: created + +env: + DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer + +jobs: + publish: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Publish to Cocoapods + run: | + export POD_VERSION=$(echo $TAG_NAME | cut -c2-) + pod trunk push + env: + TAG_NAME: ${{ github.event.release.tag_name }} + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/.gitignore b/.gitignore index 8d04a5f..53a07cc 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ fastlane/test_output fastlane/settoken.sh /build Carthage/Build +.swiftpm \ No newline at end of file diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 9f55b2c..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.0 diff --git a/Library/Core/Validatable.swift b/Library/Core/Validatable.swift index 3467513..f965a6c 100644 --- a/Library/Core/Validatable.swift +++ b/Library/Core/Validatable.swift @@ -21,7 +21,7 @@ public struct ValidationError: Error, CustomStringConvertible { public protocol Validatable { /** - Validates this entity and throws if it encounters a invalid situation, a validatable should also validate it sub-validatables if it has any. + Validates this entity and throws if it encounters an invalid situation, a validatable should also validate it sub-validatables if it has any. - throws: If there the configuration error a ValidationError is thrown */ diff --git a/Library/Foundation/Bundle+FileResource.swift b/Library/Foundation/Bundle+FileResource.swift index 83af4ff..d632c8d 100644 --- a/Library/Foundation/Bundle+FileResource.swift +++ b/Library/Foundation/Bundle+FileResource.swift @@ -17,7 +17,7 @@ public extension Bundle { - returns: The file URL for the resource file (R.file.*) or nil if the file could not be located. */ - public func url(forResource resource: FileResourceType) -> URL? { + func url(forResource resource: FileResourceType) -> URL? { return url(forResource: resource.name, withExtension: resource.pathExtension) } @@ -28,7 +28,7 @@ public extension Bundle { - returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located. */ - public func path(forResource resource: FileResourceType) -> String? { + func path(forResource resource: FileResourceType) -> String? { return path(forResource: resource.name, ofType: resource.pathExtension) } } diff --git a/Library/Foundation/Data+FileResource.swift b/Library/Foundation/Data+FileResource.swift index 2f612bd..36a0a36 100644 --- a/Library/Foundation/Data+FileResource.swift +++ b/Library/Foundation/Data+FileResource.swift @@ -20,7 +20,7 @@ public extension Data { - returns: A NSData object with the contents of the specified file. */ - public init(resource: FileResourceType) throws { + init(resource: FileResourceType) throws { guard let url = resource.url() else { throw NoUrlForResourceError() } try self.init(contentsOf: url) } diff --git a/Library/UIKit/NibResource+UIKit.swift b/Library/UIKit/NibResource+UIKit.swift index eada71d..2875cc5 100644 --- a/Library/UIKit/NibResource+UIKit.swift +++ b/Library/UIKit/NibResource+UIKit.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -19,7 +20,8 @@ public extension NibResourceType { - returns: An array containing the top-level objects from the NIB */ - public func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] { + func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] { return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil) } } +#endif diff --git a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift index 23f4f46..4ba1902 100644 --- a/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift +++ b/Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -16,7 +17,8 @@ public extension StoryboardResourceWithInitialControllerType { - returns: The initial view controller in the storyboard. */ - public func instantiateInitialViewController() -> InitialController? { + func instantiateInitialViewController() -> InitialController? { return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController } } +#endif diff --git a/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift b/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift index 5edd9be..894c8c2 100644 --- a/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift +++ b/Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -33,3 +34,4 @@ extension TypedStoryboardSegueInfo { self.destination = destination } } +#endif diff --git a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift index aabcf14..ebac685 100644 --- a/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift +++ b/Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -19,7 +20,7 @@ public extension UICollectionView { - returns: A subclass of UICollectionReusableView or nil if the cast fails. */ - public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? + func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? where Identifier.ReusableType: UICollectionReusableView { return dequeueReusableCell(withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType @@ -34,7 +35,7 @@ public extension UICollectionView { - returns: A subclass of UICollectionReusableView or nil if the cast fails. */ - public func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? + func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? where Identifier.ReusableType: UICollectionReusableView { return dequeueReusableSupplementaryView(ofKind: elementKind, withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType @@ -45,7 +46,7 @@ public extension UICollectionView { - parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionViewCell that has a reuse identifier */ - public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) + func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UICollectionViewCell { register(UINib(resource: nibResource), forCellWithReuseIdentifier: nibResource.identifier) @@ -56,9 +57,10 @@ public extension UICollectionView { - parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionReusableView. that has a reuse identifier */ - public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String) + func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String) where Resource.ReusableType: UICollectionReusableView { register(UINib(resource: nibResource), forSupplementaryViewOfKind: kind, withReuseIdentifier: nibResource.identifier) } } +#endif diff --git a/Library/UIKit/UIColor+ColorResource.swift b/Library/UIKit/UIColor+ColorResource.swift index 800d338..6ee764d 100644 --- a/Library/UIKit/UIColor+ColorResource.swift +++ b/Library/UIKit/UIColor+ColorResource.swift @@ -12,6 +12,8 @@ import UIKit @available(iOS 11.0, *) @available(tvOS 11.0, *) public extension UIColor { + + #if os(iOS) || os(tvOS) /** Returns the color from this resource (R.color.*) that is compatible with the trait collection. @@ -20,7 +22,22 @@ public extension UIColor { - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found. */ - public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { + convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection) } + #endif + + #if os(watchOS) + /** + Returns the color from this resource (R.color.*) that is compatible with the trait collection. + + - parameter resource: The resource you want the image of (R.color.*) + + - returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found. + */ + @available(watchOSApplicationExtension 4.0, *) + convenience init?(resource: ColorResourceType) { + self.init(named: resource.name) + } + #endif } diff --git a/Library/UIKit/UIFont+FontResource.swift b/Library/UIKit/UIFont+FontResource.swift index 237d9cf..cadc6c9 100644 --- a/Library/UIKit/UIFont+FontResource.swift +++ b/Library/UIKit/UIFont+FontResource.swift @@ -19,7 +19,7 @@ public extension UIFont { - returns: A font object of the specified font resource and size. */ - public convenience init?(resource: FontResourceType, size: CGFloat) { + convenience init?(resource: FontResourceType, size: CGFloat) { self.init(name: resource.fontName, size: size) } } diff --git a/Library/UIKit/UIImage+ImageResource.swift b/Library/UIKit/UIImage+ImageResource.swift index 6037b4f..c764814 100644 --- a/Library/UIKit/UIImage+ImageResource.swift +++ b/Library/UIKit/UIImage+ImageResource.swift @@ -10,6 +10,8 @@ import UIKit public extension UIImage { + + #if os(iOS) || os(tvOS) /** Returns the image from this resource (R.image.*) that is compatible with the trait collection. @@ -18,7 +20,21 @@ public extension UIImage { - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found. */ - public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { + convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) { self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection) } + #endif + + #if os(watchOS) + /** + Returns the image from this resource (R.image.*) that is compatible with the trait collection. + + - parameter resource: The resource you want the image of (R.image.*) + + - returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found. + */ + convenience init?(resource: ImageResourceType) { + self.init(named: resource.name) + } + #endif } diff --git a/Library/UIKit/UINib+NibResource.swift b/Library/UIKit/UINib+NibResource.swift index 70cba8a..8aaa0fd 100644 --- a/Library/UIKit/UINib+NibResource.swift +++ b/Library/UIKit/UINib+NibResource.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import UIKit public extension UINib { @@ -17,7 +18,8 @@ public extension UINib { - returns: The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located. */ - public convenience init(resource: NibResourceType) { + convenience init(resource: NibResourceType) { self.init(nibName: resource.name, bundle: resource.bundle) } } +#endif diff --git a/Library/UIKit/UIStoryboard+StoryboardResource.swift b/Library/UIKit/UIStoryboard+StoryboardResource.swift index bc03c2e..1ed8015 100644 --- a/Library/UIKit/UIStoryboard+StoryboardResource.swift +++ b/Library/UIKit/UIStoryboard+StoryboardResource.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import UIKit public extension UIStoryboard { @@ -17,7 +18,8 @@ public extension UIStoryboard { - returns: A storyboard object for the specified file. If no storyboard resource file matching name exists, an exception is thrown with description: `Could not find a storyboard named 'XXXXXX' in bundle....` */ - public convenience init(resource: StoryboardResourceType) { + convenience init(resource: StoryboardResourceType) { self.init(name: resource.name, bundle: resource.bundle) } } +#endif diff --git a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift index f816d62..75c61f0 100644 --- a/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift +++ b/Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -18,7 +19,8 @@ public extension UIStoryboard { - returns: The view controller corresponding to the specified resource (R.storyboard.*.*). If no view controller is associated, this method throws an exception. */ - public func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? { + func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? { return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType } } +#endif diff --git a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift index c5202ee..aa6589e 100644 --- a/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift +++ b/Library/UIKit/UITableView+ReuseIdentifierProtocol.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -21,14 +22,14 @@ public extension UITableView { - precondition: You must register a class or nib file using the registerNib: or registerClass:forCellReuseIdentifier: method before calling this method. */ - public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? + func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType? where Identifier.ReusableType: UITableViewCell { return dequeueReusableCell(withIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType } @available(*, unavailable, message: "Use dequeueReusableCell(withIdentifier:for:) instead") - public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType? + func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType? where Identifier.ReusableType: UITableViewCell { fatalError() @@ -41,7 +42,7 @@ public extension UITableView { - returns: A UITableViewHeaderFooterView object with the associated identifier or nil if no such object exists in the reusable view queue or if it couldn't be cast correctly. */ - public func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType? + func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType? where Identifier.ReusableType: UITableViewHeaderFooterView { return dequeueReusableHeaderFooterView(withIdentifier: identifier.identifier) as? Identifier.ReusableType @@ -52,7 +53,7 @@ public extension UITableView { - parameter nibResource: A nib resource (R.nib.*) containing a table view cell that has a reuse identifier */ - public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell { + func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell { register(UINib(resource: nibResource), forCellReuseIdentifier: nibResource.identifier) } @@ -61,7 +62,8 @@ public extension UITableView { - parameter nibResource: A nib resource (R.nib.*) containing a view that has a reuse identifier */ - public func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView { + func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView { register(UINib(resource: nibResource), forHeaderFooterViewReuseIdentifier: nibResource.identifier) } } +#endif diff --git a/Library/UIKit/UIViewController+NibResource.swift b/Library/UIKit/UIViewController+NibResource.swift index 38c24ca..717bd09 100644 --- a/Library/UIKit/UIViewController+NibResource.swift +++ b/Library/UIKit/UIViewController+NibResource.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -18,7 +19,8 @@ public extension UIViewController { - returns: A newly initialized UIViewController object. */ - public convenience init(nib: NibResourceType) { + convenience init(nib: NibResourceType) { self.init(nibName: nib.name, bundle: nib.bundle) } } +#endif diff --git a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift index 6c886b4..e7aff99 100644 --- a/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift +++ b/Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift @@ -7,6 +7,7 @@ // License: MIT License // +#if !os(watchOS) import Foundation import UIKit @@ -23,7 +24,7 @@ public extension SeguePerformerType { - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue. - SeeAlso: Library for typed block based segues: [tomlokhorst/SegueManager](https://github.com/tomlokhorst/SegueManager) */ - public func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) { + func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) { performSegue(withIdentifier: identifier.identifier, sender: sender) } } @@ -33,7 +34,8 @@ public extension StoryboardSegue where Source : UIViewController { Performs this segue on the source view controller - parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue. */ - public func performSegue(sender: Any? = nil) { + func performSegue(sender: Any? = nil) { source.performSegue(withIdentifier: identifier.identifier, sender: sender) } } +#endif diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..a7e2267 --- /dev/null +++ b/Package.swift @@ -0,0 +1,19 @@ +// swift-tools-version:5.0 + +import PackageDescription + +let package = Package( + name: "R.swift.Library", + platforms: [ + .iOS(.v9), + .tvOS(.v9), + .watchOS(.v2), + ], + products: [ + .library(name: "Rswift", targets: ["Rswift"]), + .library(name: "RswiftDynamic", type: .dynamic, targets: ["Rswift"]) + ], + targets: [ + .target(name: "Rswift", path: "Library") + ] +) diff --git a/R.swift.Library.podspec b/R.swift.Library.podspec index d906e95..9c9a766 100644 --- a/R.swift.Library.podspec +++ b/R.swift.Library.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = "R.swift.Library" - spec.version = "5.0.0" + spec.version = ENV['POD_VERSION'] spec.license = "MIT" spec.summary = "Companion library for R.swift, featuring types used to type resources" @@ -17,13 +17,17 @@ Pod::Spec.new do |spec| spec.requires_arc = true spec.source = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" } + spec.swift_version = "5.1" spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' } - spec.ios.deployment_target = '8.0' - spec.tvos.deployment_target = '9.0' + spec.ios.deployment_target = '11.0' + spec.ios.source_files = "Library/**/*.swift" + spec.tvos.deployment_target = '11.0' + spec.tvos.source_files = "Library/**/*.swift" + spec.watchos.deployment_target = '4.0' + spec.watchos.source_files = ["Library/Core/*.swift", "Library/Foundation/*.swift"] spec.module_name = "Rswift" - spec.source_files = "Library/**/*.swift" end diff --git a/R.swift.Library.xcodeproj/project.pbxproj b/R.swift.Library.xcodeproj/project.pbxproj index 8c5a44d..b1ea7f0 100644 --- a/R.swift.Library.xcodeproj/project.pbxproj +++ b/R.swift.Library.xcodeproj/project.pbxproj @@ -7,6 +7,23 @@ objects = { /* Begin PBXBuildFile section */ + 2F5FBC4821355AC400A83A69 /* ColorResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E22D43661C95EEA100692FFF /* ColorResource.swift */; }; + 2F5FBC4A21355ADB00A83A69 /* Bundle+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D56DC7721C42B65C00623437 /* Bundle+FileResource.swift */; }; + 2F5FBC4B21355ADB00A83A69 /* Data+FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E20F34A61C92B44100338F81 /* Data+FileResource.swift */; }; + 2F5FBC4C21355ADF00A83A69 /* FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E435AC1C3D00770091090C /* FileResource.swift */; }; + 2F5FBC4D21355ADF00A83A69 /* FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB21C3D762300DDA68F /* FontResource.swift */; }; + 2F5FBC4E21355ADF00A83A69 /* Identifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BA1C1497EB00D16A0C /* Identifier.swift */; }; + 2F5FBC4F21355ADF00A83A69 /* ImageResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553F5841C44157000885232 /* ImageResource.swift */; }; + 2F5FBC5021355ADF00A83A69 /* NibResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9C01C14984300D16A0C /* NibResource.swift */; }; + 2F5FBC5121355ADF00A83A69 /* ReuseIdentifierProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BC1C14980600D16A0C /* ReuseIdentifierProtocol.swift */; }; + 2F5FBC5221355ADF00A83A69 /* StoryboardResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB61C3E482A00DDA68F /* StoryboardResource.swift */; }; + 2F5FBC5321355ADF00A83A69 /* StoryboardSegueIdentifierProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D543F9BE1C14983100D16A0C /* StoryboardSegueIdentifierProtocol.swift */; }; + 2F5FBC5421355ADF00A83A69 /* StoryboardViewControllerResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D51335261C959DF20014C9D4 /* StoryboardViewControllerResource.swift */; }; + 2F5FBC5521355ADF00A83A69 /* StringResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E250BE961CCBF60300CC71DE /* StringResource.swift */; }; + 2F5FBC5621355ADF00A83A69 /* Validatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D53F19231C229D7200AE2FAD /* Validatable.swift */; }; + 2F5FBC5821355B0200A83A69 /* UIColor+ColorResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2CA68EE1EE75992009C4DB4 /* UIColor+ColorResource.swift */; }; + 2F5FBC5921355B0200A83A69 /* UIFont+FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB41C3D774000DDA68F /* UIFont+FontResource.swift */; }; + 2F5FBC5A21355B0200A83A69 /* UIImage+ImageResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D553F5861C44170E00885232 /* UIImage+ImageResource.swift */; }; 806E699C1C42BD9C00DE3A8B /* Rswift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 806E69921C42BD9C00DE3A8B /* Rswift.framework */; }; 806E69A91C42BDDA00DE3A8B /* FileResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5E435AC1C3D00770091090C /* FileResource.swift */; }; 806E69AA1C42BDDA00DE3A8B /* FontResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57E1EB21C3D762300DDA68F /* FontResource.swift */; }; @@ -87,6 +104,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 2F5FBC4021355A1400A83A69 /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 806E69921C42BD9C00DE3A8B /* Rswift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Rswift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 806E699B1C42BD9C00DE3A8B /* RswiftTests-tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RswiftTests-tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D51335261C959DF20014C9D4 /* StoryboardViewControllerResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardViewControllerResource.swift; sourceTree = "<group>"; }; @@ -125,6 +143,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 2F5FBC3D21355A1400A83A69 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 806E698E1C42BD9C00DE3A8B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -225,6 +250,7 @@ D59246581C117A55007F94C7 /* RswiftTests-iOS.xctest */, 806E69921C42BD9C00DE3A8B /* Rswift.framework */, 806E699B1C42BD9C00DE3A8B /* RswiftTests-tvOS.xctest */, + 2F5FBC4021355A1400A83A69 /* Rswift.framework */, ); name = Products; sourceTree = "<group>"; @@ -253,6 +279,13 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 2F5FBC3B21355A1400A83A69 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 806E698F1C42BD9C00DE3A8B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -272,6 +305,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 2F5FBC3F21355A1400A83A69 /* Rswift-watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2F5FBC4721355A1400A83A69 /* Build configuration list for PBXNativeTarget "Rswift-watchOS" */; + buildPhases = ( + 2F5FBC3B21355A1400A83A69 /* Headers */, + 2F5FBC3C21355A1400A83A69 /* Sources */, + 2F5FBC3D21355A1400A83A69 /* Frameworks */, + 2F5FBC3E21355A1400A83A69 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Rswift-watchOS"; + productName = "Rswift-watchOS"; + productReference = 2F5FBC4021355A1400A83A69 /* Rswift.framework */; + productType = "com.apple.product-type.framework"; + }; 806E69911C42BD9C00DE3A8B /* Rswift-tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = 806E69A31C42BD9C00DE3A8B /* Build configuration list for PBXNativeTarget "Rswift-tvOS" */; @@ -351,24 +402,29 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = "Mathijs Kadijk"; TargetAttributes = { + 2F5FBC3F21355A1400A83A69 = { + CreatedOnToolsVersion = 10.0; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + }; 806E69911C42BD9C00DE3A8B = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; 806E699A1C42BD9C00DE3A8B = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; D592464D1C117A55007F94C7 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; D59246571C117A55007F94C7 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; }; }; @@ -377,6 +433,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = D59246441C117A54007F94C7; @@ -388,11 +445,19 @@ D59246571C117A55007F94C7 /* RswiftTests-iOS */, 806E69911C42BD9C00DE3A8B /* Rswift-tvOS */, 806E699A1C42BD9C00DE3A8B /* RswiftTests-tvOS */, + 2F5FBC3F21355A1400A83A69 /* Rswift-watchOS */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 2F5FBC3E21355A1400A83A69 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 806E69901C42BD9C00DE3A8B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -424,6 +489,30 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 2F5FBC3C21355A1400A83A69 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2F5FBC4F21355ADF00A83A69 /* ImageResource.swift in Sources */, + 2F5FBC5421355ADF00A83A69 /* StoryboardViewControllerResource.swift in Sources */, + 2F5FBC4D21355ADF00A83A69 /* FontResource.swift in Sources */, + 2F5FBC5A21355B0200A83A69 /* UIImage+ImageResource.swift in Sources */, + 2F5FBC5921355B0200A83A69 /* UIFont+FontResource.swift in Sources */, + 2F5FBC4821355AC400A83A69 /* ColorResource.swift in Sources */, + 2F5FBC4C21355ADF00A83A69 /* FileResource.swift in Sources */, + 2F5FBC5221355ADF00A83A69 /* StoryboardResource.swift in Sources */, + 2F5FBC5521355ADF00A83A69 /* StringResource.swift in Sources */, + 2F5FBC4B21355ADB00A83A69 /* Data+FileResource.swift in Sources */, + 2F5FBC5021355ADF00A83A69 /* NibResource.swift in Sources */, + 2F5FBC5321355ADF00A83A69 /* StoryboardSegueIdentifierProtocol.swift in Sources */, + 2F5FBC4E21355ADF00A83A69 /* Identifier.swift in Sources */, + 2F5FBC4A21355ADB00A83A69 /* Bundle+FileResource.swift in Sources */, + 2F5FBC5821355B0200A83A69 /* UIColor+ColorResource.swift in Sources */, + 2F5FBC5121355ADF00A83A69 /* ReuseIdentifierProtocol.swift in Sources */, + 2F5FBC5621355ADF00A83A69 /* Validatable.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 806E698D1C42BD9C00DE3A8B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -524,6 +613,70 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 2F5FBC4521355A1400A83A69 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = Library/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library; + PRODUCT_NAME = Rswift; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Debug; + }; + 2F5FBC4621355A1400A83A69 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = Library/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library; + PRODUCT_NAME = Rswift; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.2; + }; + name = Release; + }; 806E69A41C42BD9C00DE3A8B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -540,7 +693,7 @@ PRODUCT_NAME = Rswift; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -562,7 +715,7 @@ PRODUCT_NAME = Rswift; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -576,7 +729,7 @@ PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.1; }; name = Debug; @@ -589,7 +742,7 @@ PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.1; }; name = Release; @@ -598,6 +751,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -656,6 +810,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -722,7 +877,7 @@ PRODUCT_NAME = Rswift; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -743,7 +898,7 @@ PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswift.library; PRODUCT_NAME = Rswift; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -754,7 +909,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -765,13 +920,22 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.RswiftTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 2F5FBC4721355A1400A83A69 /* Build configuration list for PBXNativeTarget "Rswift-watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2F5FBC4521355A1400A83A69 /* Debug */, + 2F5FBC4621355A1400A83A69 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 806E69A31C42BD9C00DE3A8B /* Build configuration list for PBXNativeTarget "Rswift-tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme index d317290..5d6d23f 100644 --- a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme +++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-iOS.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "1000" + LastUpgradeVersion = "1100" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D592464D1C117A55007F94C7" + BuildableName = "Rswift.framework" + BlueprintName = "Rswift-iOS" + ReferencedContainer = "container:R.swift.Library.xcodeproj"> + </BuildableReference> + </MacroExpansion> <Testables> <TestableReference skipped = "NO"> @@ -39,17 +48,6 @@ </BuildableReference> </TestableReference> </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "D592464D1C117A55007F94C7" - BuildableName = "Rswift.framework" - BlueprintName = "Rswift-iOS" - ReferencedContainer = "container:R.swift.Library.xcodeproj"> - </BuildableReference> - </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> </TestAction> <LaunchAction buildConfiguration = "Debug" @@ -70,8 +68,6 @@ ReferencedContainer = "container:R.swift.Library.xcodeproj"> </BuildableReference> </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme index 934b0e2..7e458d0 100644 --- a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme +++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-tvOS.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "1000" + LastUpgradeVersion = "1100" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "806E69911C42BD9C00DE3A8B" + BuildableName = "Rswift.framework" + BlueprintName = "Rswift-tvOS" + ReferencedContainer = "container:R.swift.Library.xcodeproj"> + </BuildableReference> + </MacroExpansion> <Testables> <TestableReference skipped = "NO"> @@ -39,17 +48,6 @@ </BuildableReference> </TestableReference> </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "806E69911C42BD9C00DE3A8B" - BuildableName = "Rswift.framework" - BlueprintName = "Rswift-tvOS" - ReferencedContainer = "container:R.swift.Library.xcodeproj"> - </BuildableReference> - </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> </TestAction> <LaunchAction buildConfiguration = "Debug" @@ -70,8 +68,6 @@ ReferencedContainer = "container:R.swift.Library.xcodeproj"> </BuildableReference> </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" diff --git a/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme new file mode 100644 index 0000000..a5cfc2b --- /dev/null +++ b/R.swift.Library.xcodeproj/xcshareddata/xcschemes/Rswift-watchOS.xcscheme @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1030" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "2F5FBC3F21355A1400A83A69" + BuildableName = "Rswift.framework" + BlueprintName = "Rswift-watchOS" + ReferencedContainer = "container:R.swift.Library.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + </Testables> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "2F5FBC3F21355A1400A83A69" + BuildableName = "Rswift.framework" + BlueprintName = "Rswift-watchOS" + ReferencedContainer = "container:R.swift.Library.xcodeproj"> + </BuildableReference> + </MacroExpansion> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "2F5FBC3F21355A1400A83A69" + BuildableName = "Rswift.framework" + BlueprintName = "Rswift-watchOS" + ReferencedContainer = "container:R.swift.Library.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Readme.md b/Readme.md index 45bde32..4180ed7 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,8 @@ # R.swift.Library [](https://cocoapods.org/pods/R.swift) [](https://github.com/Carthage/Carthage) [](blob/master/License)  -_Library containing types supporting code generated by [R.swift](https://github.com/mac-cain13/R.swift)_ +⚠ As of version 7 of [R.swift](https://github.com/mac-cain13/R.swift), this separate library is no longer needed. R.swift is now a self contained library. + +This repository remains for older versions of R.swift. ## Why use this? @@ -20,6 +22,15 @@ _**Be aware:** If you just want to use R.swift follow the [installation instruct 1. Add `github "mac-cain13/R.swift.Library"` to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) 2. Run `carthage` +### Swift Package Manager (Requires Xcode 11) + +1. Open your Xcode project. +2. Select `File > Swift Packages > Add Package Dependency...` +3. Paste `https://github.com/mac-cain13/R.swift.Library` to the text field and click on the `Next` button. +4. Choose appropriate version and click on the `Next` button. (If you need latest one, just click on the `Next` button.) +5. Confirm that `Rswift` in the Package Product column is checked and your app's name is selected in the Add to Target column. +6. Click on the `Next` button. + ### Manually _As an embedded framework using git submodules._ diff --git a/fastlane/Fastfile b/fastlane/Fastfile deleted file mode 100644 index 5c2bb3b..0000000 --- a/fastlane/Fastfile +++ /dev/null @@ -1,98 +0,0 @@ -fastlane_version "1.86.0" - -lane :release do |options| - if options[:skip_branch_check] != true - ensure_git_branch(branch: "master") - end - - if options[:allow_dirty_branch] != true - ensure_git_status_clean - else - UI.message "Skipping the 'git status clean' check!".yellow - end - - git_pull - - runalltests - - unless is_ci - notification( - title: "R.swift.Library release", - message: "💡 Needs your attention." - ) - end - - currentVersion = version_get_podspec() - UI.message "Current R.swift.Library podspec version is #{currentVersion}" - - bumpType = prompt(text: "What kind of release is this? (major/minor/patch/custom)".green, boolean: false, ci_input: "") - isPrerelease = false - case bumpType - when "major", "minor", "patch" - version_bump_podspec(bump_type: bumpType) - when "custom" - newVersion = prompt(text: "What is the new custom version number?".green, boolean: false, ci_input: "") - version_bump_podspec(version_number: newVersion) - - isPrerelease = prompt(text: "Is this a prerelease version?".green, boolean: true, ci_input: "") - else - raise "Invalid release type: #{bumpType}".red - end - - changelog = prompt(text: "Please provide release notes:".green, boolean: false, ci_input: "", multi_line_end_keyword: "FIN") - - newVersion = version_get_podspec() - unless prompt(text: "#{newVersion} has been prepped for release. If you have any additional changes you would like to make, please do those before continuing. Would you like to commit, tag, push and release #{newVersion} including all uncommitted changes?".green, boolean: true, ci_input:"y") - raise "Aborted by user".red - end - - git_commit( - path: ".", - message: "Preparing for the #{newVersion} release" - ) - - push_to_git_remote - - af_create_github_release( - owner: "mac-cain13", - repository: "r.swift.library", - tag_name: "v#{newVersion}", - target_commitish: "master", - name: "#{newVersion}", - body: "#{changelog}", - prerelease: isPrerelease - ) - - pod_push - - unless is_ci - notification( - title: "R.swift.Library release", - message: "🎉 Version #{newVersion} is released." - ) - end -end - -lane :runalltests do - scan( - project: "R.swift.Library.xcodeproj", - scheme: "Rswift-iOS", - device: "iPhone 8", - clean: true - ) - scan( - project: "R.swift.Library.xcodeproj", - scheme: "Rswift-tvOS", - device: "Apple TV 4K", - clean: true - ) -end - -error do |lane, exception| - unless is_ci - notification( - title: "R.swift.Library #{lane}", - message: "❌ Failed with an exception." - ) - end -end diff --git a/fastlane/actions/af_create_github_release.rb b/fastlane/actions/af_create_github_release.rb deleted file mode 100644 index 55a6b5f..0000000 --- a/fastlane/actions/af_create_github_release.rb +++ /dev/null @@ -1,157 +0,0 @@ -# From: https://github.com/AFNetworking/fastlane/blob/master/fastlane/actions/af_create_github_release.rb -module Fastlane - module Actions - module SharedValues - GITHUB_RELEASE_ID = :GITHUB_RELEASE_ID - GITHUB_RELEASE_HTML_URL = :GITHUB_RELEASE_HTML_URL - GITHUB_RELEASE_UPLOAD_URL_TEMPLATE = :GITHUB_RELEASE_UPLOAD_URL_TEMPLATE - end - - # To share this integration with the other fastlane users: - # - Fork https://github.com/KrauseFx/fastlane - # - Clone the forked repository - # - Move this integration into lib/fastlane/actions - # - Commit, push and submit the pull request - - class AfCreateGithubReleaseAction < Action - def self.run(params) - require 'net/http' - require 'net/https' - require 'json' - require 'base64' - - begin - uri = URI("https://api.github.com/repos/#{params[:owner]}/#{params[:repository]}/releases") - - # Create client - http = Net::HTTP.new(uri.host, uri.port) - http.use_ssl = true - http.verify_mode = OpenSSL::SSL::VERIFY_PEER - - dict = Hash.new - dict["draft"] = params[:draft] - dict["prerelease"] = params[:prerelease] - dict["body"] = params[:body] if params[:body] - dict["tag_name"] = params[:tag_name] if params[:tag_name] - dict["name"] = params[:name] if params[:name] - body = JSON.dump(dict) - - # Create Request - req = Net::HTTP::Post.new(uri) - # Add headers - req.add_field "Content-Type", "application/json" - # Add headers - api_token = params[:api_token] - req.add_field "Authorization", "Basic #{Base64.strict_encode64(api_token)}" - # Add headers - req.add_field "Accept", "application/vnd.github.v3+json" - # Set header and body - req.add_field "Content-Type", "application/json" - req.body = body - - # Fetch Request - res = http.request(req) - rescue StandardError => e - UI.message "HTTP Request failed (#{e.message})".red - end - - case res.code.to_i - when 201 - json = JSON.parse(res.body) - UI.message "Github Release Created (#{json["id"]})".green - UI.message "#{json["html_url"]}".green - - Actions.lane_context[SharedValues::GITHUB_RELEASE_ID] = json["id"] - Actions.lane_context[SharedValues::GITHUB_RELEASE_HTML_URL] = json["html_url"] - Actions.lane_context[SharedValues::GITHUB_RELEASE_UPLOAD_URL_TEMPLATE] = json["upload_url"] - return json - when 400..499 - json = JSON.parse(res.body) - raise "Error Creating Github Release (#{res.code}): #{json}".red - else - UI.message "Status Code: #{res.code} Body: #{res.body}" - raise "Error Creating Github Release".red - end - end - - ##################################################### - # @!group Documentation - ##################################################### - - def self.description - "Create a Github Release" - end - - def self.available_options - [ - FastlaneCore::ConfigItem.new(key: :owner, - env_name: "GITHUB_OWNER", - description: "The Github Owner", - is_string:true, - optional:false), - FastlaneCore::ConfigItem.new(key: :repository, - env_name: "GITHUB_REPOSITORY", - description: "The Github Repository", - is_string:true, - optional:false), - FastlaneCore::ConfigItem.new(key: :api_token, - env_name: "GITHUB_API_TOKEN", - description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens", - is_string: true, - optional: false), - FastlaneCore::ConfigItem.new(key: :tag_name, - env_name: "GITHUB_RELEASE_TAG_NAME", - description: "Pass in the tag name", - is_string: true, - optional: false), - FastlaneCore::ConfigItem.new(key: :target_commitish, - env_name: "GITHUB_TARGET_COMMITISH", - description: "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists", - is_string: true, - optional: true), - FastlaneCore::ConfigItem.new(key: :name, - env_name: "GITHUB_RELEASE_NAME", - description: "The name of the release", - is_string: true, - optional: true), - FastlaneCore::ConfigItem.new(key: :body, - env_name: "GITHUB_RELEASE_BODY", - description: "Text describing the contents of the tag", - is_string: true, - optional: true), - FastlaneCore::ConfigItem.new(key: :draft, - env_name: "GITHUB_RELEASE_DRAFT", - description: "true to create a draft (unpublished) release, false to create a published one", - is_string: false, - default_value: false), - FastlaneCore::ConfigItem.new(key: :prerelease, - env_name: "GITHUB_RELEASE_PRERELEASE", - description: "true to identify the release as a prerelease. false to identify the release as a full release", - is_string: false, - default_value: false), - - ] - end - - def self.output - [ - ['GITHUB_RELEASE_ID', 'The Github Release ID'], - ['GITHUB_RELEASE_HTML_URL', 'The Github Release URL'], - ['GITHUB_RELEASE_UPLOAD_URL_TEMPLATE', 'The Github Release Upload URL'] - ] - end - - def self.return_value - "The Hash representing the API response" - end - - def self.authors - ["kcharwood"] - end - - def self.is_supported?(platform) - return true - end - end - end -end \ No newline at end of file diff --git a/fastlane/actions/version_get_podspec.rb b/fastlane/actions/version_get_podspec.rb deleted file mode 100644 index b2d82f1..0000000 --- a/fastlane/actions/version_get_podspec.rb +++ /dev/null @@ -1,107 +0,0 @@ -module Fastlane - module Actions - class VersionGetPodspecAction < Action - def self.run(params) - podspec_path = params[:path] - - UI.user_error!("Could not find podspec file at path '#{podspec_path}'") unless File.exist? podspec_path - - version_podspec_file = PodspecHelper.new(podspec_path) - - Actions.lane_context[SharedValues::PODSPEC_VERSION_NUMBER] = version_podspec_file.version_value - end - - ##################################################### - # @!group Documentation - ##################################################### - - def self.description - "Receive the version number from a podspec file" - end - - def self.available_options - [ - FastlaneCore::ConfigItem.new(key: :path, - env_name: "FL_VERSION_PODSPEC_PATH", - description: "You must specify the path to the podspec file", - is_string: true, - default_value: Dir["*.podspec"].last, - verify_block: proc do |value| - UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0 - end) - ] - end - - def self.output - [ - ['PODSPEC_VERSION_NUMBER', 'The podspec version number'] - ] - end - - def self.authors - ["Liquidsoul", "KrauseFx"] - end - - def self.is_supported?(platform) - true - end - end - - class PodspecHelper - attr_accessor :path - attr_accessor :podspec_content - attr_accessor :version_regex - attr_accessor :version_match - attr_accessor :version_value - - def initialize(path = nil) - version_var_name = 'version' - @version_regex = /^(?<begin>[^#]*#{version_var_name}\s*=\s*['"])(?<value>(?<major>[0-9]+)(\.(?<minor>[0-9]+))?(\.(?<patch>[0-9]+))?(\.(?<type>[a-z]+))?(\.(?<buildnumber>[0-9]+))?)(?<end>['"])/i - - return unless (path || '').length > 0 - UI.user_error!("Could not find podspec file at path '#{path}'") unless File.exist?(path) - - @path = File.expand_path(path) - podspec_content = File.read(path) - - parse(podspec_content) - end - - def parse(podspec_content) - @podspec_content = podspec_content - @version_match = @version_regex.match(@podspec_content) - UI.user_error!("AAAAAH!!! Could not find version in podspec content '#{@podspec_content}'") if @version_match.nil? - @version_value = @version_match[:value] - end - - def bump_version(bump_type) - major = version_match[:major].to_i - minor = version_match[:minor].to_i || 0 - patch = version_match[:patch].to_i || 0 - - case bump_type - when 'patch' - patch += 1 - when 'minor' - minor += 1 - patch = 0 - when 'major' - major += 1 - minor = 0 - patch = 0 - end - - @version_value = "#{major}.#{minor}.#{patch}" - end - - def update_podspec(version = nil) - new_version = version || @version_value - updated_podspec_content = @podspec_content.gsub(@version_regex, "#{@version_match[:begin]}#{new_version}#{@version_match[:end]}") - - File.open(@path, "w") { |file| file.puts updated_podspec_content } unless Helper.test? - - updated_podspec_content - end - end - end -end