Skip to content

Concept of command #23

@raphaelvigee

Description

@raphaelvigee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions