Skip to content

schwiftyos/swift-consolidate-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Consolidate Plugin

Consolidate files that match a predicate into a single file.

Usage

The arguments can be declared in any order, and you can mix and match them (embedded + production outputs a file suitable only for production usage on an embedded device).

Arguments

embedded

Strips imports, unnecessary whitespace (preserving comments and documentation) and code annotated to not work for embedded.

exclude

Exclude directories/files when consolidating.

  • Usage: --exclude <comma separated list of directories/files, relative to the package directory path>
lang

What programming languages you want to consolidate.

  • Usage: --lang <comma separated list of a supported programming language name>

  • Supported Programming Languages

    • C (coming soon)
    • Swift
    • Rust (coming soon)
production

Strips all redundant information and unnecessary whitespace, including comments and documentation, leaving just the bare minimum required to use the code.

recursive

Searches all directory contents.

output

The single file output path where the consolidated data gets written to, relative to the package directory.

Build for embedded

Executing the following command will merge all Swift files contained in the given directory while removing imports and unnecessary whitespace, making it suitable for easy linking when building for embedded.

  • swift package plugin consolidate <sourceDirectory> --embedded --recursive --output <outputPath>

About

Consolidate files that match a predicate into a single file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages