From 4953784be4f982d1bf9df7f184cf9aca67a9bda0 Mon Sep 17 00:00:00 2001 From: Krille Date: Fri, 9 Jun 2023 09:49:41 +0200 Subject: [PATCH] docs: Add regenerate code instructions to readme --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c2710d87..51df5698 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,23 @@ void main() async { ## Generated code The files in `lib/src/generated` are generated by [dart_openapi_codegen](https://gitlab.com/famedly/company/frontend/dart_openapi_codegen/) -from [matrix-spec](https://github.com/matrix-org/matrix-spec/). See the README.md in dart_openapi_codegen for more information. +from [matrix-spec](https://github.com/matrix-org/matrix-spec/). + +To regenerate the code, follow these steps: + +1. Clone both repositories next to each other + 1.1 `git clone git@gitlab.com:famedly/company/frontend/dart_openapi_codegen.git` + 1.2 `git clone git@gitlab.com:famedly/company/frontend/libraries/matrix_api_lite.git` +2. Execute the script in the dart_openapi_codegen directory: +```sh +cd dart_openapi_codegen +./scripts/matrix.sh ../matrix_api_lite/lib/src/generated +cd .. +``` +3. Run the build_runner in the matrix_api_lite directory: +```sh +cd matrix_api_lite +dart pub get +dart run build_runner build +``` +4. Check lints and tests and create a merge request \ No newline at end of file