Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.66k stars 171 forks source link

Output definitions in Cuckoofile.toml are ignored/in conflict using CuckooPluginFile. #494

Open JavaAdam opened 2 months ago

JavaAdam commented 2 months ago

CuckooPluginFile ist overriding all output definitions by setting CUCKOO_OVERRIDE_OUTPUT to an output on the derived data directory. This leads to two unexpected behaviors:

So the Swift Package Manager approach is usable for very simple projects only.

MatyasKriz commented 1 month ago

Hey @JavaAdam, thanks for letting me know.

I won't have access to my computer for a few more days so I can't really think of a better solution, do you have one in mind for complex projects?

JavaAdam commented 1 month ago

To be honest, i am not familiar with restrictions concerning the Swift Package Manager Plugin. But I would just expect, that the output definitions in Cuckoofile.toml are respected/effective. So that the developer is free to define whatever is needed for his particular project.

When it's not possible to write somewhere else than in the derived data directory, than the developer would be responsible to define correct outputs in derived data. A descriptive message in the build log would be helpful here.

dr-star commented 1 month ago

Hello @JavaAdam could you share your Cuckoofile.toml?

  • When a global output is defined in the Cuckoofile.toml an error is thrown because "two global output definitions" are set.
JavaAdam commented 1 month ago

Hello @dr-star. Unfortunately, I dropped the branch a while ago.

But as I remember I did something like this:

[modules.MyProject] output = "${PROJECT_DIR}/MyTarget/Tests/MyGeneratedMocks.swift"

Defining additional a global output failed with a "two global output definitions" error message.