diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7d4691ff..176ced723 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,38 +24,46 @@ localisations and generating the parser is done separately from building each pr ## Generating parsers -Prerequisites: +*Either* start a docker container + +```shell +docker build --tag berp-env . +docker run --rm --interactive --tty --volume ".:/app" berp-env +``` + +*Or* install on your system * .NET 5.0 (to run `berp` to generate parsers) * `berp` (install with `dotnet tool update Berp --version 1.3.0 --tool-path /usr/bin` ) * `make` -* `jq` (>= 1.4 for `--sort-keys` option) * `diff` -* `git` -With all this installed use Make: +With either of these done run: -``` -make generate +```shell make clean-generate +make generate ``` ## Adding or updating an i18n language -Prerequisites: +1) Edit `gherkin-langauges.json`. -* `make` -* `jq` (>= 1.4 for `--sort-keys` option) -* `git` +2) Distribute the changes to the different parser implementations: -1) Edit `gherkin-langauges.json`. + *Either* start a docker container. See [Generating Parsers](#generating-parsers) -2) Distribute the changes to the different parser implementations, this requires `make`, `jq`, `diff`, but no compiler/interpreters: + *Or* install on your system -``` -make clean-gherkin-languages -make copy-gherkin-languages -``` + * `make` + * `jq` (>= 1.4 for `--sort-keys` option) + + Then with either of these done run + + ```shell + make clean-gherkin-languages + make copy-gherkin-languages + ``` 3) Make a pull request with the changed files. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..a223b3681 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Builds a docker image used for building most projects in this repo. It's +# used both by contributors and CI. +# +FROM mcr.microsoft.com/dotnet/sdk:6.0 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install --assume-yes \ + make \ + jq + + +WORKDIR /app + +## Trigger first run experience by running arbitrary cmd to populate local package cache +RUN dotnet --list-sdks + +# Install Berp (dotnet tool installs are user-global; not system global) +RUN dotnet tool install --global Berp --version 1.4.0 \ + && echo 'export PATH="$PATH:/root/.dotnet/tools"' >> ~/.bashrc + +WORKDIR /app + +CMD ["/bin/bash"]