It feels a bit stupid having to make barrels now, while I already made perfectly stand alone classes.
Is there no way to just include these from a shared folder or something?
It feels a bit stupid having to make barrels now, while I already made perfectly stand alone classes.
Is there no way to just include these from a shared folder or something?
I do it all the time.
Here's part of a monkey.jungle from a project where I just pull in the mc files from barrel projects instead of using the .barrel files.
srcBase=source resBase=resources #barrel projects barBgWu=..\BgWu barBgSettings=..\BgSettings #pull in the .mc files for those barrels base.sourcePath=$(srcBase);$(barBgWu);$(barBgSettings)
I can use .barrel files for some things and save the overhead of barrels by using the code directly this way
You are my savior! Exactly what I was looking for!
I don't really understand why would you use Barrels then?
When barrels were first introduced, I cleaned up some of my code and had about 12 barrels as a result. Though I only have a few apps that still use them as .barrels, I find it's a nice way to keep common stuff organized with barrel projects. And can have them in my VS Code workspace just like other projects.
But you can just add a folder with your classes too to your workspace. The only advantage I see with Barrels is that you can Annotate code and leave out certain parts for certain watches etc.
Remember, I started with barrels years ago, and when Eclipse was the only option. I had used the links in eclipse for shared code at the time. And then when VS Code was introduced, I needed a way to make things work barrel/non barrel, Eclipse and VS C. I'd likely do things differently if I was just starting out today.