GYB with support for multiple Swift file outputs

I modified Apple's GYB to create a new file when you give it the comment // new gyb file FILE_NAME

Example

// main example.swift file 🎉
let someSwiftCodeInBaseExport: String = "Hello world from the main file!"
% # create 9 files in the directory "example"
% for i in range (1, 10):
// new gyb file file${i}.swift
// Welcome to file ${i}! 🎊
let someSwiftCodeInFile${i}: String = "Hello world from file ${i}!"
% end

This will produce 10 files!

Helps me a lot, and hopefully it could help someone else!

Terms of Service

Privacy Policy

Cookie Policy