Comments (11)
After some investigations I managed to run the CockkoPluginSingleFile
by adding
plugins: [
.plugin(name: "CuckooPluginSingleFile", package: "Cuckoo")
]
to my package definition but now i'm getting the same errors as mentioned in this issue
from cuckoo.
Hey, @soucolline, that message is not an error per se, it's only a disclaimer when multiple outputs are defined in Cuckoofile, but I agree that it should be fixed and hidden when the Swift build tool plugin forces the derived data mock output.
However, it shouldn't cause any issues otherwise, do the mocks not get generated? Unfortunately I think it's not possible to generate the mocks anywhere else as a Swift build tool plugin, maybe an investigation is in order.
from cuckoo.
Hey @MatyasKriz thanks for the answer, the mocks are generated on the derivedData folder when I specify the plugin option in my Package.swift
If it's impossible to generate mocks outside of the derivedData maybe a third option with a CLI to generate the mocks whenever you want could work ? So that you don't have to rely on the plugin or a script phase
from cuckoo.
I'm not sure I understand, you can simply call the run
script as defined in the script phase and it will work as you need, you can call it whenever you want and have the mocks generated.
Did I miss something?
from cuckoo.
Oh ok I didn't see I could do that. I've tried running cuckoonator script and the mocks are created at the right location with it. I'll continue to dig a bit but it sounds good
from cuckoo.
Ok I've migrated everything to 2.0.9 and it's working fine !
The only thing a bit annoying is that Cuckoo is located in the derived data because of how SPM works, the name of the folder is always changing so if I clean the project i need to find again the location of Cuckoo + rerun the run file which takes a bit of time to compile.
I'm wondering if it's technically possible to make a complete CLI of Cuckoo (which you would download from homebrew for exemple) ? This way you completely abstract the code generation from Xcode or a dependency manager and it can be run from anywhere (as long as you specify the location of the TOML file)
from cuckoo.
I think there's nothing preventing the creation of a CLI which manages the Cuckoonator version (this would allow specifying it in Cuckoofile as well, sounds cool), fetching it if it's not present and running it.
Unfortunately I don't have enough free time on my hands to implement it in the foreseeable future.
from cuckoo.
For sure that's an idea worth exploring, I'll try to play a bit with it on my side
from cuckoo.
Hey @MatyasKriz, I've played a bit with it this week-end and ended up making this repository : https://github.com/soucolline/homebrew-cuckoo
It's simply storing the Cuckoonator binary and then you can install it globally using homebrew
brew tap soucolline/homebrew-cuckoo
brew install cuckoonator
This way you can run cuckoonator
whenever you want from the root of you project to generate the mocks
I find it a great installation + run alternative as it is not dependant on any package manager and can be installed the same using cocoapods / carthage and SPM and doesn't require any script phase or plugin.
I'll be maintaining and using it for my work and personal projects but if you want to officially support it one day it's only uploading a targ.gz of the Cuckoonator executable (I've used this https://bharathvaj-ganesan.medium.com/how-to-publish-your-nodejs-application-on-homebrew-7a24de9ea973)
from cuckoo.
Thanks for letting me know, perhaps some users will prefer this way of distribution. 🙂
I've been thinking of making the distributed binary a Cuckoonator manager, so that it will automatically make sure it's using the correct generator version to match the project's, but is customizable through Cuckoofile if needed.
from cuckoo.
Ok I've migrated everything to 2.0.9 and it's working fine !
The only thing a bit annoying is that Cuckoo is located in the derived data because of how SPM works, the name of the folder is always changing so if I clean the project i need to find again the location of Cuckoo + rerun the run file which takes a bit of time to compile.
I'm wondering if it's technically possible to make a complete CLI of Cuckoo (which you would download from homebrew for exemple) ? This way you completely abstract the code generation from Xcode or a dependency manager and it can be run from anywhere (as long as you specify the location of the TOML file)
Hi @soucolline ,
I have the same issue, and this is my workaround
Then I also created .sh file and can run with cmd.
from cuckoo.
Related Issues (20)
- Mock restricts subclasses for method argument HOT 4
- Issue with variable name as `extension` HOT 1
- Problem with run script on Xcode 15 HOT 6
- Not able to initialise Mock Object HOT 1
- More descriptive failure messages HOT 1
- 2.0 issues HOT 3
- Unsupported attribute 'objc' HOT 4
- Protocol with primary associated type cannot be mocked HOT 4
- How to stub a objc method with a `error:(NSError **)errPtr` parameter? HOT 1
- Output definitions in Cuckoofile.toml are ignored/in conflict using CuckooPluginFile. HOT 5
- Couldn't get Cuckoo 2.0.3 to work HOT 13
- Glibc error when using Cuckoo 2.0.3: Cannot find 'Glibc' in scope HOT 11
- Generator v2: Generic Restrictions on Method missing HOT 3
- Exclude is not really excluded in cuckoofile.toml HOT 6
- PropertyObservers affecting mocked property generation. HOT 4
- accessing build database database is locked Possibly there are two concurrent builds running in the same filesystem location. HOT 2
- EXC_BAD_ACCESS on Xcode 16 Beta HOT 1
- Multiple targets conflict cmark-gfm HOT 2
- Allow swift-syntax up to v510.0.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuckoo.