Giter VIP home page Giter VIP logo

Comments (4)

tanner0101 avatar tanner0101 commented on August 19, 2024

I think relying on the actual build flags to pass into the toolbox could be a little over coupled.

If we had something like this, we wouldn't need to worry about toolbox flags at all.

{
    "dependencies": {
        "all": {
            "flags": ["-c", "release"]
        },
        "macOS": {
            "brew": ["mysql"],
            "link": ["/usr/local/lib"],
            "include": ["/usr/local/include/mysql"],
            "flags": ["-Xswiftc", "-DNOJSON"]
        },
        "linux": {
            "apt": ["mysql-server", "libmysqlclient-dev"]
        }
    }
}

We could also have the toolbox automatically install the deps through brew or apt.

Also having at least "name" in there would be useful for creating a provider index later on.

{
    "name": "MySQL Provider",
    "dependencies": { ... }
}

from toolbox.

loganwright avatar loganwright commented on August 19, 2024

@tannernelson I thought about that, but there's 2 things that make me against specifying type of flag.

  1. Less expandable. What if I want custom config flags, or any other thing that a project might want that doesn't fall into these categories. This limits their ability to do customizable fun stuff that doesn't fit into one of these boxes.
  2. More work. While there's some slight character savings, I don't think it's worth it. We can have a simple array and pass it in direct w/o any extra effort/testing/support. This requires more testing, more updates, and more explanation to users over "insert flags here and be done with it".

from toolbox.

tanner0101 avatar tanner0101 commented on August 19, 2024

Okay here's what the MySQL Provider vapor.json will look like:

{
    "name": "MySQL Provider",
    "flags": {
        "run": {
            "all": [
                "--config:mysql.version=foo"
            ]
        },
        "build": {
            "macOS": [
                "-Xswiftc",
                "-I/usr/local/include/mysql",
                "-Xlinker",
                "-L/usr/local/lib"
            ],
            "linux": [
                "-Xswiftc",
                "-DNOJSON"
            ]
        },
        "test": {
            "macOS": [
                "-Xswiftc",
                "-I/usr/local/include/mysql",
                "-Xlinker",
                "-L/usr/local/lib"
            ],
            "linux": [
                "-Xswiftc",
                "-DNOJSON"
            ]
        }
    }
}

from toolbox.

HazAT avatar HazAT commented on August 19, 2024

I've just wanted to clear that up since this cost me a few hours.
For me macOS wasn't the right key, it is just mac then all the parameters work as described.
#181

from toolbox.

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.