diff --git a/.travis.yml b/.travis.yml index a247a79..ce42220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode10 +osx_image: xcode10.2 env: global: - LC_CTYPE=en_US.UTF-8 @@ -7,10 +7,10 @@ env: - PROJECT=FileKit.xcodeproj - IOS_FRAMEWORK_SCHEME="FileKit-iOS" - MACOS_FRAMEWORK_SCHEME="FileKit-OSX" - - IOS_SDK=iphonesimulator12.0 - - MACOS_SDK=macosx10.13 + - IOS_SDK=iphonesimulator12.2 + - MACOS_SDK=macosx10.14 matrix: - - DESTINATION="OS=12.0,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="NO" + - DESTINATION="OS=12.2,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="NO" - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK" RUN_TESTS="YES" before_install: - gem install xcpretty --no-rdoc --no-ri --no-document --quiet diff --git a/FileKit.podspec b/FileKit.podspec index a4412fc..6eff8c2 100644 --- a/FileKit.podspec +++ b/FileKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "FileKit" - s.version = "5.2.0" + s.version = "5.3.0" s.summary = "Simple and expressive file management in Swift." s.homepage = "https://github.com/nvzqz/FileKit" s.license = { :type => "MIT", :file => "LICENSE.md" } diff --git a/Package.swift b/Package.swift index c11c1b7..845b0bf 100644 --- a/Package.swift +++ b/Package.swift @@ -1,3 +1,4 @@ +// swift-tools-version:4.2 // // Package.swift // FileKit @@ -29,7 +30,23 @@ import PackageDescription let package = Package( name: "FileKit", - exclude: [ - "Tests" + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "FileKit", + targets: ["FileKit"]), + ], + dependencies: [], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "FileKit", + dependencies: [], + path: "Sources"), + .testTarget( + name: "FileKitTests", + dependencies: ["FileKit"], + path: "Tests") ] ) diff --git a/Sources/DataType.swift b/Sources/DataType.swift index ea06023..a1a4758 100644 --- a/Sources/DataType.swift +++ b/Sources/DataType.swift @@ -47,7 +47,7 @@ extension Readable { /// /// - Parameter path: The path being read from. /// - public init(contentsOfPath path: Path) throws { // swiftlint:disable:this valid_docs + public init(contentsOfPath path: Path) throws { self = try Self.read(from: path) } @@ -77,7 +77,7 @@ extension Writable { /// /// - Parameter path: The path being written to. /// - public func write(to path: Path) throws { // swiftlint:disable:this valid_docs + public func write(to path: Path) throws { try write(to: path, atomically: true) } diff --git a/Tests/FileKitTests.swift b/Tests/FileKitTests.swift index 49d2dab..bd3ac14 100644 --- a/Tests/FileKitTests.swift +++ b/Tests/FileKitTests.swift @@ -199,7 +199,11 @@ class FileKitTests: XCTestCase { let directories = children.filter { $0.isDirectory } - guard let directory = directories.first, let childOfChild = directory.children().first else { + if let directory = directories.first, directory.children().isEmpty { + try? (directory + "childOfChild").createDirectory() + } + + guard let directory = directories.first, let childOfChild = directory.children().first else { XCTFail("No child of child into \(p)") return }