GitXplorerGitXplorer
g

Scipio

public
489 stars
31 forks
17 issues

Commits

List of commits on branch main.
Verified
1518a8f9c6b05bdcf5addf41c6a6e307dd7d5916

Merge pull request #172 from giginet/move-privacyinfo

iikesyo committed 4 days ago
Unverified
6cf2c33fc790a82353d3c33f1e5e8ce48888f4e8

Improve a method signature

iikesyo committed 4 days ago
Unverified
2555ffb593f7a802fcf141d36628882fca929c0c

Add `ResourcesProcessor.SourceContext` type to distinguish source and destination contexts

iikesyo committed 4 days ago
Unverified
3f2d629027e2d1daa84e5378ddbbefb567d238f4

Add doc comments

iikesyo committed 4 days ago
Unverified
d0b307012a7f185ba11c152f8fd1bbbf4fbf3c74

Use some over any for arguments

iikesyo committed 4 days ago
Unverified
7c6af8cbfe0c3536f2b3385ea79aa10b11b353cb

Use `seealso`

iikesyo committed 4 days ago

README

The README file for this repository.

Scipio

GitHub Workflow Status (with event) Swift 6.0 Xcode 16.0 SwiftPM Documentation Platforms License

Carthago delenda est

Scipio proposes a new workflow to integrate dependencies into your applications.

This product is highly inspired by Carthage and swift-create-xcframework.

Abstract

SwiftPM is the best way to integrate dependencies into your app. However, build artifacts built by Xcode are difficult to cache.

On the other hand, XCFramework is a good way to keep binaries portable.

Scipio provides a new hybrid way to manage dependencies.

First, use SwiftPM to resolve dependencies and checkout repositories. After that, this tool converts each dependency into XCFramework.

Usage

See Scipio Official Documentation for detail.

Installation

The easiest way to install Scipio is to use nest. nest install giginet/Scipio

Prepare all dependencies for your application

The concept of Scipio, all dependencies wanted to be used in your application should be defined in one Package manifest.

prepare command is to build all dependencies as XCFrameworks in the manifest.

This mode is called prepare mode. See Prepare All Dependencies for Your Application for detail.

Define Package.swift to describe your application's dependencies

// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "MyAppDependencies",
    platforms: [
        // Specify platforms to build
        .iOS(.v14),
    ],
    products: [],
    dependencies: [
        // Add dependencies
        .package(url: "https://github.com/onevcat/APNGKit.git", exact: "2.2.1"),
    ],
    targets: [
        .target(
            name: "MyAppDependency",
            dependencies: [
                // List all dependencies to build
                .product(name: "APNGKit", package: "APNGKit"),
            ]),
    ]
)

Run prepare command

$ scipio prepare path/to/MyAppDependencies
> šŸ” Resolving Dependencies...
> šŸ—‘ļø Cleaning MyAppDependencies...
> šŸ“¦ Building APNGKit for iOS
> šŸš€ Combining into XCFramework...
> šŸ“¦ Building Delegate for iOS
> šŸš€ Combining into XCFramework...
> ā‡ļø Succeeded.

All XCFrameworks are generated into MyAppDependencies/XCFramework by default.

Library Evolution support

Scipio disables to support Library Evolution feature by default.

It means built frameworks can be used only from products built with the same Swift version.

The primary reason why is Library Evolution limitation. In fact, some packages can't build with enabling Library Evolution. (https://developer.apple.com/forums/thread/123253, https://github.com/apple/swift-collections/issues/94, https://github.com/apple/swift-nio/issues/1257)

If you want to distribute generated XCFrameworks, it's recommended to enable Library Evolution. Pass --enable-library-evolution flag if you need. However, it means some packages can't be built.

Build Cache System

By default, Scipio checks whether re-building is required or not for existing XCFrameworks.

$ swift run scipio prepare --cache-policy project path/to/MyAppDependencies
> šŸ” Resolving Dependencies...
> šŸ—‘ļø Cleaning MyAppDependency...
> āœ… Valid APNGKit.xcframework is exists. Skip building.
> āœ… Valid Delegate.xcframework is exists. Skip building.
> ā‡ļø Succeeded.

Scipio supports Project/Local Disk/Remote Disk cache backends.

Using a remote cache, share built XCFrameworks among developers.

See Learn the Cache System for details.

Create XCFramework from a single Swift Package

Scipio also can generate XCFrameworks from a specific Swift Package. This feature is similar to swift-create-xcframework.

$ scipio create path/to/MyPackage
> šŸ” Resolving Dependencies...
> šŸ—‘ļø Cleaning MyPackage...
> šŸ“¦ Building MyPackage for iOS
> šŸš€ Combining into XCFramework...
> ā‡ļø Succeeded.

See Convert Single Swift Package to XCFramework for detail.

Supported Xcode and Swift version

Currently, we support Swift 6.0.

Xcode Swift
āœ… 16.0 6.0

Reliability

Scipio only builts with standard dependencies and Apple official tools to keep reliability.

How to resolve dependencies

Just run swift package resolve.

How to parse package manifests and generate Xcode projects

Scipio depends on swift-package-manager as a library.

Parsing package manifests and generating Xcode project is provided from the package. So it will be maintained in the future.

How to build XCFrameworks

Scipio only uses xcodebuild to build Frameworks and XCFrameworks.

Why Scipio

Scipio names after a historical story about Carthage.