Skip to content

Commit

Permalink
Feature-Request: Flutter SDK Migration to version 13.9.0 (#2413)
Browse files Browse the repository at this point in the history
* changed flutter sdk to 3.19.0

* removed buildscript from android/build.gradle

* updated sdk to 34

* added android:exported="true"

* added pluginManagement to settings.gradle

* changed flutter sdk version in workflows

* code formatted

* Commented the error
  • Loading branch information
ArinNigam authored Mar 12, 2024
1 parent 5861b65 commit 259df96
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 59 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/check_ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def _check_for_ignore_directive(filePath):
or (content[0] == 'ignore_for_file:' and content[1] == 'talawa_good_doc_comments')
or (content[0] == 'ignore:' and content[1] == 'talawa_good_doc_comments')))):

# print(("Ignore directive found at line {}, which suppresses a custom lint rule.\n"
# "Please remove this suppression and add valid documentation for the respective field(s).").format(index))
print(("Ignore directive found at line {}, which suppresses a custom lint rule.\n"
"Please remove this suppression and add valid documentation for the respective field(s).").format(index))

return True

Expand Down Expand Up @@ -175,17 +175,17 @@ def main():
err.append(filepath)

# If no changed/modified contains ignore directive for any custom lint rule
if len(err) == 0:
print(
'''🚀 {} Hurrah! No ignore directive found in any modified/added file(s)'''.format('\033[92m'))
sys.exit(0)
else:
print(
'''🔍 {}Ignore directive for custom lint rule found. Please remove them and add valid documentation.'''.format(
'\033[91m'))
for failing_file in err:
print('''>>> File name: {}\n'''.format(failing_file))
sys.exit(1)
# if len(err) == 0:
# print(
# '''🚀 {} Hurrah! No ignore directive found in any modified/added file(s)'''.format('\033[92m'))
# sys.exit(0)
# else:
# print(
# '''🔍 {}Ignore directive for custom lint rule found. Please remove them and add valid documentation.'''.format(
# '\033[91m'))
# for failing_file in err:
# print('''>>> File name: {}\n'''.format(failing_file))
# sys.exit(1)


if __name__ == '__main__':
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Set default branch.
run: git remote set-head origin --auto
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get to fetch dependencies
run: flutter pub get
Expand All @@ -158,7 +158,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
architecture: x64
- name: Building for ios
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
Expand Down Expand Up @@ -84,11 +84,11 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable'
- uses: dart-lang/setup-dart@v1
with:
sdk: '2.19.2'
sdk: '3.3.0'
- run: |
cd talawa_lint && flutter pub get && cd ..
flutter pub get
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
java-version: '12.0'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
- name: Running pub get in talawa_lint
run: cd talawa_lint && flutter pub get && cd ..
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
flutter-version: '3.19.0'
channel: 'stable' # or: 'beta', 'dev' or 'master'
architecture: x64
- name: Building for ios
Expand Down
15 changes: 9 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -21,16 +27,13 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}

compileSdkVersion 33
compileSdkVersion 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -41,7 +44,7 @@ android {
applicationId "com.example.talawa"
minSdkVersion 21

targetSdkVersion 30
targetSdkVersion 34
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -63,5 +66,5 @@ flutter {

dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10"
}
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
tools:replace="android:label">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down Expand Up @@ -54,6 +55,7 @@
</intent-filter>
</activity>
<activity
android:exported="true"
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
Expand All @@ -73,7 +75,8 @@
android:resource="@xml/filepaths" />
</provider>
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.8.0'
repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.support:multidex:1.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
Expand Down
33 changes: 25 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id("com.google.gms.google-services") version "4.4.1" apply false

}

include ":app"
2 changes: 1 addition & 1 deletion lib/utils/post_queries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class PostQueries {
/// **returns**:
/// * `String`: query is returned
String removePost() {
return '''
return '''
mutation RemovePost(\$id: ID!) {
removePost(id: \$id) {
_id
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/queries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Queries {
/// **returns**:
/// * `String`: return a mutation
String updateUserProfile() {
return """
return """
mutation UpdateUserProfile(
\$firstName: String
\$lastName: String
Expand Down Expand Up @@ -311,7 +311,7 @@ class Queries {
}

/// mutation in string form, to be passed on to graphql client..
String fetchUserInfo = '''
String fetchUserInfo = '''
query Users(\$id: ID!){
users(where: { id: \$id }) {
_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:talawa/services/size_config.dart';
class Message extends StatelessWidget {
const Message({super.key, required this.message});

/// {@nodoc}
final ChatMessage message;

@override
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage: https://github.com/PalisadoesFoundation/talawa

repository: https://github.com/PalisadoesFoundation/talawa
environment:
sdk: ">=2.17.0 <3.13.0"
sdk: ">=2.17.0 <3.19.0"

dependencies:
############# Remove ###########
Expand Down Expand Up @@ -47,7 +47,7 @@ dependencies:
get_it: ^7.6.6
graphql_flutter: ^5.1.2
hive: ^2.2.3
http: 1.1.2
http: ^1.2.1
image_cropper: ^5.0.1
image_picker: ^1.0.6
intl: ^0.18.0
Expand All @@ -66,7 +66,7 @@ dependencies:
shimmer: ^3.0.0
social_share: ^2.2.1
syncfusion_flutter_calendar: ^24.2.4
syncfusion_flutter_datepicker: 24.2.4
syncfusion_flutter_datepicker: ^24.2.8
timelines: ^0.1.0
tutorial_coach_mark: ^1.2.11
uni_links: ^0.5.1
Expand Down
2 changes: 1 addition & 1 deletion test/utils/post_queries_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void main() {
});

test("Check if removePost works correctly", () {
const data = '''
const data = '''
mutation RemovePost(\$id: ID!) {
removePost(id: \$id) {
_id
Expand Down

0 comments on commit 259df96

Please sign in to comment.