Code Monkey home page Code Monkey logo

Comments (5)

Nycto avatar Nycto commented on June 8, 2024 1

Sounds good. It might take me a day or two, but I'll clean this up and submit a PR

from playdate-nim.

Nycto avatar Nycto commented on June 8, 2024

I should add: I'm definitely willing to contribute to make this happen, but I wanted to check if you’re interested first

from playdate-nim.

samdze avatar samdze commented on June 8, 2024

Yes! There are plans to publish it when the package is stable enough.

As you said however, a specific build configuration has to be used, and I'm not sure it is possible to conveniently "import" and use it as part of the module.

Let me know if you have more info or a solution to this.

Making this a module that you can install and then just works would be awesome!

from playdate-nim.

Nycto avatar Nycto commented on June 8, 2024

It can't be a total "install and go", but I think I've got it as hands off as possible:

https://github.com/Nycto/playdate-nim

After a nimble install, users need to define a bare bones config.nims:

https://github.com/Nycto/playdate-nim/blob/main/playdate_example/config.nims#L1

And add an include to the nimble file:

https://github.com/Nycto/playdate-nim/blob/main/playdate_example/playdate_example.nimble#L14

My implementation is still a prototype, but it's enough compile the code and run the simulator.

To get the build targets working in nimble, I moved the logic into an includable file:

https://github.com/Nycto/playdate-nim/blob/main/src/playdate/build.nim#L83-L96

You can also see the includable config.nim here:

https://github.com/Nycto/playdate-nim/blob/main/src/playdate/config.nim

It's also worth noting that I moved some of the environment variable definitions into the nimble tasks instead:

https://github.com/Nycto/playdate-nim/blob/main/src/playdate/build.nim#L72-L75

from playdate-nim.

samdze avatar samdze commented on June 8, 2024

Alright, I think you're on the right path, an include statement should be perfectly fine.
I was trying to see if there's a way to make Nimble execute a package install-time script but I didn't find anything as yet.

Also defining the project name, author and other variables dynamically in Nim is the way to go.

Feel free to make a PR when you think you're ready, I'll progressively make adjustments (if needed) and then publish the package!

from playdate-nim.

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.