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

Concept of command #23

Open
raphaelvigee opened this issue Apr 24, 2024 · 0 comments · May be fixed by #32
Open

Concept of command #23

raphaelvigee opened this issue Apr 24, 2024 · 0 comments · May be fixed by #32

Comments

@raphaelvigee
Copy link
Member

raphaelvigee commented Apr 24, 2024

In order to support a more natural use, we want to support the concept of "verb" + path, instead of target address
In order to provide a smooth interaction with the rest of the system, this will simply be some syntactic sugar on top of the existing address system.

Example:

# some/folder/BUILD
target(name="build")
target(name="run")
target(name="run-stage1")
target(name="run-stage0")
target(name="lint")
target(name="format")

# other/folder/BUILD
target(name="run")
target(name="build")
target(name="validate")

----------------

heph build some/folder                             => heph r //some/folder:build

heph run-stage0 some/folder                        => heph r //some/folder:run-stage0
cd some/folder && heph run-stage0

heph validate other/folder                         => heph r //other/folder:validate

In the example of formatting, one may want to format a specific file only: heph format some/folder/src/deep.ts
This should end up running //some/folder:format with the argument src/deep.ts, basically going up the tree the requested directory until a suitable target is found

If the path part is omitted, assume the current directory

Alternate approach:

# some/folder/BUILD
target(name="build")
target(name="run", cmd=True) # syntactic sugar to make it a command
target(name="run-stage1")
target(name="run-stage0")
target(name="lint")
target(name="format")

cmd(name="build", deps=":build")
cmd(name="build", deps=":build", match={"os": "$os", "arch": "$arch"})
cmd(name="lint", deps="//some/folder && lint")

cmd(name="run", deps=":run-stage1", match={"backend": "stage1"})
cmd(name="run", deps=":run-stage0", match={"backend": "stage0"})

----------------

heph build some/folder                             => heph r //some/folder:build
cd some/folder heph build

heph build --os=linux --arch=amd64

heph lint some/folder

heph run some/folder                                 => heph r //some/folder:run
heph run some/folder --backend=stage1 => heph r //some/folder:run-stage1
heph run some/folder --backend=stage0 => heph r //some/folder:run-stage0
@raphaelvigee raphaelvigee changed the title Verb Concept of verb Apr 24, 2024
@raphaelvigee raphaelvigee linked a pull request Apr 28, 2024 that will close this issue
@raphaelvigee raphaelvigee changed the title Concept of verb Concept of command Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant