Beak icon indicating copy to clipboard operation
Beak copied to clipboard

Add support for including other Swift files

Open Jeehut opened this issue 6 years ago • 0 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

Jeehut avatar Oct 25 '18 10:10 Jeehut