Coder Social home page Coder Social logo

Comments (11)

soucolline avatar soucolline commented on September 28, 2024

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.

MatyasKriz avatar MatyasKriz commented on September 28, 2024

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.

soucolline avatar soucolline commented on September 28, 2024

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.

MatyasKriz avatar MatyasKriz commented on September 28, 2024

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.

soucolline avatar soucolline commented on September 28, 2024

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.

soucolline avatar soucolline commented on September 28, 2024

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.

MatyasKriz avatar MatyasKriz commented on September 28, 2024

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.

soucolline avatar soucolline commented on September 28, 2024

For sure that's an idea worth exploring, I'll try to play a bit with it on my side

from cuckoo.

soucolline avatar soucolline commented on September 28, 2024

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.

MatyasKriz avatar MatyasKriz commented on September 28, 2024

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.

nalounguyen avatar nalounguyen commented on September 28, 2024

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
Screenshot 2024-09-08 at 15 36 00

Then I also created .sh file and can run with cmd.

from cuckoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.