Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 175 forks source link

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

Open JavaAdam opened 6 months ago

JavaAdam commented 6 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 6 months 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 5 months 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 5 months 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 5 months 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.

soucolline commented 3 months ago

After trying to migrate to 2.0.9 i'm getting the exact same behaviour.