Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/error building on flutter 2.24.3 #8

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@
"flutter": "stable",
"flavors": {
"development": "stable",
"production": "3.22.3"
"production": "stable"
}
}
105 changes: 6 additions & 99 deletions .github/workflows/checkout.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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",
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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..."
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter_in_store_app_version_checker">
package="com.flutter.instoreappversionchecker">
</manifest>
Original file line number Diff line number Diff line change
@@ -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)
}

4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter_in_store_app_version_checker.example">
package="com.flutter.instoreappversionchecker.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter_in_store_app_version_checker.example">
package="com.flutter.instoreappversionchecker.example">
<application
android:label="flutter_in_store_app_version_checker"
android:label="Flutter in store app version checker"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package flutter_in_store_app_version_checker.example
package com.flutter.instoreappversionchecker.example

import io.flutter.embedding.android.FlutterActivity

2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="flutter_in_store_app_version_checker.example">
package="com.flutter.instoreappversionchecker.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
4 changes: 2 additions & 2 deletions example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_in_store_app_version_checker</string>
<string>Example</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_in_store_app_version_checker</string>
<string>Example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.8.0"
version: "1.9.0"
flutter_lints:
dependency: "direct dev"
description:
50 changes: 33 additions & 17 deletions example_gradle_8/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading