Skip to content

Commit

Permalink
refactor: Rename target to task (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Apr 6, 2024
1 parent d132946 commit ec51eae
Show file tree
Hide file tree
Showing 28 changed files with 435 additions and 435 deletions.
116 changes: 58 additions & 58 deletions .makim.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 1.0
groups:
clean:
targets:
tasks:
tmp:
help: Clean unnecessary temporary files
shell: bash
Expand All @@ -20,7 +20,7 @@ groups:
rm -fr .pytest_cache
docs:
targets:
tasks:
build:
help: Build documentation
run: |
Expand All @@ -46,7 +46,7 @@ groups:
-p "semantic-release-replace-plugin" \
semantic-release
targets:
tasks:
ci:
help: Run semantic release on CI
run: ${{ vars.app }} --ci
Expand All @@ -59,7 +59,7 @@ groups:
poetry publish --dry-run
tests:
targets:
tasks:
linter:
help: Run linter tools
run: pre-commit run --all-files
Expand All @@ -71,27 +71,27 @@ groups:
smoke:
help: Run smoke tests
dependencies:
- target: smoke-tests.simple
- target: smoke-tests.complex
- target: smoke-tests.containers
- target: smoke-tests.unittest
- target: smoke-tests.vars-env
- target: smoke-tests.test-vars
- target: smoke-tests.bash
- target: smoke-tests.working-directory-absolute-path
- target: smoke-tests.working-directory-no-path
- target: smoke-tests.working-directory-relative-path
- task: smoke-tests.simple
- task: smoke-tests.complex
- task: smoke-tests.containers
- task: smoke-tests.unittest
- task: smoke-tests.vars-env
- task: smoke-tests.test-vars
- task: smoke-tests.bash
- task: smoke-tests.working-directory-absolute-path
- task: smoke-tests.working-directory-no-path
- task: smoke-tests.working-directory-relative-path

ci:
help: Run all targets used on CI
help: Run all tasks used on CI
dependencies:
- target: tests.linter
- target: tests.unittest
- target: tests.smoke
- target: docs.build
- task: tests.linter
- task: tests.unittest
- task: tests.smoke
- task: docs.build

smoke-tests:
targets:
tasks:
simple:
help: Test makim using a simple makimfile
args:
Expand Down Expand Up @@ -172,7 +172,7 @@ groups:
shell-app:
help: |
Test makim with working-directory for global no-path and its various
combinations with group and target working-directory
combinations with group and task working-directory
args:
verbose-mode:
help: Run the all the tests in verbose mode
Expand Down Expand Up @@ -227,11 +227,11 @@ groups:
makim $VERBOSE_FLAG --file $MAKIM_FILE global-scope.test-var-env
makim $VERBOSE_FLAG --file $MAKIM_FILE group-scope.test-var-env-file
makim $VERBOSE_FLAG --file $MAKIM_FILE group-scope.test-var-env
makim $VERBOSE_FLAG --file $MAKIM_FILE target-scope.test-var-env-file
makim $VERBOSE_FLAG --file $MAKIM_FILE target-scope.test-var-env
makim $VERBOSE_FLAG --file $MAKIM_FILE task-scope.test-var-env-file
makim $VERBOSE_FLAG --file $MAKIM_FILE task-scope.test-var-env
makim $VERBOSE_FLAG --file $MAKIM_FILE rerender-env.from-global
makim $VERBOSE_FLAG --file $MAKIM_FILE rerender-env.from-group
makim $VERBOSE_FLAG --file $MAKIM_FILE rerender-env.from-target
makim $VERBOSE_FLAG --file $MAKIM_FILE rerender-env.from-task
test-vars:
help: Test makim using a vars makim file
Expand All @@ -245,7 +245,7 @@ groups:
shell: bash
run: |
export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}'
makim $VERBOSE_FLAG --file $MAKIM_FILE vars-group.vars-target
makim $VERBOSE_FLAG --file $MAKIM_FILE vars-group.vars-task
bash:
help: Test makim shell attribute with bash
Expand All @@ -259,12 +259,12 @@ groups:
export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}'
makim $VERBOSE_FLAG --file tests/smoke/.makim-bash-main-scope.yaml main-scope.test
makim $VERBOSE_FLAG --file tests/smoke/.makim-bash-group-scope.yaml group-scope.test
makim $VERBOSE_FLAG --file tests/smoke/.makim-bash-target-scope.yaml target-scope.test
makim $VERBOSE_FLAG --file tests/smoke/.makim-bash-task-scope.yaml task-scope.test
working-directory-absolute-path:
help: |
Test makim with working-directory absolute for global path and its various
combinations with group and target working-directory
combinations with group and task working-directory
args:
verbose-mode:
help: Run the all the tests in verbose mode
Expand All @@ -277,20 +277,20 @@ groups:
export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}'
makim $VERBOSE_FLAG --file $MAKIM_FILE --help
makim $VERBOSE_FLAG --file $MAKIM_FILE --version
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-relative
working-directory-no-path:
help: |
Test makim with working-directory for global no-path and its
various combinations with group and target working-directory
various combinations with group and task working-directory
args:
verbose-mode:
help: Run the all the tests in verbose mode
Expand All @@ -305,20 +305,20 @@ groups:
cd /tmp
makim $VERBOSE_FLAG --file $MAKIM_FILE --help
makim $VERBOSE_FLAG --file $MAKIM_FILE --version
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-relative
working-directory-relative-path:
help: |
Test makim with working-directory for global no-path and its various
combinations with group and target working-directory
combinations with group and task working-directory
args:
verbose-mode:
help: Run the all the tests in verbose mode
Expand All @@ -334,19 +334,19 @@ groups:
cd /tmp
makim $VERBOSE_FLAG --file $MAKIM_FILE --help
makim $VERBOSE_FLAG --file $MAKIM_FILE --version
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.target-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-no-path.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-absolute.task-relative
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-no-path
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-absolute
makim $VERBOSE_FLAG --file $MAKIM_FILE group-relative.task-relative
error:
help: This group helps tests failure targets
targets:
help: This group helps tests failure tasks
tasks:
python-assert:
help: Raise an system error
shell: python
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Get Started

`MakIm` or just `makim` is based on `make` and focus on improve the way to
define targets and dependencies. Instead of using the `Makefile` format, it uses
`yaml` format.
`Makim` (or `makim`) is based on `make` and focus on improve the way to define
tasks and dependencies. Instead of using the `Makefile` format, it uses `yaml`
format.

The idea of this project is to offer a way to define targets and dependencies
with some control options, like conditionals `if`.
The idea of this project is to offer a way to define tasks and dependencies with
some control options, like conditionals `if`.

It allows a very easy way to define texts for documentation and extra parameters
for each target.
for each task.

- License: BSD 3 Clause
- Documentation: https://osl-incubator.github.io/makim

## Features

- Help text as first-class in the `.makim.yaml` specification. It can be used by
targets and arguments.
- Targets have an option for arguments.
- Targets have an option for dependencies.
- Dependencies can call a target with specific arguments.
tasks and arguments.
- Tasks have an option for arguments.
- Tasks have an option for dependencies.
- Dependencies can call a task with specific arguments.
- Dependencies can have a conditional control flow (`if`).
- Allow the creation of groups, so the targets can be organized by topics.
- Targets and groups have an option for user defined variables and/or
environment variables.
- Allow the creation of groups, so the tasks can be organized by topics.
- Tasks and groups have an option for user defined variables and/or environment
variables.
- Access arguments, variables or environment variables via template (using
Jinja2).
- Option for using dot environment files using `env-file` key.
Expand All @@ -38,9 +38,9 @@ version: 1.0.0
groups:
default:
env-file: .env
targets:
tasks:
clean:
help: Use this target to clean up temporary files
help: Use this task to clean up temporary files
args:
all:
type: bool
Expand All @@ -56,7 +56,7 @@ groups:
action: store_true
help: if not set, the clean dependency will not be triggered.
dependencies:
- target: clean
- task: clean
if: {% raw %}${{ args.clean == true }}{% endraw %}
run: |
echo "build file x"
Expand All @@ -66,27 +66,27 @@ groups:
Some examples of how to use it:
- run the `build` target: `makim build`
- run the `build` task: `makim build`

- run the `clean` target: `makim clean`
- run the `clean` task: `makim clean`

- run the `build` target with the `clean` flag: `makim build --clean`
- run the `build` task with the `clean` flag: `makim build --clean`

The help menu for the `.makim.yaml` file would looks like this:

```
$ makim --help
usage: MakIm [--help] [--version] [--config-file MAKIM_FILE] [target]
usage: MakIm [--help] [--version] [--config-file MAKIM_FILE] [task]
MakIm is a tool that helps you to organize and simplify your helper commands.
positional arguments:
target
Specify the target command to be performed. Options are:
task
Specify the task command to be performed. Options are:
default:
--------
default.clean => Use this target to clean up temporary files
default.clean => Use this task to clean up temporary files
ARGS:
--all: (bool) Remove all files that are tracked by git
default.build => Build the program
Expand Down
10 changes: 5 additions & 5 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

### Features

* Add working-directory to the target, group and global scope ([#65](https://github.com/osl-incubator/makim/issues/65)) ([3fbd61e](https://github.com/osl-incubator/makim/commit/3fbd61efdefe22e29a53c8f0d46b6ef91bc55073))
* Add working-directory to the task, group and global scope ([#65](https://github.com/osl-incubator/makim/issues/65)) ([3fbd61e](https://github.com/osl-incubator/makim/commit/3fbd61efdefe22e29a53c8f0d46b6ef91bc55073))

## [1.8.3](https://github.com/osl-incubator/makim/compare/1.8.2...1.8.3) (2023-08-15)

Expand Down Expand Up @@ -102,7 +102,7 @@

### Features

* by default, for Xonsh shell, stop the target process if any command line fails ([#19](https://github.com/osl-incubator/makim/issues/19)) ([8fa4c1d](https://github.com/osl-incubator/makim/commit/8fa4c1ddb19af2ef215509feff2dd4055ca47561))
* by default, for Xonsh shell, stop the task process if any command line fails ([#19](https://github.com/osl-incubator/makim/issues/19)) ([8fa4c1d](https://github.com/osl-incubator/makim/commit/8fa4c1ddb19af2ef215509feff2dd4055ca47561))

## [1.7.1](https://github.com/osl-incubator/makim/compare/1.7.0...1.7.1) (2023-05-19)

Expand All @@ -116,14 +116,14 @@

### Features

* Increase coverage of the env and env-file options for global, group and target scope ([#39](https://github.com/osl-incubator/makim/issues/39)) ([2481221](https://github.com/osl-incubator/makim/commit/24812213cc91a25e9da1ae0afaebdef36bac896b))
* Increase coverage of the env and env-file options for global, group and task scope ([#39](https://github.com/osl-incubator/makim/issues/39)) ([2481221](https://github.com/osl-incubator/makim/commit/24812213cc91a25e9da1ae0afaebdef36bac896b))

## [1.6.7](https://github.com/osl-incubator/makim/compare/1.6.6...1.6.7) (2023-04-22)


### Bug Fixes

* Break bash target when any line fails ([#37](https://github.com/osl-incubator/makim/issues/37)) ([9dab0f4](https://github.com/osl-incubator/makim/commit/9dab0f497bb8f99051e924d8e0decf160f00972c))
* Break bash task when any line fails ([#37](https://github.com/osl-incubator/makim/issues/37)) ([9dab0f4](https://github.com/osl-incubator/makim/commit/9dab0f497bb8f99051e924d8e0decf160f00972c))

## [1.6.6](https://github.com/osl-incubator/makim/compare/1.6.5...1.6.6) (2023-04-07)

Expand Down Expand Up @@ -214,7 +214,7 @@

### Features

* Add support for variables for the target group ([#9](https://github.com/osl-incubator/makim/issues/9)) ([e3aa389](https://github.com/osl-incubator/makim/commit/e3aa389a07b7f5677328420f1389e84ed71bc7b3))
* Add support for variables for the task group ([#9](https://github.com/osl-incubator/makim/issues/9)) ([e3aa389](https://github.com/osl-incubator/makim/commit/e3aa389a07b7f5677328420f1389e84ed71bc7b3))

## [1.0.2](https://github.com/osl-incubator/makim/compare/1.0.1...1.0.2) (2023-01-26)

Expand Down
Loading

0 comments on commit ec51eae

Please sign in to comment.