在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JamitLabs/Accio开源软件地址(OpenSource Url):https://github.com/JamitLabs/Accio开源编程语言(OpenSource Language):Swift 99.6%开源软件介绍(OpenSource Introduction):Installation • Usage • Supporting Accio • Contributing • License
AccioA dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects. PronunciationSince this question comes up pretty often, here's the official way to pronounce the name of this library: "AH-kee-oh" Rationale: While different opinions seem to exist, the official movies (like in this video), this Harry Potter Wiki article and many latin advocates seem to support the above pronunciation. Requirements
InstallationHomebrew:ViaTo install Accio the first time, run these commands: brew tap JamitLabs/Accio https://github.com/JamitLabs/Accio.git
brew install accio To update it to the latest version, run this instead: brew upgrade accio Mint:ViaTo install Accio or update to the latest version, run this command: mint install JamitLabs/Accio Why should I use this?TL;DR: It offers many improvements over Carthage and is targeted towards SwiftPM's integration into Xcode. To learn more about the motivation, rationale & design of Accio, read this blog post. Alternatively, read the following expandable summary: Summary of the Motivation & AdvantagesFor developers on Apple platforms there are already well established dependency managers, namely CocoaPods & Carthage. If you like how CocoaPods deals with things, you probably won't ever need to use Accio. It doesn't do anything that CocoaPods doesn't. But if you are like the many developers who prefer to use Carthage because it's written in Swift (not Ruby) and it doesn't create an Xcode workspace but is rather unintrusive, you might find that Accio solves some of the problems you might have come across with Carthage. Accios main advantages over Carthage as of now are:
Accio was designed as the all-in-one tool for any improvements you might need for managing dependencies using Carthage. It's explicitly open for new features from the community as long as they improve aspects of dependency management for the Apple developer community. Additionally, the core of Accio was designed to use SwiftPM as much as possible because we think it will at some point replace the need for an extra dependency manager completely. Until that time, making an open source project "Accio compliant" basically means adding a manifest file that exactly matches that of UsageGetting StartedThis section describes on how to get started with Accio. Deintegrating Carthage (optional)If you want to migrate your Carthage-driven project to Accio, here are the steps to deintegrate Carthage:
InitializationTo configure Accio in a new project, simply run the accio init -p "XcodeProjectName" -t "AppTargetName" This step will create a template Run Adding DependenciesAccio uses the official SwiftPM manifest format for specifying dependencies. So in order to add a dependency, you will need to do two things:
Here's an example // swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "XcodeProjectName",
products: [],
dependencies: [
.package(url: "https://github.com/Flinesoft/HandySwift.git", .upToNextMajor(from: "2.8.0")),
.package(url: "https://github.com/Flinesoft/HandyUIKit.git", .upToNextMajor(from: "1.9.1")),
.package(url: "https://github.com/JamitLabs/MungoHealer.git", .upToNextMajor(from: "0.3.2")),
.package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver.git", from: "1.6.2"),
.package(url: "https://github.com/radex/SwiftyUserDefaults.git", .upToNextMajor(from: "4.0.0")),
],
targets: [
.target(
name: "AppTargetName",
dependencies: [
"HandySwift",
"HandyUIKit",
"MungoHealer",
"SwiftyBeaver",
"SwiftyUserDefaults",
],
path: "AppTargetName"
),
]
) Installing DependenciesTo install the dependencies, you can use either the accio install When running this the first time in a project, the following steps will be taken:
On future runs, both Please note that before running any of the install commands, you should close your project if you have it open in Xcode. Otherwise some unexpected problems could occur when Accio rewrites the project file. Additionally, for both install commands you can provide a path to a shared cache to copy the build products to instead of the local cache. For example: accio install -c '/Volumes/GoogleDrive/Team Share/AccioSharedCache' Specifying this can drastically cut your teams total dependencies building time since each commit of a dependency will be built only once by only one person in the team. Please note that a global cache is planned to be added as an opt-in option in the near future for those who trust our CI setup regarding security. Details will follow. Run Configuring Accio's default behaviorYou can configure Accio to always automatically use a shared cache path without the need to specify it as an option by writing it into the Accio config file like so: accio set-shared-cache /Volumes/GoogleDrive/TeamShare/AccioCache Note that the config file is saved to Clearing local CacheSince Accio automatically caches any build products locally on your machine, this can result in the cache taking up quite some space after a while. So you might want to clear up the local cache from time to time by running the accio clear-cache This will remove all build products from the cache and tell you how much file size was freed up. Please note that there's currently no way of clearing a shared cache to prevent any accidental deletes by a single team member. Please do this manually if your shared space gets too filled up. Note: There is also a Adding support for AccioMost libraries that are compatible with SwiftPM should automatically work with Accio. There's also a Demo project with integration tests on the CI to ensure most Swift frameworks on GitHub with at least 1,000 stars support Accio. Libraries that are compatible with Carthage can be easily made compatible with Accio by simply adding a // swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "LibraryName",
// platforms: [.iOS("8.0"), .macOS("10.10"), .tvOS("9.0"), .watchOS("2.0")],
products: [
.library(name: "LibraryName", targets: ["LibraryName"])
],
targets: [
.target(
name: "LibraryName",
path: "LibraryName"
)
]
) Please note that the commented If the library has subdependencies, link the projects within the // swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "LibraryName",
// platforms: [.iOS("8.0"), .macOS("10.10"), .tvOS("9.0"), .watchOS("2.0")],
products: [
.library(name: "LibraryName", targets: ["LibraryName"])
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/antitypical/Result.git", .upToNextMajor(from: "4.0.0")),
],
targets: [
.target(
name: "LibraryName",
dependencies: ["Alamofire", "Result"],
path: "LibraryName"
)
]
) Refer to the official Package manifest documentation for details on how it can be configured, for example the other options for the version range specification of dependencies. If you come across any issues with a dependency that you expect to work with Accio, please open an issue on GitHub. Official BadgeTo hint that your project supports installation via Accio, add the following to the top of your [![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio) ContributingSee the file CONTRIBUTING.md. LicenseThis library is released under the MIT License. See LICENSE for details. Logo Design by Dogan Duran. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论