Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Latest commit

 

History

History
590 lines (416 loc) · 12.2 KB

ManifestSpec.md

File metadata and controls

590 lines (416 loc) · 12.2 KB

Manifest Spec


General

Manifest file can be written in YAML. Required properties are marked with checkbox. Manifest file should be named package.yml and should be located at the root of package (like vanilla Pacakge.swift file). package.yml has structure of Package object at the top level and can be ympty if needed.
Manifest depends on Packagefile that allows to omit some repeating properties (like swiftToolsVersion or platforms ) by declaring them in Packagefile as default to reduce manifest files size.

Here is an exapmle of project hierarchy before and after running pkgen generate command:

Before generation
project_root/
├── ...
├── Packagefile
└── packages/
    ├── PackageA/
        ├── Sources/...
        └── package.yml
    ├── PackageB/
        ├── Sources/...
        └── package.yml
    └── PackageC/
        ├── Sources/...
        └── package.yml
After generation
project_root/
├── ...
├── Packagefile
└── packages/
    ├── PackageA/
        ├── Sources/...
        ├── Package.swift
        └── package.yml
    ├── PackageB/
        ├── Sources/...
        ├── Package.swift
        └── package.yml
    └── PackageC/
        ├── Sources/...
        ├── Package.swift
        └── package.yml

Package

type: object

  • swiftToolsVersion: String - Value from Packagefile (if any) will be used if not presented. If Packagefile and manifest don't have this property parsing will fail
  • name: String - Directory name where this file located will be used if not presented
  • defaultLocalization: String - Value from Packagefile (if any) will be used if not presented
  • platforms: Platforms - Value from Packagefile (if any) will be used if not presented
  • pkgConfig: String - Value from Packagefile (if any) will be used if not presented
  • providers: [Provider] - Value from Packagefile (if any) will be used if not presented
  • products: [Product] - Single default product will be used if not presented:
  • dependenies: [PackageDependency]
  • targets: [Target] - Single default target will be used if not presented:
  • swiftLanguageVersions: [SwiftVersion] - Value from Packagefile (if any) will be used if not presented
  • cLanguageStandard: CStandard - Value from Packagefile (if any) will be used if not presented
  • cxxLanguageStandard: CXXStandard - Value from Packagefile (if any) will be used if not presented
Default product
type: library
name: <provided_name>
targets:
  - <provided_name>
Default target
type: target
name: <provided_name>
dependencies:
  - <provided_name>
path: Sources

Platforms

type: object


IOSVersion

type: enum

v8
v9
v10
v11
v12
v13
v14


MacOSVersion

type: enum

v10_10
v10_11
v10_12
v10_13
v10_14
v10_15
v11


TVOSVersion

type: enum

v9
v10
v11
v12
v13
v14


WatchOSVersion

type: enum

v2
v3
v4
v5
v6
v7


Provider

type: object

  • type = apt
  • packages: [String]

or

  • type = brew
  • packages: [String]

or

  • type = yum
  • packages: [String]

Product

type: object

  • type = executable
  • name: String
  • targets: [String]

or

  • type = library
  • name: String
  • targets: [String]
  • linking: LinkingType - auto by default

LinkingType

type: enum

static
dynamic
auto


PackageDependency

type: object or string

  • If string is provided, parser will search for dependency with same id in Packagefile firstly.
  • If Packagefile's dependency were not found and string represents some local path (i.e. it contains '/'), parser will search for package at provided path.
  • If provided string isn't local path (i.e. doesn't contain '/'), parser will search for local package at '../<PROVIDED_STRING>' path by default.

'SomeDependencyIDFromPackagefile'

or

'../../some/path/to/local/package'

or

'OtherLocalPackageName'

or

  • path: String
  • name: String

or

  • url: String
  • from: String
  • name: String

or

  • url: String
  • branch: String
  • name: String

or

  • url: String
  • exact: String
  • name: String

or

  • url: String
  • revision: String
  • name: String

or

  • url: String
  • upToNextMajor: String
  • name: String

or

  • url: String
  • upToNextMinor: String
  • name: String

or

  • url: String
  • from: String
  • to: String
  • name: String

or

  • url: String
  • from: String
  • upTo: String
  • name: String

Target

type: object

  • type = binaryTarget
  • name: String
  • path: String

or

  • type = binaryTarget
  • name: String
  • url: String
  • checksum: String

or

  • type = systemLibrary
  • name: String
  • path: String
  • pkgConfig: String
  • providers: [Provider]

or

or


TargetDependency

type: object or string

or

or


TargetDependencyCondition

type: object


Resource

type: object

  • type = copy
  • path: String

or


ResourceLocalization

type: enum or string


'some_localization_tag'

or

base
default


CSetting

type: object

or

or


CXXSetting

type: object

or

or


SwiftSetting

type: object

or


LinkerSetting

type: object

or

or


BuildSettingCondition

type: object


BuildConfiguration

type: enum

debug
release


Platform

type: enum

android
iOS
linux
macOS
tvOS
wasi
watchOS
windows


SwiftVersion

type: enum

3
4
4_2
5


CStandard

type: enum

c89
c90
c99
c11
gnu89
gnu90
gnu99
gnu11
iso9899_1990
iso9899_199409
iso9899_1999
iso9899_2011


CXXStandard

type: enum

cxx98
cxx03
cxx11
cxx14
gnucxx98
gnucxx03
gnucxx11
gnucxx14