swift-package-manager

Xcode 12.5: SPM Dependency Cache Location

孤人 提交于 2021-02-19 05:58:05
问题 Swift Package Manager got a new feature in Xcode 12.5: Swift Package Manager caches package dependencies on a per-user basis, which reduces the amount of network traffic and increases performance of dependency resolution for subsequent uses of the same package. If needed, you can disable cache use in xcodebuild by using the new -disablePackageRepositoryCache flag. (72204929) I would like to know where this is cached. Maybe we can use this to easily cache those dependencies in continuous

Explicitly manage Swift Package nested dependencies required?

随声附和 提交于 2021-02-08 13:17:16
问题 I'm moving my Carthage libraries to Swift Package Manager. If my Swift Package has dependencies to other Swift Packages, do I have to explicitly link those libraries into the project like I do with Carthage, or are the nested dependencies embedded in the Swift Package? 来源: https://stackoverflow.com/questions/57659938/explicitly-manage-swift-package-nested-dependencies-required

How to access my app’s derived data folder itself?

烂漫一生 提交于 2021-02-05 02:53:55
问题 I’m in the middle of moving my iOS app’s Firebase dependency from CocoaPods to Swift Package Manager. Firebase’s Crashlytics requires a script to be executed while the app is building (using the Run Script build phase). Back in the CocoaPods days, I used to call the script the way documented by Google: "${PODS_ROOT}/FirebaseCrashlytics/run" . After I’ve switched to SPM, Firebase files are no longer in ${PODS_ROOT} , and there’s no such variable available at all. I know the file I need is now

How to access my app’s derived data folder itself?

会有一股神秘感。 提交于 2021-02-05 02:53:38
问题 I’m in the middle of moving my iOS app’s Firebase dependency from CocoaPods to Swift Package Manager. Firebase’s Crashlytics requires a script to be executed while the app is building (using the Run Script build phase). Back in the CocoaPods days, I used to call the script the way documented by Google: "${PODS_ROOT}/FirebaseCrashlytics/run" . After I’ve switched to SPM, Firebase files are no longer in ${PODS_ROOT} , and there’s no such variable available at all. I know the file I need is now

Unable to Resolve Build File: Reference to Missing Target with GUID

ⅰ亾dé卋堺 提交于 2021-01-29 14:00:22
问题 I recently forked an iOS library on GitHub to add support to it for the Swift Package Manager. Here's the repository: https://github.com/skelpo/mapbox-gl-native-ios When I add it to a completely new iOS app and try to build it, I get this error: Unable to resolve build file: XCBCore.BuildFile (The workspace has a reference to a missing target with GUID 'PACKAGE-TARGET:Mapbox') I've found posts for similar errors, such as this one, but the reason for the build file failing to resolve is

Does CoreML work with the swift package manager?

为君一笑 提交于 2021-01-28 20:10:59
问题 Can I use the CoreML framework in a Swift package manager executable? Or is it limited to iOS and OSX apps ? 回答1: As far as I know, Core ML currently only runs on iOS or macOS. Apple isn't in the habit of making their frameworks available for other platforms. ;-) 来源: https://stackoverflow.com/questions/53055956/does-coreml-work-with-the-swift-package-manager

Using a pod from inside a swift package

半腔热情 提交于 2021-01-27 19:35:08
问题 I'm making my app modularized using Swift Package Manager by separating various parts of the app into different layers (packages): Presentation, Business and Data to make it as clean as possible, and I link those manually created packages with the project in project settings -> Frameworks, Libraries and Embedded Content section. However, I'm still in need for Cocoa Pods in some parts of the project, for simplicity my pod file contains the following: target 'SampleApp' do use_frameworks! pod

Swiftlint overriding project settings related to SPM

帅比萌擦擦* 提交于 2021-01-22 06:49:09
问题 I am running into a strange behavior with swiftlint autocorrect. My project uses a library imported through SPM. But when I run the linter, it changes settings like the following B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */ = {isa = PBXBuildFile; productRef = B4621A7223D0A90F00545ADE /* LibraryName */; }; files = ( B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */, packageProductDependencies = ( B4621A7223D0A90F00545ADE /* LibraryName */, packageReferences = (

Swiftlint overriding project settings related to SPM

人走茶凉 提交于 2021-01-22 06:47:06
问题 I am running into a strange behavior with swiftlint autocorrect. My project uses a library imported through SPM. But when I run the linter, it changes settings like the following B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */ = {isa = PBXBuildFile; productRef = B4621A7223D0A90F00545ADE /* LibraryName */; }; files = ( B4621A7323D0A90F00545ADE /* LibraryName in Frameworks */, packageProductDependencies = ( B4621A7223D0A90F00545ADE /* LibraryName */, packageReferences = (

Can I specify a platform target when running swift test from the CLI?

[亡魂溺海] 提交于 2021-01-12 05:11:39
问题 My Package.swift looks something like let package = Package( name: "MyPackage", platforms: [ .iOS(.v13) ], products: [ .library( name: "MyPackage", targets: ["MyPackage"]) ], dependencies: [ .package(url: "https://github.com/SnapKit/SnapKit.git", from: "5.0.0"), ], targets: [ .target( name: "MyPackage", dependencies: [ "SnapKit", ]), .testTarget( name: "MyPackageTests", dependencies: ["MyPackage"]) ] ) When I run swift test I get error: the library 'MyPackage' requires macos 10.10, but