Skip to content

Commit

Permalink
Add development flavor (thunder-app#1214)
Browse files Browse the repository at this point in the history
* added flavor for development builds

* fixed build scripts

* updated dev flavor icon
  • Loading branch information
hjiangsu authored Mar 20, 2024
1 parent 3b4556c commit dd69a5e
Show file tree
Hide file tree
Showing 152 changed files with 794 additions and 307 deletions.
86 changes: 53 additions & 33 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,55 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "thunder",
"request": "launch",
"type": "dart"
},
{
"name": "thunder (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "thunder (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
},
{
"name": "thunder (web)",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"args": [
"-d",
"chrome"
]
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Thunder (Debug)",
"request": "launch",
"type": "dart",
"args": ["--flavor", "production"]
},
{
"name": "Thunder Development (Debug)",
"request": "launch",
"type": "dart",
"args": ["--flavor", "development"]
},
{
"name": "Thunder (Profile)",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": ["--flavor", "production"]
},
{
"name": "Thunder Development (Profile)",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"args": ["--flavor", "development"]
},
{
"name": "Thunder (Release)",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": ["--flavor", "production"]
},
{
"name": "Thunder Development (Release)",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"args": ["--flavor", "development"]
},
{
"name": "Thunder (web)",
"type": "dart",
"request": "launch",
"program": "lib/main.dart",
"args": ["-d", "chrome"]
}
]
}
14 changes: 14 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ android {
signingConfig signingConfigs.release
}
}

flavorDimensions "default"
productFlavors {
production {
dimension "default"
resValue "string", "app_name", "Thunder"
applicationIdSuffix ""
}
development {
dimension "default"
resValue "string", "app_name", "Thunder"
applicationIdSuffix ".dev"
}
}
}

flutter {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<!-- requestLegacyExternalStorage is required for saving media to an album in API 29 -->
<application
tools:replace="android:label"
android:label="Thunder"
android:label="@string/app_name"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"
android:icon="@mipmap/ic_launcher"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
>
Expand Down
6 changes: 0 additions & 6 deletions android/app/src/main/res/mipmap-anydpi-v26/launcher_icon.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_monochrome"/>
</adaptive-icon>
Binary file added assets/logo_android.png
Binary file added assets/logo_android_background.png
Binary file added assets/logo_android_development.png
Binary file added assets/logo_android_monochrome.png
Binary file added assets/logo_android_monochrome_development.png
Binary file removed assets/logo_background.png
Diff not rendered.
Binary file added assets/logo_development.png
Binary file added assets/logo_monochrome.png
26 changes: 26 additions & 0 deletions flutter_launcher_icons-development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dev_dependencies:
flutter_launcher_icons: "^0.13.0"

flutter_launcher_icons:
image_path_android: "assets/logo_android_development.png"
image_path_ios: "assets/logo_development.png"
android: true
ios: true
adaptive_icon_background: "assets/logo_android_background.png" # only available for Android 8.0 devices and above
adaptive_icon_foreground: "assets/logo_android_development.png" # only available for Android 8.0 devices and above
adaptive_icon_monochrome: "assets/logo_android_monochrome_development.png" # only available for Android 13 devices and above
min_sdk_android: 21 # android min sdk min:16, default 21
remove_alpha_ios: true
background_color_ios: "#212123"
web:
generate: true
image_path: "assets/logo_development.png"
background_color: "#212123"
theme_color: "#212123"
windows:
generate: true
image_path: "assets/logo_development.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "assets/logo_development.png"
26 changes: 26 additions & 0 deletions flutter_launcher_icons-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dev_dependencies:
flutter_launcher_icons: "^0.13.0"

flutter_launcher_icons:
image_path_android: "assets/logo_android.png"
image_path_ios: "assets/logo.png"
android: true
ios: true
adaptive_icon_background: "assets/logo_android_background.png" # only available for Android 8.0 devices and above
adaptive_icon_foreground: "assets/logo_android.png" # only available for Android 8.0 devices and above
adaptive_icon_monochrome: "assets/logo_android_monochrome.png" # only available for Android 13 devices and above
min_sdk_android: 21 # android min sdk min:16, default 21
remove_alpha_ios: true
background_color_ios: "#212123"
web:
generate: true
image_path: "assets/logo.png"
background_color: "#212123"
theme_color: "#212123"
windows:
generate: true
image_path: "assets/logo.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "assets/logo.png"
21 changes: 0 additions & 21 deletions flutter_launcher_icons.yaml

This file was deleted.

Loading

0 comments on commit dd69a5e

Please sign in to comment.