ghostdog

module
v0.0.0-...-2cfd4b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2020 License: MIT

README

👻 ghostdog 🐶

ghostdog is a language-and-tool-agnostic build tool to only build what's changed

Build Status codecov

Install ghostdog from source

  1. Install Go.
  2. Add $GOPATH/bin to $PATH via export PATH=$(go env GOPATH)/bin:$PATH.
  3. Clone the ghostdog repository via git clone https://github.com/dustinspecker/ghostdog.
  4. Navigate to the ghostdog local repository via cd ghostdog.
  5. Install ghostdog via go install ./....
  6. ghostdog can then be used via ghostdog.

Using ghostdog

ghostdog uses build.ghostdog files written with Starlark to understand how to build packages. An example build.ghostdog file looks like:

# `files` functions are used to group files to later be used by `rule` function
files(
  name = "makefile",
  paths = ["Makefile"]
)

files(
  name = "source_code",
  paths = ["pkg/main.go"]
)

files(
  name = "test_code",
  paths = ["pkg/main_test.go"]
)

# this rule is only ran when the makefile or source_code files change
# this rule runs `make build` and expects that command to output a file named main
rule(
  name = "build",
  sources = ["makefile", "source_code"],
  commands = ["make build"],
  outputs = ["main"]
)

# this rule is only ran when the makefile or test_code files change, or when
# the build rule's output changes
rule(
  name = "test",
  sources = ["makefile", "test_code", "build"],
  commands = ["make test"],
  outputs = []
)

More examples exist in the _examples directory.

To understand the functions available in build.ghostdog files check the references in docs/functions.

Once a build.ghostdog file is created then ghostdog is able to build a project and graph a project's dependencies. For more information on ghostdog's commands consult the docs/commands.

Directories

Path Synopsis
_examples
cmd
internal
dag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL