Skip to content

Commit 12c0434

Browse files
committed
chore: Updated build.gradle from groovy to kotlin & ios update for flutter 3.22
1 parent 9eac95f commit 12c0434

30 files changed

+120
-120
lines changed

.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "300451adae589accbece3490f4396f10bdf15e6e"
7+
revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1"
88
channel: "stable"
99

1010
project_type: app
@@ -13,11 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
17-
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
18-
- platform: android
19-
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
20-
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
16+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
17+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
18+
- platform: ios
19+
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
20+
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
2121

2222
# User provided section
2323

.run/development_debug.run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Developement Debug" type="FlutterRunConfigurationType" factoryName="Flutter">
3+
<option name="filePath" value="$PROJECT_DIR$/lib/main_developement.dart" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

.run/development_release.run.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Developement Release" type="FlutterRunConfigurationType" factoryName="Flutter">
3+
<option name="additionalArgs" value="--release" />
4+
<option name="filePath" value="$PROJECT_DIR$/lib/main_developement.dart" />
5+
<method v="2" />
6+
</configuration>
7+
</component>

.run/production_debug.run.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.run/production_release.run.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.run/staging_debug.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<option name="filePath" value="$PROJECT_DIR$/lib/main_staging.dart" />
44
<method v="2" />
55
</configuration>
6-
</component>
6+
</component>

.run/staging_release.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
<option name="filePath" value="$PROJECT_DIR$/lib/main_staging.dart" />
55
<method v="2" />
66
</configuration>
7-
</component>
7+
</component>

.vscode/launch.json

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "Development",
9-
"request": "launch",
10-
"type": "dart",
11-
"program": "lib/main_development.dart",
12-
"args": [
13-
"--flavor",
14-
"development"
15-
]
16-
},
17-
{
18-
"name": "Staging",
19-
"request": "launch",
20-
"type": "dart",
21-
"program": "lib/main_staging.dart",
22-
"args": [
23-
"--flavor",
24-
"staging"
25-
]
26-
},
27-
{
28-
"name": "Production",
29-
"request": "launch",
30-
"type": "dart",
31-
"program": "lib/main_production.dart",
32-
"args": [
33-
"--flavor",
34-
"production"
35-
]
36-
},
37-
]
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Development",
9+
"request": "launch",
10+
"type": "dart",
11+
"program": "lib/main_development.dart",
12+
"args": ["--flavor", "development"]
13+
},
14+
{
15+
"name": "Staging",
16+
"request": "launch",
17+
"type": "dart",
18+
"program": "lib/main_staging.dart",
19+
"args": ["--flavor", "staging"]
20+
}
21+
22+
// Commented to avoid running the product app from VSCode
23+
// Uncomment only if we really need it
24+
// {
25+
// "name": "Production",
26+
// "request": "launch",
27+
// "type": "dart",
28+
// "program": "lib/main_production.dart",
29+
// "args": [
30+
// "--flavor",
31+
// "production"
32+
// ]
33+
// },
34+
]
3835
}

android/app/build.gradle

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,97 @@
11
plugins {
22
id "com.android.application"
33
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
45
id "dev.flutter.flutter-gradle-plugin"
56
}
67

78
def localProperties = new Properties()
8-
def localPropertiesFile = rootProject.file('local.properties')
9+
def localPropertiesFile = rootProject.file("local.properties")
910
if (localPropertiesFile.exists()) {
10-
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localPropertiesFile.withReader("UTF-8") { reader ->
1112
localProperties.load(reader)
1213
}
1314
}
1415

15-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
1617
if (flutterVersionCode == null) {
17-
flutterVersionCode = '1'
18+
flutterVersionCode = "1"
1819
}
1920

20-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
2122
if (flutterVersionName == null) {
22-
flutterVersionName = '1.0'
23+
flutterVersionName = "1.0"
2324
}
2425

26+
27+
// TODO: Change the appName, it will be used as app label
28+
def appName = "Flutter Template"
29+
30+
// TODO: Change the applicationId for production
31+
// On staging it will add .staging and on development it will add .development as suffix.
32+
def applicationId = "com.example.flutter_template"
33+
34+
2535
android {
26-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
27-
namespace "com.example.flutter_template"
28-
compileSdk flutter.compileSdkVersion
29-
ndkVersion flutter.ndkVersion
36+
namespace = "$applicationId"
37+
compileSdk = flutter.compileSdkVersion
38+
ndkVersion = flutter.ndkVersion
3039

3140
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
41+
sourceCompatibility = JavaVersion.VERSION_1_8
42+
targetCompatibility = JavaVersion.VERSION_1_8
3443
}
3544

3645
kotlinOptions {
37-
jvmTarget = '1.8'
38-
}
39-
40-
sourceSets {
41-
main.java.srcDirs += 'src/main/kotlin'
46+
jvmTarget = JavaVersion.VERSION_1_8
4247
}
4348

4449
defaultConfig {
45-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "com.example.flutter_template"
50+
applicationId = "$applicationId"
4751
// You can update the following values to match your application needs.
4852
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
49-
minSdkVersion flutter.minSdkVersion
50-
targetSdkVersion flutter.targetSdkVersion
51-
versionCode flutterVersionCode.toInteger()
52-
versionName flutterVersionName
53+
minSdk = flutter.minSdkVersion
54+
targetSdk = flutter.targetSdkVersion
55+
versionCode = flutterVersionCode.toInteger()
56+
versionName = flutterVersionName
5357
}
5458

5559
buildTypes {
5660
release {
5761
// TODO: Add your own signing config for the release build.
5862
// Signing with the debug keys for now, so `flutter run --release` works.
59-
signingConfig signingConfigs.debug
63+
signingConfig = signingConfigs.debug
6064
}
6165
}
62-
6366
//TODO: Change resValue application name
64-
flavorDimensions "flavor-type"
67+
flavorDimensions.add("flavor-type")
6568

6669
productFlavors {
67-
development {
68-
dimension "flavor-type"
69-
applicationIdSuffix ".development"
70-
versionNameSuffix "-development"
71-
resValue "string", "app_name", "Application Name Development"
72-
signingConfig signingConfigs.debug
70+
create("development") {
71+
dimension = "flavor-type"
72+
applicationIdSuffix = ".development"
73+
versionNameSuffix = "-development"
74+
manifestPlaceholders["appName"] = "[DEV] $appName"
75+
signingConfig = signingConfigs.getByName("debug")
7376
}
74-
staging {
75-
dimension "flavor-type"
76-
applicationIdSuffix ".staging"
77-
versionNameSuffix "-staging"
78-
resValue "string", "app_name", "Application Name Staging"
79-
signingConfig signingConfigs.debug
77+
create("staging") {
78+
dimension = "flavor-type"
79+
applicationIdSuffix = ".staging"
80+
versionNameSuffix = "-staging"
81+
manifestPlaceholders["appName"] = "[STG] $appName"
82+
signingConfig = signingConfigs.getByName("debug")
8083
}
81-
production {
82-
dimension "flavor-type"
83-
resValue "string", "app_name", "Application Name"
84-
// TODO: After adding your own signing config for the release build.
85-
// Change this to signingConfigs.release
86-
signingConfig signingConfigs.debug
84+
create("production") {
85+
dimension = "flavor-type"
86+
manifestPlaceholders["appName"] = "$appName"
87+
// TODO: After adding your own signing config for the release build,
88+
// Change this to
89+
// signingConfig = signingConfigs.getByName("release")
90+
signingConfig = signingConfigs.getByName("debug")
8791
}
88-
8992
}
9093
}
9194

9295
flutter {
93-
source '../..'
96+
source = "../.."
9497
}
95-
96-
dependencies {}

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="flutter_template"
3+
android:label="${appName}"
44
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity
77
android:name=".MainActivity"
88
android:exported="true"
99
android:launchMode="singleTop"
10+
android:taskAffinity=""
1011
android:theme="@style/LaunchTheme"
1112
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1213
android:hardwareAccelerated="true"
@@ -31,7 +32,7 @@
3132
android:value="2" />
3233
</application>
3334
<!-- Required to query activities that can process text, see:
34-
https://developer.android.com/training/package-visibility?hl=en and
35+
https://developer.android.com/training/package-visibility and
3536
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
3637
3738
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->

0 commit comments

Comments
 (0)