Hi, well, question is probably basic, I've googled a bit, but decided to post here as googling might or might not lead to proper conclusion.
I am using plain Swift setup on Linux (no IOS/Xcode or other mumbo jumbo) things. Simple Swift project, developing with VS Code. (everything works fine build, code completion, debugging etc)
Now I have structure like this
I am using it for learning purpose etc.
HelloSwift subfolder was created automatically by Swift package manager.
I added ErrorHandling folder and put some code into it.
To use ErrorHandling stuff in HelloSwift code I had to add target (googling and trial and error approach led mi there) to Package.swift (this way project builds no problemo):
.target( name: "ErrorHandling", dependencies: ), .target( name: "HelloSwift", dependencies: ["ErrorHandling"]),
where I want to use it in
Now - the question is... is this really right way? I mean adding subfolder of Source folder as target
effectively make it module and well... I can't say it is because I am not sure but seems like too
much to have to add subfolder as target to be able to use it from other source folder in the same project
I have worked with many different platforms and if subfolder of Swift project source is what is ...I don't know... Maven module within maven project or one of the projects within .net solution then...OK... I am just checking.
Any other way is more errr how to say.... "Swifty"?
(I have read though about naming files like:
and putting into same folder but, well, I wanted clearer and more explicit this way of structuring)
Thanks in advance