Skip to content
caumond edited this page Jan 6, 2025 · 1 revision

home

How to modify automaton-build itself

  1. Clone the repo with `git clone ssh:[email protected]:hephaistox/automaton-build.git`
  2. Do `bb lconnect` to start a repl on port `1234`
  3. Tests actions your own new or modified actions
  4. Optional: After some modifications, use `bb wf-4` to lint, format and test the code to check your code tests are passing
  5. Optional: Use a `bb test all` to test more deeply, with not only test/bb code, but also unit tests and so on..
  6. Commit and push your modification on branch `b`, it will retest the commit on a remote environment,
  7. Do `bb deploy -t v1.2.3 -m “tag message”` to push the modifications, this step won’t execute if
    1. you execute it before tests would have been finished early,
    2. the tests have failed

You’ll end-up with: a branch checked, tagged compiled together with its documentation on github.

Other features

You can also use:

  1. bb docs to manually rebuild an API modification, they’ll be visible on `https://hephaistox.github.io/automaton-build/`
  2. Update tags manually and push them to the repo, the clojars artefacts are automatically updated.
  3. `bb tasks` to see all available tasks.

How to build a project leveraging automaton-build

This section will be fine tuned with next projects.

To integrate `automaton-build` into your project:

  1. Create `bb.edn` file at the root of your project with the following content:
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "1.0.2"}} 
:tasks {-base-deps {:doc "Dependencies for a task using bb"}
        :requires [[automaton-build.tasks.common :as tasks-common]]}}

Which will:

  • Add the `automaton-build` library dependency to enable its features.
  • Add the `-base-deps` task to declare whatever is common to all tasks. It starts with `-` so it is not shown in the task list.
  • Add the `requires` that enables `tasks-common` namespace for all tasks so you don’t have to repeat it.
  1. Add your custom tasks or use pre-defined ones from the `automaton-build.tasks` directory.

Example task for starting REPL:

 repl {:depends [-base-deps]
       :requires [[automaton-build.tasks.2 :as tasks-2]]
       :extra-deps {}
       :doc "Launch repl"
       :enter (tasks-common/enter tasks-2/cli-opts (current-task))
       :task (tasks-2/start-repl [:common-test :env-development-repl :build])}

Tasks configuration

Some tasks may require additional configuration. Set up a `project.edn` file in your project root to customize task behavior. For an example refer to the forbidden-words report task [automaton-build.tasks.tasks.3](src/bb/automaton_build/tasks/3.clj) and [project.edn file](project.edn)