Skip to content

Feature/upgrade flutter sdk 3.29.0 #27

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
126 changes: 33 additions & 93 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,72 +1,51 @@
def dartEnvironmentVariables = []
if (project.hasProperty('dart-defines')) {
dartEnvironmentVariables = project.property('dart-defines')
.split(',')
.collectEntries { entry ->
def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
[(pair.first()): pair.last()]
}
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new 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'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
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"
id "com.google.gms.google-services"
id "com.google.firebase.crashlytics"
}

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

android {
compileSdkVersion 34
namespace = "jp.flutter.app"
compileSdk = 35
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "jp.flutter.app"
minSdkVersion 26
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "jp.flutter.app"
minSdk = 26
targetSdk = 35
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled true
}

signingConfigs {
signingConfigs {
release {
if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
storeFile file(System.getenv()["CM_KEYSTORE_PATH"])
storePassword System.getenv()["CM_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["CM_KEY_ALIAS"]
keyPassword System.getenv()["CM_KEYSTORE_PASSWORD"]
} else {
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
keyAlias localProperties.getProperty('keystore.keyAlias')
keyPassword localProperties.getProperty('keystore.keyPassword')
storeFile localProperties.getProperty('keystore.storeFile') ? file(localProperties.getProperty('keystore.storeFile')) : null
Expand All @@ -85,10 +64,6 @@ android {
}
}

lintOptions {
checkReleaseBuilds false
}

flavorDimensions("flavor-type")
productFlavors {
develop {
Expand All @@ -98,10 +73,6 @@ android {
applicationId "jp.flutter.app.dev"
manifestPlaceholders["host"] = "dev.chatwork.com"
manifestPlaceholders["applicationName"] = "Develop"
// manifestPlaceholders["apiKey"] = dartEnvironmentVariables.API_KEY
// manifestPlaceholders["apiSecret"] = dartEnvironmentVariables.API_SECRET
// buildConfigField "String", "API_KEY", "\"${dartEnvironmentVariables.API_KEY}\""
// buildConfigField "String", "API_SECRET", "\"${dartEnvironmentVariables.API_SECRET}\""
}

qa {
Expand All @@ -111,10 +82,6 @@ android {
applicationId "jp.flutter.app.qa"
manifestPlaceholders["host"] = "dev.chatwork.com"
manifestPlaceholders["applicationName"] = "Qa"
// manifestPlaceholders["apiKey"] = dartEnvironmentVariables.API_KEY
// manifestPlaceholders["apiSecret"] = dartEnvironmentVariables.API_SECRET
// buildConfigField "String", "API_KEY", "\"${dartEnvironmentVariables.API_KEY}\""
// buildConfigField "String", "API_SECRET", "\"${dartEnvironmentVariables.API_SECRET}\""
}

staging {
Expand All @@ -124,18 +91,6 @@ android {
applicationId "jp.flutter.app.stg"
manifestPlaceholders["host"] = "stg.facebook.com"
manifestPlaceholders["applicationName"] = "Staging"
// manifestPlaceholders["apiKey"] = dartEnvironmentVariables.API_KEY
// manifestPlaceholders["apiSecret"] = dartEnvironmentVariables.API_SECRET
// buildConfigField(
// type = "String",
// name = "API_KEY",
// value = dartEnvironmentVariables.API_KEY
// )
// buildConfigField(
// type = "String",
// name = "API_SECRET",
// value = dartEnvironmentVariables.API_SECRET
// )
}

production {
Expand All @@ -145,29 +100,14 @@ android {
applicationId "jp.flutter.app"
manifestPlaceholders["host"] = "chatwork.com"
manifestPlaceholders["applicationName"] = "Production"
// manifestPlaceholders["apiKey"] = dartEnvironmentVariables.API_KEY
// manifestPlaceholders["apiSecret"] = dartEnvironmentVariables.API_SECRET
// buildConfigField(
// type = "String",
// name = "API_KEY",
// value = dartEnvironmentVariables.API_KEY
// )
// buildConfigField(
// type = "String",
// name = "API_SECRET",
// value = dartEnvironmentVariables.API_SECRET
// )
}
}
}

flutter {
source '../..'
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
flutter {
source = "../.."
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
30 changes: 13 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
subprojects {
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
3 changes: 2 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
kotlin.jvm.target.validation.mode=IGNORE
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
32 changes: 24 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
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
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$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.0"
id "com.android.application" version "8.1.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
}

include ":app"
Binary file modified default.isar
Binary file not shown.
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target 'Runner' do
pod 'FirebaseFirestore',
:git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git',
# IOS_SDK_VERSION with the version of the Firebase iOS SDK specified in firebase_core's firebase_sdk_version.rb (https://github.com/firebase/flutterfire/blob/master/packages/firebase_core/firebase_core/ios/firebase_sdk_version.rb#L3)
:tag => '11.4.0'
:tag => '11.8.0'

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion lib/model/api/api_refresh_token_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part 'api_refresh_token_data.freezed.dart';
part 'api_refresh_token_data.g.dart';

@freezed
class ApiRefreshTokenData with _$ApiRefreshTokenData {
sealed class ApiRefreshTokenData with _$ApiRefreshTokenData {
const factory ApiRefreshTokenData({
@JsonKey(name: 'access_token') String? accessToken,
}) = _ApiRefreshTokenData;
Expand Down
2 changes: 1 addition & 1 deletion lib/model/api/api_user_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ part 'api_user_data.freezed.dart';
part 'api_user_data.g.dart';

@freezed
class ApiUserData with _$ApiUserData {
sealed class ApiUserData with _$ApiUserData {
const ApiUserData._();

const factory ApiUserData({
Expand Down
8 changes: 4 additions & 4 deletions lib/model/api/base/data_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ part 'data_response.freezed.dart';
part 'data_response.g.dart';

@Freezed(genericArgumentFactories: true)
class DataResponse<T> with _$DataResponse<T> {
sealed class DataResponse<T> with _$DataResponse<T> {
const factory DataResponse({
@JsonKey(name: 'data') T? data,
@JsonKey(name: 'meta') Meta? meta,
Expand All @@ -16,7 +16,7 @@ class DataResponse<T> with _$DataResponse<T> {
}

@Freezed(genericArgumentFactories: true)
class DataListResponse<T> with _$DataListResponse<T> {
sealed class DataListResponse<T> with _$DataListResponse<T> {
const factory DataListResponse({
@JsonKey(name: 'data') List<T>? data,
@JsonKey(name: 'meta') Meta? meta,
Expand All @@ -27,7 +27,7 @@ class DataListResponse<T> with _$DataListResponse<T> {
}

@freezed
class Meta with _$Meta {
sealed class Meta with _$Meta {
factory Meta({
@JsonKey(name: 'page_info') PageInfo? pageInfo,
}) = _Meta;
Expand All @@ -36,7 +36,7 @@ class Meta with _$Meta {
}

@freezed
class PageInfo with _$PageInfo {
sealed class PageInfo with _$PageInfo {
factory PageInfo({
@JsonKey(name: 'next') int? next,
}) = _PageInfo;
Expand Down
2 changes: 1 addition & 1 deletion lib/model/api/base/records_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part 'records_response.freezed.dart';
part 'records_response.g.dart';

@Freezed(genericArgumentFactories: true)
class RecordsListResponse<T> with _$RecordsListResponse<T> {
sealed class RecordsListResponse<T> with _$RecordsListResponse<T> {
const factory RecordsListResponse({
@JsonKey(name: 'records') List<T>? records,
@JsonKey(name: 'page') int? page,
Expand Down
2 changes: 1 addition & 1 deletion lib/model/api/base/results_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ part 'results_response.freezed.dart';
part 'results_response.g.dart';

@Freezed(genericArgumentFactories: true)
class ResultsListResponse<T> with _$ResultsListResponse<T> {
sealed class ResultsListResponse<T> with _$ResultsListResponse<T> {
const factory ResultsListResponse({
@JsonKey(name: 'results') List<T>? results,
@JsonKey(name: 'page') int? page,
Expand Down
4 changes: 2 additions & 2 deletions lib/model/api/mock/mock_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ part 'mock_data.g.dart';
/// This file is used to generate mock data for testing.
@freezed
@visibleForTesting
class MockData with _$MockData {
sealed class MockData with _$MockData {
const MockData._();

const factory MockData({
Expand All @@ -18,7 +18,7 @@ class MockData with _$MockData {
}

@freezed
class MockData2 with _$MockData2 {
sealed class MockData2 with _$MockData2 {
const MockData2._();

const factory MockData2({
Expand Down
2 changes: 1 addition & 1 deletion lib/model/api/server_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '../../index.dart';
part 'server_error.freezed.dart';

@freezed
class ServerError with _$ServerError {
sealed class ServerError with _$ServerError {
const ServerError._();
const factory ServerError({
/// server-defined status code
Expand Down
Loading