-
-
Notifications
You must be signed in to change notification settings - Fork 15
Description
First, šthank youš for taking a shot at fixing the problem you're trying to solve! I'm frustrated by the tooling standing in the way of modularizing Swift codebases all day long every day. So, I really hope this tool takes off. š
I may not be understanding everything (or much at all) so I'll break this up into my assumptions, my use case, and then my suggestion(s)...all based on those assumptions š
Assumptions
- Everything in "Sourcesā¢Model" is compiled against all platforms in the Cakefile
- Modules are not created for folders in "Sourcesā¢App"
- There is currently no way to limit the platforms a specific module in "Sourcesā¢Model" is compiled against
- The intention is for all platform-specific code to go in "Sourcesā¢App"
- The developer is expected to create each application target (excluding the one the Cake menu app will create for you).
Use case
- Large project, targeting iOS, macOS, tvOS, and watchOS
- Non-trivial UI for each platform. Lots of view controllers, lots of "components" (similar to React, small reusable UI bits).
For my situation, micro modules would offer just as much benefit to my application-specific code as my domain/model code. In fact, my UI code would probably benefit even more. That is where I find myself using nested types for the sole purpose of faking namespaces more frequently than anywhere else. Nested types are fine, but I've found that Xcode/SourceKit/Something-else-in-the-tool-chain falls over after a certain depth and all I see is <<error type>> in Xcode's autocomplete dialogs.
Suggestions
- Add support for limiting which platforms a specific module is built for. Maybe that takes the form of a Cakefile in a module's directory, or platform-specific "Sourcesā¢Modulesā¢[platform]" directories...which could be auto generated using the
platformssetting in the root Cakefile. The goal being platform-specific-modules in a multi-platform project. - Rename "Sourcesā¢Model" to "Sourcesā¢Modules"
To be clear, this is only necessary for a multi-platform project. What I'm wanting to do is already totally doable for a single-platform project.