MergeFile - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://qb64phoenix.com/forum/forumdisplay.php?fid=9) +---- Thread: MergeFile (/showthread.php?tid=1335) |
MergeFile - SMcNeill - 12-27-2022 Code: (Select All) $If WIN Then @grymmjack Was asking for a quick little program to merge $INCLUDE files into a single BAS file, so I sat down and wrote this one up in about 15 minutes. I haven't tested it extensively as I'm kinda distracted with my niece's kids visiting today, but it appeared to work without any issues with QB64PE.BAS and merged it all into one file easily enough. Give it a try if you're interested in this type of thing, and if you manage to break it, post me a note on how you did so an I'll update it with a fix as soon as I get a little free time later. RE: MergeFile - grymmjack - 12-27-2022 Thanks SMcNeill - I tried to tag you, but it didn't seem to work. Any way... This is just what I needed! After the discord DMs we figured out a few things. First, I have gone a little crazy on how scaffolded the project I needed this for is! LOL. https://github.com/grymmjack/DRAW (this is the one). Second, for some reason the "../" relative paths were breaking the flattener process. I removed those and we got it to churn through the entire thing. Third, as the source has evolved a little bit I'll post the one I used here: Code: (Select All) '' Last here is a video showing how the stack counter and indention helps to see what includes are including other includes (lol): https://app.screencast.com/v89y1GUNVSQG4?conversation=bt79WgOJvELq0FLXws7IsI RE: MergeFile - SpriggsySpriggs - 12-28-2022 Also, if you use PowerShell: Code: (Select All) Shell Hide "PowerShell -NoProfile Get-Content .\*.bas ^| Out-File .\Merged.bas" You may or may not need the caret. I've needed it before to escape the pipe in SHELL. RE: MergeFile - grymmjack - 01-10-2023 Thanks Spriggsy on PS tip. The main thing I was after was a 100% replica of what is included in the final output evaluating everything as the compiler would. Since the PS would be a big concatenation and have no idea where includes happened and stuff it wouldn't be identical. I appreciate the suggestion and will remember the tip. I used to do this in old days to take many files and make them into one for binary. I think it was copy /b in DOS? RE: MergeFile - SpriggsySpriggs - 01-10-2023 There was also a utility made on the old forum for merging bas files. I used to use it all the time for my InForm programs because it was a hassle trying to distribute those. Lots of dependencies for the source and whatnot. You just open the main bas file and all the files it needs gets dumped to a new file with no blank spaces. I had made a GUI for it as well. I'd have to find it, though. RE: MergeFile - a740g - 01-10-2023 (01-10-2023, 03:38 PM)Spriggsy Wrote: There was also a utility made on the old forum for merging bas files. I used to use it all the time for my InForm programs because it was a hassle trying to distribute those. Lots of dependencies for the source and whatnot. You just open the main bas file and all the files it needs gets dumped to a new file with no blank spaces. I had made a GUI for it as well. I'd have to find it, though. This one? QB64-Museum/Bin2Include at main · a740g/QB64-Museum (github.com) Although, I am not sure if this is the latest. RE: MergeFile - SpriggsySpriggs - 01-10-2023 (01-10-2023, 05:16 PM)a740g Wrote:(01-10-2023, 03:38 PM)Spriggsy Wrote: There was also a utility made on the old forum for merging bas files. I used to use it all the time for my InForm programs because it was a hassle trying to distribute those. Lots of dependencies for the source and whatnot. You just open the main bas file and all the files it needs gets dumped to a new file with no blank spaces. I had made a GUI for it as well. I'd have to find it, though. @a740g Nah, that one is for including binaries. There was another one a while back just for merging source files. I'll try finding it. RE: MergeFile - SpriggsySpriggs - 01-10-2023 Ah! Well, I didn't find my GUI thing I made for it but I did find (I think) the original post for the source merger utility. OpenInclude, soon to be made a SMART code merger. (alephc.xyz) RE: MergeFile - grymmjack - 04-18-2023 (01-10-2023, 05:20 PM)Balderdash Wrote: Ah! Well, I didn't find my GUI thing I made for it but I did find (I think) the original post for the source merger utility. Thank you! |