Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Build CLI Tool Generic with configuration file #2080

Open
AmmarAbouZor opened this issue Aug 30, 2024 · 0 comments
Open

Make Build CLI Tool Generic with configuration file #2080

AmmarAbouZor opened this issue Aug 30, 2024 · 0 comments
Assignees
Labels
new newly created issue

Comments

@AmmarAbouZor
Copy link
Member

It would be useful to separate the build steps from the runner in the Build CLI tool, which would provide benefits like:

  • Separating the configuration will make this tool generic which can use with different projects than Chipmunk.
  • Avoid having to have a new version of the build tool each time a change in Chipmunk build system happens.
  • It'll reduce the complexity in the codebase of the CLI tool since the complexity of the build system will be moved a configuration file and the codebase of the tool has to take care parsing those configurations then running the tasks in efficient way providing all the other useful options.

Configuration model

  • We need to set a configuration model which represents targets and variety of jobs with all their dependencies and custom steps
  • This configuration must have a version which will be validated by the tool at the start of parsing.
  • It would be useful to define the model in Rust, then using Serde we can even support verity of formats

Here is a prototype of the configuration model in Json format:

{
  "targets": [
    {
      "name" : "core",
      "path" : "$ROOT/application/apps/indexer"
      "build_deps" : [ "cli", "plugins"]
      "test_deps" : ["cli"],
      "lint_deps" : [],
      "before_build" : [
        {
          "job_type": "copy",
          "source" : "source_path",
          "dist" : "dist_path",
        }
      ],
      "build_cmd_dev" : "cargo build",
      "build_cmd_prod" : "cargo build -r",
      "after_build" : []
    },
    {
      "name" : "app",
      "path" : "$ROOT/application/holder"
      "build_deps" : [ "core", "binding"]
      "test_deps" : ["binding"],
      "lint_deps" : ["binding"],
      "before_build" : [
        {
          "job_type": "copy",
          "source" : "source_path",
          "dist" : "dist_path",
        }
      ],
      "build_cmd_dev" : "yarn build",
      "build_cmd_prod" : "yarn build --production",
      "after_build" : [
        {
          "job_type": "delete",
          "path" : "delete_path",
        }
      ]
    },
  ]
}
@AmmarAbouZor AmmarAbouZor self-assigned this Aug 30, 2024
@github-actions github-actions bot added the new newly created issue label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new newly created issue
Projects
None yet
Development

No branches or pull requests

2 participants