yonaskolb / Beak

A command line interface for your Swift scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for including other Swift files

Jeehut opened this issue · comments

Some of my beak.swift files became quite long recently and I fell like I'd rather split them into separate files with separate contexts. I'm not sure if this is possible at the moment somehow, but I couldn't find something. What I'm thinking of is something like this:

// include: beakScripts/DependencyManagement.swift
// include: beakScripts/ProjectInitializer.swift
// include: beakScripts/Utility.swift

This way one could keep the beak.swift file small and only import dependencies that are needed in the smaller files. Internally, Beak could simply replace the above entries with the files contents and build the result only reordering the dependency declarations to the top (if needed, I'm not sure if they can be declared somewhere down the line). So this should not be too hard to implement.

Alternatively the following could also be possible to include all Swift files in a directory:

// include: beakScripts