Bundle.privateFrameworks
This commit is contained in:
@@ -9,11 +9,22 @@ public extension Bundle {
|
||||
return str.flatMap(Path.init)
|
||||
}
|
||||
|
||||
/// Returns the path for the shared-frameworks directory in this bundle.
|
||||
/**
|
||||
Returns the path for the shared-frameworks directory in this bundle.
|
||||
- Note: This is typically `ShareFrameworks`
|
||||
*/
|
||||
var sharedFrameworks: Path {
|
||||
return sharedFrameworksPath.flatMap(Path.init) ?? defaultSharedFrameworksPath
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the path for the private-frameworks directory in this bundle.
|
||||
- Note: This is typically `Frameworks`
|
||||
*/
|
||||
var privateFrameworks: Path {
|
||||
return privateFrameworksPath.flatMap(Path.init) ?? defaultSharedFrameworksPath
|
||||
}
|
||||
|
||||
/// Returns the path for the resources directory in this bundle.
|
||||
var resources: Path {
|
||||
return resourcePath.flatMap(Path.init) ?? defaultResourcesPath
|
||||
|
||||
@@ -361,6 +361,7 @@ class PathTests: XCTestCase {
|
||||
let bndl = Bundle(path: tmpdir.string)!
|
||||
XCTAssertEqual(bndl.path, tmpdir)
|
||||
XCTAssertEqual(bndl.sharedFrameworks, tmpdir.SharedFrameworks)
|
||||
XCTAssertEqual(bndl.privateFrameworks, tmpdir.Frameworks)
|
||||
XCTAssertEqual(bndl.resources, tmpdir)
|
||||
XCTAssertNil(bndl.path(forResource: "foo", ofType: "bar"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user