Skip to content

Commit a134ed1

Browse files
authored
Merge pull request #84 from Onix-Systems/dev
Update 28
2 parents 47e65ec + a08e0b8 commit a134ed1

File tree

265 files changed

+9904
-13997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+9904
-13997
lines changed

.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.19.6"
3+
}

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: ''
5-
labels: ''
5+
labels: 'enhancement'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/question.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Question about Onix Project Generator
3+
about: I have a question about Onix Project Generator
4+
title: 'Question about Onix Project Generator'
5+
labels: 'question'
6+
assignees: ''
7+
8+
---
9+
10+
**What is your question?.**
11+
A clear and concise description of what the question related to [...]
12+
13+
**Additional context**
14+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ migrate_working_dir/
3232
.pub/
3333
/build/
3434

35-
3635
# Symbolication related
3736
app.*.symbols
3837

@@ -47,4 +46,7 @@ app.*.map.json
4746
# generator config
4847
.gen_config.json
4948
/release/
50-
/.fvm/
49+
/.fvm/
50+
51+
# FVM Version Cache
52+
.fvm/

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
build:
3+
@flutter clean
4+
@flutter build macos --release
5+
@mkdir release
6+
@appdmg installers/dmg_creator/config.json release/Onix_Flutter_Project_Generator.dmg

README.md

Lines changed: 84 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,101 @@
1-
<p align="center">
2-
<a><img src="https://i.ibb.co/crD6N4B/icon.png" alt="icon" border="0" width="300" height="300"/></a>
3-
</p>
1+
<div align="center">
2+
<a href="https://onix-systems.com/">
3+
<img alt="refine logo" src="images/banner_top.jpg">
4+
</a>
45

5-
# Onix Flutter Project Generator
6+
<br/>
7+
<br/>
68

7-
Flutter Project Generator is a tool for creating a new project with built-in Clean Architecture and boilerplate components for a quick start.
9+
<div align="center">
10+
<a href="https://onix-systems.com/">About Us</a> |
11+
<a href="docs/INSTALL_INSTRUCTION.md">Installation</a> |
12+
<a href="docs/HOW_TO.md">How To</a> |
13+
<a href="docs/CONTRIBUTE.md">Contribute</a> |
14+
<a href="https://github.com/Onix-Systems/onix-flutter-project-generator/issues">Report an issue</a>
15+
</div>
16+
</div>
817

9-
Checkout the video instruction for more details and to quick start:
18+
<br/>
19+
<br/>
1020

11-
[![Onix Project Generator](https://i.imgur.com/kHsmEvr.png)](https://www.youtube.com/watch?v=lgey4r3osJI)
21+
<div align="center"><strong>Create your new Flutter project just in a few clicks.</strong><br>Flutter project generator is as an open source utility for MacOS designed to provide a quick start with your Flutter application development.<br />
22+
<br/>
23+
</div>
24+
<div align="center">
25+
<a href="https://onix-systems.com/">
26+
<img alt="refine logo" src="images/banner_main.png">
27+
</a>
28+
</div>
29+
<br/>
30+
<br/>
1231

13-
## Main features:
32+
## What is Project Generator?
1433

15-
* Creating a new project based on Clean Architecture with predefined frameworks and libraries, a name, BundleId, and other options;
16-
* Ability to configure, enable or disable components;
17-
* Ability to add screen stubs with a generated BLoC for the screen;
18-
* Ability to configure the data layer using Swagger URLs;
19-
* Ability to edit some settings of a previously created project
34+
**Flutter Project Generator** is a utility for **MacOS** designed to quickly start a Flutter project from scratch.
2035

21-
## Generated project tech stack
36+
**Flutter Project Generator** creates an empty project on **Clean Architecture** with already defined file structure and dependencies.
2237

23-
* Clean Architecture
24-
* BLoC
25-
* Dio/GraphQL
26-
* GetIt
27-
* Freezed
28-
* ScreenUtil
29-
* Navigation 2.0 (GoRouter/AutoRoute)
30-
* Flavorizer
31-
* Intl
32-
* ThemeTailor (Optional)
38+
You have an opportunity to modify the project creation settings and options, including **name and ID, navigation component, flavors, theming, pre-built screens, data components and more**.
3339

40+
## ⚡ Try Project Generator
3441

35-
## Release
42+
Let's start with installing the application.
3643

37-
Check out the [Releases](https://github.com/Onix-Systems/onix-flutter-project-generator/releases) section to download latest version;
44+
Go to [installing section](docs/INSTALL_INSTRUCTION.md) to download and install the latest version of the application.
3845

39-
## Bug reporting
46+
Once the app has installed go to the [How To](docs/HOW_TO.md) sections to get detailed instructions about creating a new project.
4047

41-
Found a bug?
42-
Please [report it](https://github.com/Onix-Systems/onix-flutter-project-generator/issues).
48+
## Use cases
4349

4450

51+
Onix Project Generator shines on **creating Flutter projects on Clean Architecture with a techstack of commonly used and most popular Flutter libraries and packages**.
4552

46-
[![Made in Ukraine](https://img.shields.io/badge/made_in-Ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)
53+
Generated project tech consist of such libraries and packages:
4754

48-
<p align="center">
49-
<a href="https://ibb.co/Jq7C042"><img src="https://i.ibb.co/C67WNZv/logo-white.png" alt="logo-white" border="0"></a>
50-
</p>
55+
56+
* **State Management** - [BLoC](https://pub.dev/packages/flutter_bloc).
57+
* **Networking** - [Dio](https://pub.dev/packages/dio).
58+
* **Service Locator** - [GetIt](https://pub.dev/packages/get_it)
59+
* **UI** - [ScreenUtil](https://pub.dev/packages/flutter_screenutil)
60+
* **Code generator** - [Freezed](https://pub.dev/packages/freezed)
61+
* **Navigation** - [GoRouter](https://pub.dev/packages/go_router) or [AutoRoute](https://pub.dev/packages/auto_route)
62+
63+
Also there an option to select **optional packages to include** to the project:
64+
65+
* **Networking** - [GraphQL](https://pub.dev/packages/graphql)
66+
* **Services** - [Firebase](https://firebase.flutter.dev/)
67+
* **Flavors** - [Flavorizr](https://pub.dev/packages/flutter_flavorizr)
68+
* **Localization** - [Intl](https://pub.dev/packages/intl_utils)
69+
* **Theming** - [ThemeTailor](https://pub.dev/packages/theme_tailor)
70+
71+
72+
## Key Features
73+
74+
The key features of the Onix Project Generator are:
75+
76+
* **MacOS application** designed to **run on Intel on M** machines.
77+
* To **create a new project based on Clean Architecture** with chosen name, ID and options.
78+
* To **select a platforms** project will be built for.
79+
* To **add an application flavors** with [Flavorizr](https://pub.dev/packages/flutter_flavorizr).
80+
* **Choose your favorite Navigator** to use in the project ([GoRouter](https://pub.dev/packages/go_router) or [AutoRoute](https://pub.dev/packages/auto_route)
81+
).
82+
* To **configure optional components** to include to the project.
83+
* To **add screen mocks** with screen BLoC, navigation and GetIt declarations included.
84+
* To **configure data layer** from Swagger URL.
85+
* To **configure the application theme** from Figma file.
86+
* To **create Android signing** configuration automatically or manually.
87+
* To **add Sonar configurations and scripts**.
88+
* Generates **starter documentation** for the project.
89+
* Generates **Fastlane configurations** and make files to run Fastlane commands.
90+
* Automatically check for updates.
91+
92+
93+
## Contribution
94+
95+
[Refer to the contribution docs for more information](docs/CONTRIBUTE.md).
96+
97+
If you have any doubts related to the project or want to discuss something, then post a question on [GitHub](https://github.com/Onix-Systems/onix-flutter-project-generator/issues/new?assignees=&labels=question&projects=&template=question.md&title=Question%20about%20Onix%20Project%20Generator).
98+
99+
## License
100+
101+
Licensed under the MIT License, Copyright (c) 2023-present Onix-Systems

assets/documentation/docs/INSTALL_INSTRUCTION.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,24 @@ To fix that run following command in IDE terminal:
180180

181181
`cd ios && pod cache clean --all && pod repo update && pod update && cd .. && flutter clean && flutter pub get`
182182

183-
183+
## Automatic posting of release notes to slack after build through fastlane
184184

185+
In order for fastlane to send release notes to slack channel you need:
185186

187+
1. Install the `git cliff` generator [following this link](https://git-cliff.org/docs/)
188+
2. Make sure that the `cliff_txt.toml` and `cliff_md.toml` files are created in the project root and configured correctly
189+
3. Make sure the git repository is initialized in the project, you have at least one commit and a git tag with the release version is set on the last commit
190+
4. Go to the ios or android fastlane directory, then and add/update the key `SLACK_URL` with a incoming webhook URL to each `.env_{flavor_name)` file
191+
5. Optionally. In `fastlane_config.yaml` you can specify additional settings for slack
186192

193+
Now you can build and deploy builds through fastlane with message notification and release notes to the slack channel
187194

195+
## Manual creation of release notes and changelogs
196+
197+
You can also generate release notes and changelog without using fastlane. To do this you need to:
198+
199+
1. Install the `git cliff` generator [following this link](https://git-cliff.org/docs/)
200+
2. Make sure that the `cliff_txt.toml` and `cliff_md.toml` files are created in the project root and configured correctly
201+
3. Make sure the git repository is initialized in the project, you have at least one commit and a git tag with the release version is set on the last commit
202+
4. To generate release notes, call the `make release_notes` command in the terminal
203+
5. To generate a CHANGELOG, call the `make changelog` command in the terminal

assets/fastlane/android/Fastfile

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,25 @@ default_platform(:android)
99
platform :android do
1010
desc "Build android app"
1111
lane :build do |options|
12-
flavor = options[:flavor]
13-
firebase = options[:firebase]
14-
store = options[:store]
15-
artifact_type = options[:artifact_type]
16-
17-
load_fastlane_vars(flavor)
18-
path = get_artifact_path(artifact_type, flavor)
19-
#gradle(task: "clean assembleRelease")
20-
upload_to_play_store_if_possible(store, path, artifact_type)
21-
upload_to_firebase_if_possible(firebase, path, artifact_type)
12+
begin
13+
flavor = options[:flavor]
14+
firebase = options[:firebase]
15+
store = options[:store]
16+
artifact_type = options[:artifact_type]
17+
load_fastlane_vars(flavor)
18+
19+
if(artifact_type != 'apk' && artifact_type != 'aab')
20+
UI.user_error!("You must specify artifact type when calling the fastlane build method. Valid value apk or aab")
21+
end
22+
23+
path = get_artifact_path(artifact_type, flavor)
24+
upload_to_play_store_if_possible(store, path, artifact_type)
25+
upload_to_firebase_if_possible(firebase, path, artifact_type)
26+
sendToSlack(true, '')
27+
rescue => e
28+
sendToSlack(false, e.message)
29+
raise e
30+
end
2231
end
2332

2433
def load_fastlane_vars(flavor)
@@ -29,11 +38,8 @@ platform :android do
2938
def get_artifact_path(artifact_type, flavor)
3039
if artifact_type == "apk"
3140
return "../build/app/outputs/flutter-apk/#{flavor.nil? ? 'app-release.apk' : "app-#{flavor}-release.apk"}"
32-
elsif artifact_type == "aab"
33-
return "../build/app/outputs/bundle/#{flavor.nil? ? 'release/app-release.aab' : "#{flavor}Release/app-#{flavor}-release.aab"}"
3441
else
35-
UI.user_error!("You must specify artifact type when calling the fastlane build method. Valid value apk or aab")
36-
return
42+
return "../build/app/outputs/bundle/#{flavor.nil? ? 'release/app-release.aab' : "#{flavor}Release/app-#{flavor}-release.aab"}"
3743
end
3844
end
3945

@@ -122,4 +128,32 @@ platform :android do
122128
UI.important "firebase_app_distribution was skipped because android artifact type is aab, and distribution is specified only for apk"
123129
end
124130
end
131+
132+
def sendToSlack(isSuccess, error)
133+
status = isSuccess
134+
message = error
135+
slack_settings = $yaml_vars['slack']
136+
137+
if slack_settings == nil || ENV['SLACK_URL'] == nil
138+
return
139+
end
140+
141+
if !isSuccess && slack_settings['send_when_error'] != true
142+
return
143+
end
144+
145+
if isSuccess
146+
sh("cd ../.. && git cliff --latest -c cliff_txt.toml -o changelog_tmp.txt")
147+
message = File.read("../../changelog_tmp.txt")
148+
sh("cd ../.. && rm -f changelog_tmp.txt")
149+
end
150+
151+
slack(message: message,
152+
success: status,
153+
slack_url: ENV['SLACK_URL'],
154+
username: slack_settings['username'],
155+
pretext: slack_settings['pretext'],
156+
icon_url: slack_settings['icon_url'],
157+
)
158+
end
125159
end

assets/fastlane/ios/Fastfile

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ default_platform(:ios)
99
platform :ios do
1010
desc "Build iOS"
1111
lane :build do |options|
12-
flavor = options[:flavor]
13-
firebase = options[:firebase]
14-
test_flight = options[:test_flight]
15-
16-
load_fastlane_vars(flavor)
17-
create_archive
18-
upload_to_firebase_if_possible(firebase)
19-
upload_to_test_flight_if_possible(test_flight)
12+
begin
13+
flavor = options[:flavor]
14+
firebase = options[:firebase]
15+
test_flight = options[:test_flight]
16+
load_fastlane_vars(flavor)
17+
create_archive
18+
upload_to_firebase_if_possible(firebase)
19+
upload_to_test_flight_if_possible(test_flight)
20+
sendToSlack(true, '')
21+
rescue => e
22+
sendToSlack(false, e.message)
23+
raise e
24+
end
2025
end
2126

2227
def load_fastlane_vars(flavor)
@@ -153,4 +158,32 @@ platform :ios do
153158
groups: firebase_distribution['groups'],
154159
)
155160
end
156-
end
161+
162+
def sendToSlack(isSuccess, error)
163+
status = isSuccess
164+
message = error
165+
slack_settings = $yaml_vars['slack']
166+
167+
if slack_settings == nil || ENV['SLACK_URL'] == nil
168+
return
169+
end
170+
171+
if !isSuccess && slack_settings['send_when_error'] != true
172+
return
173+
end
174+
175+
if isSuccess
176+
sh("cd ../.. && git cliff --latest -c cliff_txt.toml -o changelog_tmp.txt")
177+
message = File.read("../../changelog_tmp.txt")
178+
sh("cd ../.. && rm -f changelog_tmp.txt")
179+
end
180+
181+
slack(message: message,
182+
success: status,
183+
slack_url: ENV['SLACK_URL'],
184+
username: slack_settings['username'],
185+
pretext: slack_settings['pretext'],
186+
icon_url: slack_settings['icon_url'],
187+
)
188+
end
189+
end

0 commit comments

Comments
 (0)