Skip to content

Commit

Permalink
Revert to Flutter 3.19.5
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticmouse committed Mar 29, 2024
1 parent 95bd5ab commit 447e2bc
Show file tree
Hide file tree
Showing 90 changed files with 400 additions and 310 deletions.
47 changes: 28 additions & 19 deletions generate_crossword/step_03/android/app/build.gradle
@@ -1,58 +1,67 @@
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")
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = "1"
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty("flutter.versionName")
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = "1.0"
flutterVersionName = '1.0'
}

android {
namespace = "com.example.generate_crossword"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
namespace "com.example.generate_crossword"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

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

kotlinOptions {
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.generate_crossword"
applicationId "com.example.generate_crossword"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
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
signingConfig signingConfigs.debug
}
}
}

flutter {
source = "../.."
source '../..'
}

dependencies {}
Expand Up @@ -7,7 +7,6 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -32,7 +31,7 @@
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
Expand Down
4 changes: 2 additions & 2 deletions generate_crossword/step_03/android/build.gradle
Expand Up @@ -5,12 +5,12 @@ allprojects {
}
}

rootProject.buildDir = "../build"
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_03/android/gradle.properties
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
5 changes: 3 additions & 2 deletions generate_crossword/step_03/android/settings.gradle
Expand Up @@ -5,9 +5,10 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_03/ios/Runner/AppDelegate.swift
@@ -1,5 +1,5 @@
import Flutter
import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand Down
@@ -1,5 +1,5 @@
import Cocoa
import FlutterMacOS
import Cocoa
import XCTest

class RunnerTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_03/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none'
version: 0.1.0

environment:
sdk: '>=3.4.0-190.1.beta <4.0.0'
sdk: '>=3.3.3 <4.0.0'

dependencies:
built_collection: ^5.1.1
Expand Down
4 changes: 2 additions & 2 deletions generate_crossword/step_03/windows/runner/utils.cpp
Expand Up @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
if (utf16_string == nullptr) {
return std::string();
}
unsigned int target_length = ::WideCharToMultiByte(
int target_length = ::WideCharToMultiByte(
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
-1, nullptr, 0, nullptr, nullptr)
-1; // remove the trailing null character
int input_length = (int)wcslen(utf16_string);
std::string utf8_string;
if (target_length == 0 || target_length > utf8_string.max_size()) {
if (target_length <= 0 || target_length > utf8_string.max_size()) {
return utf8_string;
}
utf8_string.resize(target_length);
Expand Down
47 changes: 28 additions & 19 deletions generate_crossword/step_04/android/app/build.gradle
@@ -1,58 +1,67 @@
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")
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = "1"
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty("flutter.versionName")
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = "1.0"
flutterVersionName = '1.0'
}

android {
namespace = "com.example.generate_crossword"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
namespace "com.example.generate_crossword"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

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

kotlinOptions {
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.generate_crossword"
applicationId "com.example.generate_crossword"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
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
signingConfig signingConfigs.debug
}
}
}

flutter {
source = "../.."
source '../..'
}

dependencies {}
Expand Up @@ -7,7 +7,6 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -32,7 +31,7 @@
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
Expand Down
4 changes: 2 additions & 2 deletions generate_crossword/step_04/android/build.gradle
Expand Up @@ -5,12 +5,12 @@ allprojects {
}
}

rootProject.buildDir = "../build"
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_04/android/gradle.properties
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
5 changes: 3 additions & 2 deletions generate_crossword/step_04/android/settings.gradle
Expand Up @@ -5,9 +5,10 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_04/ios/Runner/AppDelegate.swift
@@ -1,5 +1,5 @@
import Flutter
import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand Down
@@ -1,5 +1,5 @@
import Cocoa
import FlutterMacOS
import Cocoa
import XCTest

class RunnerTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion generate_crossword/step_04/pubspec.yaml
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none'
version: 0.1.0

environment:
sdk: '>=3.4.0-190.1.beta <4.0.0'
sdk: '>=3.3.3 <4.0.0'

dependencies:
built_collection: ^5.1.1
Expand Down
4 changes: 2 additions & 2 deletions generate_crossword/step_04/windows/runner/utils.cpp
Expand Up @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) {
if (utf16_string == nullptr) {
return std::string();
}
unsigned int target_length = ::WideCharToMultiByte(
int target_length = ::WideCharToMultiByte(
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
-1, nullptr, 0, nullptr, nullptr)
-1; // remove the trailing null character
int input_length = (int)wcslen(utf16_string);
std::string utf8_string;
if (target_length == 0 || target_length > utf8_string.max_size()) {
if (target_length <= 0 || target_length > utf8_string.max_size()) {
return utf8_string;
}
utf8_string.resize(target_length);
Expand Down

0 comments on commit 447e2bc

Please sign in to comment.