From 8e3e4a2bdc66d4df51539241985cbb24cb730c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Tue, 17 Sep 2024 13:28:39 +0400 Subject: [PATCH 1/5] chore(1.9.0): update `workflow` --- .github/workflows/checkout.yml | 105 ++------------------------------- 1 file changed, 6 insertions(+), 99 deletions(-) diff --git a/.github/workflows/checkout.yml b/.github/workflows/checkout.yml index 0fd92ac..74c542a 100644 --- a/.github/workflows/checkout.yml +++ b/.github/workflows/checkout.yml @@ -41,102 +41,9 @@ on: jobs: checkout: - name: "Checkout" - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./ - env: - pub-cache-name: pub - threshold: 50 - timeout-minutes: 15 - steps: - - name: ๐Ÿš‚ Get latest code - id: checkout - uses: actions/checkout@v4 - with: - sparse-checkout: | - .github - pubspec.yaml - lib - test - analysis_options.yaml - CHANGELOG.md - - - name: ๐Ÿ‘ท Install flutter - uses: subosito/flutter-action@v2 - id: install-flutter - with: - channel: 'stable' - # flutter-version: '3.22.3' - - - name: ๐Ÿ”Ž Check flutter version - id: check-flutter-version - run: flutter --version - - - name: ๐Ÿ“ค Restore Pub modules - id: cache-pub-restore - uses: actions/cache/restore@v4 - with: - path: | - $PWD/.pub_cache/ - key: ${{ runner.os }}-pub-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }} - - - name: ๐Ÿ—„๏ธ Export Pub cache directory - id: export-pub-cache - timeout-minutes: 1 - run: | - export PUB_CACHE=$PWD/.pub_cache/ - export PATH="$PATH":"$HOME/.pub-cache/bin" - echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH - - - name: ๐Ÿ‘ท Install Dependencies - id: install-dependencies - timeout-minutes: 2 - run: | - apt-get update && apt-get install -y lcov - flutter pub get --no-example - - - name: ๐Ÿ“ฅ Save Pub modules - id: cache-pub-save - uses: actions/cache/save@v4 - with: - path: | - $PWD/.pub_cache/ - key: ${{ runner.os }}-pub-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }} - - - name: ๐Ÿ”Ž Check format - id: check-format - timeout-minutes: 1 - run: dart format --set-exit-if-changed -l 80 -o none lib/ - - - name: ๐Ÿ“ˆ Check analyzer - id: check-analyzer - timeout-minutes: 1 - run: dart analyze --fatal-infos --fatal-warnings lib/ - - - name: ๐Ÿงช Run tests - id: run-tests - timeout-minutes: 2 - run: | - flutter test -r github -j 6 --coverage test/flutter_in_store_app_version_checker_test.dart - - # - name: ๐Ÿ” Check coverage - # id: check-coverage - # timeout-minutes: 2 - # run: | - # mv coverage/lcov.info coverage/lcov.base.info - # lcov --remove coverage/lcov.base.info '*.g.dart' -o coverage/lcov.info - # lcov --list coverage/lcov.info - # THRESHOLD=${{ env.threshold }} - # COVERAGE=$(lcov --summary coverage/lcov.info | grep -i 'lines\|Total:' | tail -n 1 | awk '{print $2}' | sed 's/%//') - # echo "Coverage is $COVERAGE%" - # echo $COVERAGE | awk '{if ($1 < 50) exit 1}' - - - name: ๐Ÿ“ฅ Upload coverage to Codecov - id: upload-coverage-to-codecov - timeout-minutes: 1 - uses: codecov/codecov-action@v3 - with: - files: ./coverage/lcov.info - # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + uses: ziqq/flutter_ci_workflows/.github/workflows/checkout.yml@main + testing: + needs: [checkout] + uses: ziqq/flutter_ci_workflows/.github/workflows/testing_with_codecov_report.yml@main + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 789a57bb6dd4c10b9a704f78842caa1ab2b588a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Tue, 17 Sep 2024 13:29:00 +0400 Subject: [PATCH 2/5] chore(1.9.0): update `configs` --- .fvmrc | 2 +- .vscode/launch.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.fvmrc b/.fvmrc index f09a0cd..66a49fb 100644 --- a/.fvmrc +++ b/.fvmrc @@ -2,6 +2,6 @@ "flutter": "stable", "flavors": { "development": "stable", - "production": "3.22.3" + "production": "stable" } } \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 9125865..dc706f8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -22,7 +22,7 @@ "env": {} }, { - "name": "Flutter Test (VM)", + "name": "Flutter Test", "request": "launch", "type": "dart", "program": "test/flutter_in_store_app_version_checker_test.dart", From e799bb5f44f44129cc836e70cc859e56f289844b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Tue, 17 Sep 2024 13:56:34 +0400 Subject: [PATCH 3/5] chore: update make --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Makefile b/Makefile index 3b7f6ae..c4385d6 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,12 @@ clean-cache: ## Clean the pub cache @fvm flutter pub cache repair @echo "โ•  PUB CACHE CLEANED SUCCESSFULLY" +.PHONY: clean +clean: ## Clean flutter + @echo "โ•  RUN FLUTTER CLEAN" + @fvm flutter clean + @echo "โ•  FLUTTER CLEANED SUCCESSFULLY" + .PHONY: get get: ## Get dependencies @echo "โ•  RUN GET DEPENDENCIES..." @@ -94,3 +100,16 @@ tag-remove: ## Make command to delete TAG. E.g: make tag-delete TAG=v1.0.0 @echo "DELETED TAG $(TAG) LOCALLY AND REMOTELY" @echo "" +.PHONY: build +build: clean analyze test-unit ## Build test apk for android on example apps + @echo "โ•  START BUILD EXAMPLES..." + @echo "โ•‘" + @echo "โ•  START BUILD ANDROID APK & IOS IPA FOR GRADLE < 8..." + @cd example && fvm flutter clean && fvm flutter pub get && fvm flutter build apk --release && fvm flutter build ios --release --no-codesign + @echo "โ•  FINISHED BUILD ANDROID APK FOR GRADLE < 8..." + @echo "โ•‘" + @echo "โ•  START BUILD ANDROID APK & IOS IPA FOR GRADLE > 8..." + @cd example_gradle_8 && fvm flutter clean && fvm flutter pub get && fvm flutter build apk --release && fvm flutter build ios --release --no-codesign + @echo "โ•  FINISH BUILD ANDROID APK FOR GRADLE > 8..." + @echo "โ•‘" + @echo "โ•  FINISH BUILD EXAMPLES..." From 0d2411f4c6053e57985e29e4658ce1372229b40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Tue, 17 Sep 2024 13:57:19 +0400 Subject: [PATCH 4/5] changed(1.9.0): Android package name --- CHANGELOG.md | 3 +- android/build.gradle | 4 +- android/src/main/AndroidManifest.xml | 2 +- .../InStoreAppVersionCheckerPlugin.kt | 4 +- example/android/app/build.gradle | 4 +- .../android/app/src/debug/AndroidManifest.xml | 2 +- .../android/app/src/main/AndroidManifest.xml | 4 +- .../example}/MainActivity.kt | 2 +- .../app/src/profile/AndroidManifest.xml | 2 +- example/ios/Flutter/AppFrameworkInfo.plist | 4 +- example/ios/Runner.xcodeproj/project.pbxproj | 6 +-- example/ios/Runner/Info.plist | 2 +- example/pubspec.lock | 2 +- example_gradle_8/android/app/build.gradle | 50 ++++++++++++------- .../android/app/src/main/AndroidManifest.xml | 9 ++-- .../example}/MainActivity.kt | 2 +- .../ios/Flutter/AppFrameworkInfo.plist | 4 +- .../ios/Runner.xcodeproj/project.pbxproj | 12 ++--- example_gradle_8/ios/Runner/Info.plist | 2 +- example_gradle_8/lib/main.dart | 4 +- .../macos/Runner.xcodeproj/project.pbxproj | 8 +-- .../macos/Runner/Configs/AppInfo.xcconfig | 4 +- example_gradle_8/pubspec.lock | 4 +- pubspec.lock | 22 ++++---- pubspec.yaml | 4 +- 25 files changed, 93 insertions(+), 73 deletions(-) rename android/src/main/kotlin/{flutter_in_store_app_version_checker => com/flutter/instoreappversionchecker}/InStoreAppVersionCheckerPlugin.kt (93%) rename example/android/app/src/main/kotlin/com/{example/flutter_in_store_app_version_checker_example => instoreappversionchecker/example}/MainActivity.kt (64%) rename example_gradle_8/android/app/src/main/kotlin/com/{example/example_gradle_8 => flutter/instoreappversionchecker/example}/MainActivity.kt (63%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59f23cf..ee61c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -## Unreleased +## 1.9.0 - **ADDED**: `stackTrace` to [InStoreAppVersionCheckerResult] - **CHANGED**: parametrs of [InStoreAppVersionCheckerResult] to named +- **CHANGED**: Android package name [#7](https://github.com/ziqq/flutter_in_store_app_version_checker/issues/7) ## 1.8.0 diff --git a/android/build.gradle b/android/build.gradle index 2a0da9c..3bf54c4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,4 @@ -group 'flutter_in_store_app_version_checker' +group 'com.flutter.instoreappversionchecker' version '1.0-SNAPSHOT' buildscript { @@ -25,7 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - namespace 'flutter_in_store_app_version_checker' + namespace 'com.flutter.instoreappversionchecker' compileSdkVersion 34 // flutter.compileSdkVersion compileOptions { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 8ae1364..f00090d 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ + package="com.flutter.instoreappversionchecker"> \ No newline at end of file diff --git a/android/src/main/kotlin/flutter_in_store_app_version_checker/InStoreAppVersionCheckerPlugin.kt b/android/src/main/kotlin/com/flutter/instoreappversionchecker/InStoreAppVersionCheckerPlugin.kt similarity index 93% rename from android/src/main/kotlin/flutter_in_store_app_version_checker/InStoreAppVersionCheckerPlugin.kt rename to android/src/main/kotlin/com/flutter/instoreappversionchecker/InStoreAppVersionCheckerPlugin.kt index 6412ca3..b8f138b 100644 --- a/android/src/main/kotlin/flutter_in_store_app_version_checker/InStoreAppVersionCheckerPlugin.kt +++ b/android/src/main/kotlin/com/flutter/instoreappversionchecker/InStoreAppVersionCheckerPlugin.kt @@ -1,4 +1,4 @@ -package flutter_in_store_app_version_checker +package com.flutter.instoreappversionchecker import androidx.annotation.NonNull @@ -17,7 +17,7 @@ class InStoreAppVersionCheckerPlugin: FlutterPlugin, MethodCallHandler { private lateinit var channel : MethodChannel override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter_in_store_app_version_checker") + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "com.flutter.instoreappversionchecker") channel.setMethodCallHandler(this) } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 8366728..abd5221 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -23,7 +23,7 @@ if (flutterVersionName == null) { } android { - namespace 'flutter_in_store_app_version_checker.example' + namespace 'com.flutter.instoreappversionchecker.example' compileSdkVersion 34 // flutter.compileSdkVersion compileOptions { @@ -40,7 +40,7 @@ android { } defaultConfig { - applicationId "flutter_in_store_app_version_checker.example" + applicationId "com.flutter.instoreappversionchecker.example" minSdkVersion flutter.minSdkVersion minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 0ddfc86..cf744ff 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.flutter.instoreappversionchecker.example"> diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 9a97b2b..82c6571 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + package="com.flutter.instoreappversionchecker.example"> + package="com.flutter.instoreappversionchecker.example"> diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 06476db..05fbc39 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -7,11 +7,11 @@ CFBundleExecutable App CFBundleIdentifier - io.flutter.flutter.app + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - flutter_in_store_app_version_checker + Example CFBundlePackageType FMWK CFBundleShortVersionString diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 743c20f..aeaacfe 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -365,7 +365,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.InStoreAppVersionCheckerExample; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -492,7 +492,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.InStoreAppVersionCheckerExample; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -514,7 +514,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.InStoreAppVersionCheckerExample; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index a37a249..b0226af 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - flutter_in_store_app_version_checker + Example CFBundlePackageType APPL CFBundleShortVersionString diff --git a/example/pubspec.lock b/example/pubspec.lock index f11885e..d1f8966 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -76,7 +76,7 @@ packages: path: ".." relative: true source: path - version: "1.8.0" + version: "1.9.0" flutter_lints: dependency: "direct dev" description: diff --git a/example_gradle_8/android/app/build.gradle b/example_gradle_8/android/app/build.gradle index 97878cc..961de25 100644 --- a/example_gradle_8/android/app/build.gradle +++ b/example_gradle_8/android/app/build.gradle @@ -1,39 +1,55 @@ plugins { id "com.android.application" id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" } +def localProperties = new Properties() +def localPropertiesFile = rootProject.file("local.properties") +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader("UTF-8") { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") +if (flutterVersionCode == null) { + flutterVersionCode = "1" +} + +def flutterVersionName = localProperties.getProperty("flutter.versionName") +if (flutterVersionName == null) { + flutterVersionName = "1.0" +} + android { - namespace = "com.example.example_gradle_8" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + namespace 'com.flutter.instoreappversionchecker.example' + compileSdkVersion 34 // flutter.compileSdkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.example_gradle_8" - // You can update the following values to match your application needs. - // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName + applicationId "com.flutter.instoreappversionchecker.example" + minSdkVersion flutter.minSdkVersion + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. signingConfig = signingConfigs.debug } } diff --git a/example_gradle_8/android/app/src/main/AndroidManifest.xml b/example_gradle_8/android/app/src/main/AndroidManifest.xml index b201d16..12e7a76 100644 --- a/example_gradle_8/android/app/src/main/AndroidManifest.xml +++ b/example_gradle_8/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,11 @@ - + + android:icon="@mipmap/ic_launcher" + > CFBundleExecutable App CFBundleIdentifier - io.flutter.flutter.app + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - App + Example CFBundlePackageType FMWK CFBundleShortVersionString diff --git a/example_gradle_8/ios/Runner.xcodeproj/project.pbxproj b/example_gradle_8/ios/Runner.xcodeproj/project.pbxproj index ea331b7..148446a 100644 --- a/example_gradle_8/ios/Runner.xcodeproj/project.pbxproj +++ b/example_gradle_8/ios/Runner.xcodeproj/project.pbxproj @@ -478,7 +478,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -495,7 +495,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -513,7 +513,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -529,7 +529,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -661,7 +661,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -684,7 +684,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/example_gradle_8/ios/Runner/Info.plist b/example_gradle_8/ios/Runner/Info.plist index d5a9b1f..f696090 100644 --- a/example_gradle_8/ios/Runner/Info.plist +++ b/example_gradle_8/ios/Runner/Info.plist @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - example_gradle_8 + Example CFBundlePackageType APPL CFBundleShortVersionString diff --git a/example_gradle_8/lib/main.dart b/example_gradle_8/lib/main.dart index a71d2a6..09e4144 100644 --- a/example_gradle_8/lib/main.dart +++ b/example_gradle_8/lib/main.dart @@ -54,7 +54,7 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) => MaterialApp( - title: 'In Store App Version Checker Example', + title: 'In Store App Version Checker Example Gradle 8', theme: ThemeData.dark(), home: const Example(), ); @@ -132,7 +132,7 @@ class _ExampleState extends State { forceMaterialTransparency: false, centerTitle: true, title: const Text( - 'In Store App Version Checker Example', + 'Example with gradle 8', style: TextStyle( fontSize: 17, fontWeight: FontWeight.w600, diff --git a/example_gradle_8/macos/Runner.xcodeproj/project.pbxproj b/example_gradle_8/macos/Runner.xcodeproj/project.pbxproj index 8f54083..4bd2426 100644 --- a/example_gradle_8/macos/Runner.xcodeproj/project.pbxproj +++ b/example_gradle_8/macos/Runner.xcodeproj/project.pbxproj @@ -145,7 +145,7 @@ 33CC10F72044A3C60003C045 /* Info.plist */, ); name = Resources; - path = ..; + path = com.flutter.instoreappversionchecker.example; sourceTree = ""; }; 33CEB47122A05771004F2AC0 /* Flutter */ = { @@ -385,7 +385,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_gradle_8.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example_gradle_8"; @@ -399,7 +399,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_gradle_8.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example_gradle_8"; @@ -413,7 +413,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_gradle_8.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example_gradle_8"; diff --git a/example_gradle_8/macos/Runner/Configs/AppInfo.xcconfig b/example_gradle_8/macos/Runner/Configs/AppInfo.xcconfig index 2f23c00..04fc8a2 100644 --- a/example_gradle_8/macos/Runner/Configs/AppInfo.xcconfig +++ b/example_gradle_8/macos/Runner/Configs/AppInfo.xcconfig @@ -8,7 +8,7 @@ PRODUCT_NAME = example_gradle_8 // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleGradle8 +PRODUCT_BUNDLE_IDENTIFIER = com.flutter.instoreappversionchecker.example // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright ยฉ 2024 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright ยฉ 2024 com.flutter.instoreappversionchecker.example All rights reserved. diff --git a/example_gradle_8/pubspec.lock b/example_gradle_8/pubspec.lock index 8dedd61..d32de7f 100644 --- a/example_gradle_8/pubspec.lock +++ b/example_gradle_8/pubspec.lock @@ -272,10 +272,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" web: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index 15101f8..42162ad 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -146,10 +146,10 @@ packages: dependency: "direct dev" description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" convert: dependency: transitive description: @@ -305,18 +305,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -473,7 +473,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -518,10 +518,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -534,10 +534,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5580c63..44c49e1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ name: flutter_in_store_app_version_checker description: > "A lightweight flutter plugin to check if your app is up-to-date on GooglePlay or AppStore. Made with โค๏ธ by ziqq." -version: 1.8.0 +version: 1.9.0 homepage: https://github.com/ziqq/flutter_in_store_app_version_checker @@ -61,7 +61,7 @@ flutter: plugin: platforms: android: - package: flutter_in_store_app_version_checker + package: com.flutter.instoreappversionchecker pluginClass: InStoreAppVersionCheckerPlugin ios: pluginClass: InStoreAppVersionCheckerPlugin From 1804c6154cea651f7b67b007e9af69c3f64b86ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Tue, 17 Sep 2024 14:05:25 +0400 Subject: [PATCH 5/5] fix(1.9.0): remove dead code --- pubspec.lock | 26 ++++----- pubspec.yaml | 4 -- tool/dart/rename_project.dart | 99 ----------------------------------- 3 files changed, 13 insertions(+), 116 deletions(-) delete mode 100644 tool/dart/rename_project.dart diff --git a/pubspec.lock b/pubspec.lock index 42162ad..3cc84ec 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -143,13 +143,13 @@ packages: source: hosted version: "4.10.0" collection: - dependency: "direct dev" + dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" convert: dependency: transitive description: @@ -305,18 +305,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -414,7 +414,7 @@ packages: source: hosted version: "3.0.1" path: - dependency: "direct dev" + dependency: transitive description: name: path sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" @@ -473,7 +473,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.0" + version: "0.0.99" source_gen: dependency: transitive description: @@ -518,10 +518,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.0" term_glyph: dependency: transitive description: @@ -534,10 +534,10 @@ packages: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.2" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 44c49e1..5c8029a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,10 +45,6 @@ dev_dependencies: flutter_test: sdk: flutter - # Utilities - collection: any - path: any - build_runner: ^2.4.12 # Testing diff --git a/tool/dart/rename_project.dart b/tool/dart/rename_project.dart deleted file mode 100644 index 1ae84c8..0000000 --- a/tool/dart/rename_project.dart +++ /dev/null @@ -1,99 +0,0 @@ -import 'dart:io' as io; - -import 'package:collection/collection.dart'; -import 'package:path/path.dart' as p; - -const String _defaultName = 'flutter_template_name'; -const String _defaultOrganization = 'dev.flutter.template'; -const String _defaultDescription = 'flutter_template_description'; - -/// dart run tool/dart/rename_project.dart --name="qqq" --organization="www" --description="eee" -void main([List? args]) { - if (args == null || args.isEmpty) _throwArguments(); - String? extractArg(String key) { - final value = args.firstWhereOrNull((e) => e.startsWith(key)); - if (value == null) return null; - return RegExp(r'[\d\w\.\-\_ ]+') - .allMatches(value.substring(key.length)) - .map((e) => e.group(0)) - .join() - .trim(); - } - - final name = extractArg('--name'); - final org = extractArg('--organization'); - final desc = extractArg('--description'); - if (name == null || org == null || desc == null) _throwArguments(); - _renameDirectory(_defaultName, name); - _changeContent([ - (from: _defaultName, to: name), - (from: _defaultOrganization, to: org), - (from: _defaultDescription, to: desc), - ]); -} - -Never _throwArguments() { - io.stderr.writeln('Pass arguments: ' - '--name="name" ' - '--organization="org.domain" ' - '--description="description"'); - io.exit(1); -} - -Iterable _recursiveDirectories( - io.Directory directory) sync* { - const excludeFiles = { - 'README.md', - 'rename_project.dart', - }; - const includeExtensions = { - '.dart', - '.yaml', - '.gradle', - '.xml', - '.kt', - '.plist', - '.txt', - '.cc', - '.cpp', - '.rc', - '.xcconfig', - '.pbxproj', - '.xcscheme', - '.html', - '.json', - }; - for (final e in directory.listSync(followLinks: false)) { - if (p.basename(e.path).startsWith('.')) continue; - if (e is io.File) { - if (!includeExtensions.contains(p.extension(e.path))) continue; - if (excludeFiles.contains(p.basename(e.path))) continue; - yield e; - } else if (e is io.Directory) { - yield e; - yield* _recursiveDirectories(e); - } - } -} - -void _renameDirectory(String from, String to) => - _recursiveDirectories(io.Directory.current) - .whereType() - .toList(growable: false) - .where((dir) => p.basename(dir.path) == from) - .forEach((dir) => dir.renameSync(p.join(p.dirname(dir.path), to))); - -void _changeContent(List<({String from, String to})> pairs) => - _recursiveDirectories(io.Directory.current) - .whereType() - .forEach((e) { - var content = e.readAsStringSync(); - var changed = false; - for (final pair in pairs) { - if (!content.contains(pair.from)) continue; - content = content.replaceAll(pair.from, pair.to); - changed = true; - } - if (!changed) return; - e.writeAsStringSync(content); - });