Skip to content

Commit a0580c4

Browse files
committed
docs: Add Debug Doc for CLI
1 parent d339144 commit a0580c4

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ Please read [CONTRIBUTING](CONTRIBUTING.md) for details on the process for contr
5353

5454
Be mindful of our [Code of Conduct](CODE_OF_CONDUCT.md).
5555

56+
### Application Template
57+
5658
To debug the app from within the template, run the following commands:
57-
1. First, go to the Flutter app directory.
59+
1. Go to the Flutter app directory.
5860
```ps
5961
cd src/app
6062
```
@@ -64,9 +66,38 @@ To debug the app from within the template, run the following commands:
6466
```
6567
1. Run the code generators.
6668
```ps
67-
dart run build_runner build
69+
dart run build_runner build --delete-conflicting-outputs
6870
```
6971
1. Build and run the application.
7072
```ps
7173
flutter run
7274
```
75+
76+
### Command Line Interface
77+
78+
To debug the CLI, do the following:
79+
80+
1. Go to the CLI directory.
81+
```ps
82+
cd src/cli
83+
```
84+
1. Restore the packages.
85+
```ps
86+
flutter pub get
87+
```
88+
1. Run the code generators.
89+
```ps
90+
dart run build_runner build --delete-conflicting-outputs
91+
```
92+
1. Set the variables value in `src/cli/lib/src/commands/create_command.dart` that would normally be done by the Pipeline
93+
- `_commitHash`
94+
- `_shortCommitHash`
95+
- `_versionNumber`
96+
- `_commitDate`
97+
> 💡 You have to set real values, you should probably use the latest commit information or your own commit from your branch.
98+
> 💡 If you click [here](https://github.com/nventive/FlutterApplicationTemplate/commit/d3391444b8e2503e7c7bf27c12b6283062aa0a1c), you have the commit hash in the URL, and the short one is displayed at the top right of the page `commit d339144`.
99+
> 💡 The date can be any string of any format, it's just displayed, e.g. `2025-02-06`.
100+
> 💡 The version number should be {Major.Minor.Patch}, e.g. `2.4.1`.
101+
1. Move the `README.md` into `src/cli` folder
102+
1. `dart pub global activate --source=path {Full Path}/src/cli`
103+
> 💡 If you already have the CLI installed, you can use the `--overwrite` flag, but don't forget to reinstall it properly when you are done using `dart pub global activate flutter_application_generator --overwrite`.

src/cli/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

66
Prefix your items with `(Template)` if the change is about the template and not the resulting application.
77

8+
## 0.24.3
9+
- Update CLI documentation.
10+
811
## 0.24.2
912
- General improvements, including sample documentation (see `src/cli/example/README.md`).
1013
- Update versions of CI/CD tasks.

0 commit comments

Comments
 (0)