Skip to content

Commit

Permalink
Fix the source file location for SwiftPM
Browse files Browse the repository at this point in the history
Closes #20
Fixes #19
  • Loading branch information
sindresorhus committed Jul 25, 2019
1 parent 90af210 commit 674fde4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Defaults.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |s|
s.social_media_url = 'https://twitter.com/sindresorhus'
s.authors = { 'Sindre Sorhus' => '[email protected]' }
s.source = { :git => 'https://github.com/sindresorhus/Defaults.git', :tag => "v#{s.version}" }
s.source_files = 'Sources/*.swift'
s.source_files = 'Sources/**/*.swift'
s.swift_version = '5.0'
s.macos.deployment_target = '10.12'
s.ios.deployment_target = '10.0'
Expand Down
14 changes: 11 additions & 3 deletions Defaults.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@
8933C7811EB5B7E0000D00A4 /* Sources */ = {
isa = PBXGroup;
children = (
8933C7841EB5B820000D00A4 /* Defaults.swift */,
E3EB3E34216507AE0033B089 /* Observation.swift */,
E3EB3E32216505920033B089 /* util.swift */,
E30E93D822E9425E00530C8F /* Defaults */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -192,6 +190,16 @@
name = Tests;
sourceTree = "<group>";
};
E30E93D822E9425E00530C8F /* Defaults */ = {
isa = PBXGroup;
children = (
8933C7841EB5B820000D00A4 /* Defaults.swift */,
E3EB3E34216507AE0033B089 /* Observation.swift */,
E3EB3E32216505920033B089 /* util.swift */,
);
path = Defaults;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Tests/DefaultsTests/DefaultsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension Defaults.Keys {
static let key = Key<Bool>("key", default: false)
static let url = Key<URL>("url", default: fixtureURL)
static let `enum` = Key<FixtureEnum>("enum", default: .oneHour)
static let data = Key<Data>("data", default: Data(bytes: []))
static let data = Key<Data>("data", default: Data([]))
static let date = Key<Date>("date", default: fixtureDate)
}

Expand Down Expand Up @@ -88,9 +88,9 @@ final class DefaultsTests: XCTestCase {
}

func testDataType() {
XCTAssertEqual(defaults[.data], Data(bytes: []))
XCTAssertEqual(defaults[.data], Data([]))

let newData = Data(bytes: [0xFF])
let newData = Data([0xFF])
defaults[.data] = newData
XCTAssertEqual(defaults[.data], newData)
}
Expand Down

0 comments on commit 674fde4

Please sign in to comment.