Generates Artifact Bundle from Swift Package (Executable only)
# Go to Package directory. it is expeced that ArtifactBundleGen is added as command plugin in Package.swift
$ cd some-awesome-tool
# Call build command
$ swift build -c debug --arch arm64 --arch x86_64
# .build is generated
# Call command
$ swift package plugin generate-artifact-bundle --package-version 0.5.11 --executable-name some-awesome-tool --build-config debug --build-folder .build
$ ls
> some-awesome-tool.artifactbundle.ziplet package = Package(
name: "SomeTools",
products: [
// ... some products
],
dependencies: [
// ... some dependencies
.package(url: "https://github.com/freddi-kit/ArtifactBundleGen.git", .exact("0.0.2"))
],# Call build command
$ swift build -c debug --arch arm64 --arch x86_64$ swift package plugin generate-artifact-bundle --package-version {version} --executable-name {executable-name} --build-config {config} --build-folder {folder}{tool_name}.artifactbundle will be generated!
- --executable-name: Name of Aritfact Bundle. Please specify executable product's
namestring
let package = Package(
...
products: [
// here
.executable(name: {executable-name}, targets: [...]),
],- --build-config: build config.
debugorrelease
- --package-version: version of package (default is 1.0.0)
- --build-folder: version of package (default is .build)
- --include-resource-path: path to add as resources to artifact bundle (multiple is okay)
- --universal-binary-folder: folder containing the multi-architecture (
--arch arm64 --arch x86_64) build. By default{build-folder}/apple/Products/{Config}and{build-folder}/out/Products/{Config}(Swift 6.4+) are searched. The output ofswift build --show-bin-path(with the same flags as your build) can be passed here.
If no built executable is found, the command fails instead of generating an empty artifact bundle.
swift package plugin generate-artifact-bundle --package-version ... \
--include-resource-path some-awesome-bundle.bundle \
--include-resource-path some-awesome-image.jpg \
Zip file is generated!
$ ls
> {tool_name}.artifactbundle.zip- Suport XCFramework