osl-incubator / makim

Make Improved
https://osl-incubator.github.io/makim/
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Change from dependencies to hooks #75

Open xmnlab opened 8 months ago

xmnlab commented 8 months ago

Currently we use the attribute dependencies to define dependencies among targets.

Although it works fine, but it is just a pre-run (setup) hook, and we would need to add support for post-run (teardown) hook as well.

Example:


version: 1.0
env-file: .env
groups:
  main:
    targets:
      target1:
        help: target1
        run: echo "target 1"
      target2:
        help: target2
        run: echo "target 2"

  build:
    targets:
      clean:
        help: target clean
        hooks:
          pre-run: 
            - target: main.target1
          post-run:
            - target: main.target2
        run: echo "target clean"