diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..0fdcb48 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.27.1" +} \ No newline at end of file diff --git a/.github/workflows/build_apk.yml b/.github/workflows/build_apk.yml index 6caf335..88b6347 100644 --- a/.github/workflows/build_apk.yml +++ b/.github/workflows/build_apk.yml @@ -90,7 +90,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: "zulu" - java-version: "11" + java-version: "17" - name: Restore Android keystore .jsk and .properties files run: | @@ -100,8 +100,10 @@ jobs: - name: Restore google-services.json run: bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}" "android/app/google-services.json" - - name: Restore firebase_options.dart - run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" + - name: Setup Firebase + run: | + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_JSON }}" "firebase.json" - name: Restore constants.dart env: @@ -112,6 +114,7 @@ jobs: run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} - name: Download release notes + continue-on-error: true uses: actions/download-artifact@v3 with: name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }} @@ -121,7 +124,7 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: "3.13.9" + flutter-version: "3.27.1" - name: Prepare flutter project run: | diff --git a/.github/workflows/build_ipa.yml b/.github/workflows/build_ipa.yml index 88294ba..8a4db0a 100644 --- a/.github/workflows/build_ipa.yml +++ b/.github/workflows/build_ipa.yml @@ -45,7 +45,7 @@ env: jobs: build: name: Build .ipa - runs-on: macos-13 + runs-on: macos-latest timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -92,11 +92,11 @@ jobs: - name: Restore ExportOptions.plist run: bash .github/scripts/restore_from_base64.sh "${{ secrets.APP_STORE_EXPORT_OPTIONS }}" "ios/Runner/ExportOptions.plist" - - name: Restore firebase_app_id_file.json - run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json" - - - name: Restore firebase_options.dart - run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" + - name: Setup Firebase + run: | + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json" + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_JSON }}" "firebase.json" - name: Restore constants.dart env: @@ -107,6 +107,7 @@ jobs: run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} - name: Download release notes + continue-on-error: true uses: actions/download-artifact@v3 with: name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }} @@ -116,13 +117,14 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: "3.13.9" + flutter-version: "3.27.1" - name: Prepare flutter project run: | flutter --version flutter pub get flutter pub run intl_utils:generate + dart pub global activate flutterfire_cli - name: Build .ipa run: | diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 1aac0a8..2682f66 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -42,7 +42,7 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: "3.13.9" + flutter-version: "3.27.1" - name: Prepare flutter project run: | diff --git a/.github/workflows/run_integration_tests.yml b/.github/workflows/run_integration_tests.yml index b49c3f8..adbe5ab 100644 --- a/.github/workflows/run_integration_tests.yml +++ b/.github/workflows/run_integration_tests.yml @@ -27,11 +27,12 @@ jobs: bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart" bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_IOS }}" "ios/Runner/GoogleService-Info.plist" bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json" + bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_JSON }}" "firebase.json" - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: "3.13.9" + flutter-version: "3.27.1" - name: Prepare app run: | @@ -39,6 +40,7 @@ jobs: flutter pub get flutter pub run intl_utils:generate flutter analyze lib --fatal-infos + dart pub global activate flutterfire_cli - name: Launch iOS simulator uses: futureware-tech/simulator-action@v3 diff --git a/.gitignore b/.gitignore index f8353b3..87d12d9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related @@ -48,7 +50,6 @@ app.*.map.json /ios/build/ /ios/Runner.xcodeproj/project.pbxproj -pubspec.lock /ios/Podfile.lock .fvm/ @@ -63,4 +64,6 @@ ios/Runner/GoogleService-Info.plist coverage/ test/coverage_helper_test.dart **/failures/*.png -screenshots/generated/raw/ \ No newline at end of file +screenshots/generated/raw/ + +firebase.json \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index e929cb4..44c5348 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,25 +1,25 @@ { - "task.slowProviderWarning": true, - "dart.flutterSdkPath": "fvm", - "search.exclude": { - "**/.fvm": true - }, - "files.watcherExclude": { - "**/.fvm": true - }, - "dart.lineLength": 120, - "[dart]": { - "editor.rulers": [ - 120, - ], - "editor.selectionHighlight": true, - "editor.suggest.snippetsPreventQuickSuggestions": false, - "editor.suggestSelection": "first", - "editor.tabCompletion": "onlySnippets", - "editor.wordBasedSuggestions": "off" - }, - "dart.doNotFormat": [ - "**/generated/**", - "lib/data/**" + "task.slowProviderWarning": true, + "dart.flutterSdkPath": ".fvm/flutter_sdk", + "search.exclude": { + "**/.fvm": true + }, + "files.watcherExclude": { + "**/.fvm": true + }, + "dart.lineLength": 120, + "[dart]": { + "editor.rulers": [ + 120 ], + "editor.selectionHighlight": true, + "editor.suggest.snippetsPreventQuickSuggestions": false, + "editor.suggestSelection": "first", + "editor.tabCompletion": "onlySnippets", + "editor.wordBasedSuggestions": "off" + }, + "dart.doNotFormat": [ + "**/generated/**", + "lib/data/**" + ] } \ No newline at end of file diff --git a/README.md b/README.md index 3114a99..c91d08b 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Without further delay behold my new Lightmeter app inspired by Material You (a.k ### 1. Install Flutter -To build this app you need to install Flutter 3.13.9 stable. [How to install](https://docs.flutter.dev/get-started/install). +To build this app you need to install Flutter 3.27.1 stable. [How to install](https://docs.flutter.dev/get-started/install). ### 2. Project setup diff --git a/android/app/build.gradle b/android/app/build.gradle index 2a422e5..bd932a8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,11 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' + id "dev.flutter.flutter-gradle-plugin" + id "com.google.gms.google-services" + id "com.google.firebase.crashlytics" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +14,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -27,15 +30,9 @@ if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) } -apply plugin: 'com.android.application' -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.google.firebase.crashlytics' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { compileSdkVersion 34 - ndkVersion flutter.ndkVersion + ndkVersion "27.0.12077973" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -43,7 +40,7 @@ android { } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8 } sourceSets { @@ -51,7 +48,7 @@ android { } defaultConfig { - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion 34 ndk { debugSymbolLevel 'FULL' @@ -101,6 +98,7 @@ android { } } } + namespace 'com.vodemn.lightmeter' } flutter { @@ -108,7 +106,6 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "com.android.billingclient:billing-ktx:6.0.0" implementation "com.google.firebase:firebase-analytics:17.4.1" } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index e2f45ff..399f698 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - +