Skip to content

Commit

Permalink
chore: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-virkus committed Jul 13, 2024
1 parent 9fed4cd commit 8d61729
Show file tree
Hide file tree
Showing 12 changed files with 523 additions and 341 deletions.
200 changes: 141 additions & 59 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
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)
}
} else {
throw new GradleException("local.properties file not found")
}

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'
}

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

def keystorePropertiesFile = rootProject.file('key.properties')
def keystoreProperties = new Properties()

Expand All @@ -38,32 +24,35 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties['storeFile'] = '.'
}

android {
defaultConfig {
multiDexEnabled true
}

compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}

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

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
android {
namespace = "de.enough.enough_mail_app"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

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

defaultConfig {
applicationId "de.enough.enough_mail_app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "de.enough.enough_mail_app"
// 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
}

signingConfigs {
Expand All @@ -81,27 +70,120 @@ android {
signingConfig signingConfigs.release
} else {
System.err.println("WARNING: android/key.properties not found, now using debug key.")
signingConfig signingConfigs.debug
signingConfig signingConfigs.debug
}
}
}
namespace 'de.enough.enough_mail_app'
lint {
disable 'InvalidPackage'
}
}



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

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestImplementation 'androidx.test:runner:1.3.0' // or higher
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' // or higher
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
}
// def localProperties = new Properties()
// def localPropertiesFile = rootProject.file('local.properties')
// if (localPropertiesFile.exists()) {
// localPropertiesFile.withReader('UTF-8') { reader ->
// localProperties.load(reader)
// }
// } else {
// throw new GradleException("local.properties file not found")
// }

// 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'
// }

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

// def keystorePropertiesFile = rootProject.file('key.properties')
// def keystoreProperties = new Properties()

// if (keystorePropertiesFile.exists()) {
// keystorePropertiesFile.withReader('UTF-8') { reader ->
// keystoreProperties.load(reader)
// }
// } else {
// keystoreProperties['storeFile'] = '.'
// }

// android {
// defaultConfig {
// multiDexEnabled true
// }

// compileOptions {
// // Flag to enable support for the new language APIs
// coreLibraryDesugaringEnabled true
// // Sets Java compatibility to Java 8
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }

// compileSdkVersion rootProject.ext.compileSdkVersion

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


// defaultConfig {
// applicationId "de.enough.enough_mail_app"
// minSdkVersion rootProject.ext.minSdkVersion
// targetSdkVersion rootProject.ext.targetSdkVersion
// versionCode flutterVersionCode.toInteger()
// versionName flutterVersionName
// }

// signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
// }
// }

// buildTypes {
// release {
// if (keystorePropertiesFile.exists()) {
// signingConfig signingConfigs.release
// } else {
// System.err.println("WARNING: android/key.properties not found, now using debug key.")
// signingConfig signingConfigs.debug
// }
// }
// }
// namespace 'de.enough.enough_mail_app'
// lint {
// disable 'InvalidPackage'
// }
// }



// flutter {
// source '../..'
// }

// dependencies {
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// androidTestImplementation 'androidx.test:runner:1.3.0' // or higher
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' // or higher
// coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
// implementation 'androidx.window:window:1.0.0'
// implementation 'androidx.window:window-java:1.0.0'
// }
78 changes: 55 additions & 23 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,40 +1,72 @@
buildscript {
ext.kotlin_version = '1.8.10'
ext {
minSdkVersion = 21 // or higher
compileSdkVersion = 34 // or higher
targetSdkVersion = 34 // or higher
appCompatVersion = "1.4.2" // or higher
}
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}


allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
// [required] background_fetch
// compare https://github.com/transistorsoft/flutter_background_fetch/blob/master/help/INSTALL-ANDROID.md
url "${project(':background_fetch').projectDir}/libs"
}
}
}

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

tasks.register("clean", Delete) {
delete rootProject.buildDir
}

ext {
compileSdkVersion = 34 // or higher / as desired
targetSdkVersion = 34 // or higher / as desired
appCompatVersion = "1.4.2" // or higher / as desired
kotlin_version = "2.0.0"
}


// buildscript {
// ext.kotlin_version = '1.8.10'
// ext {
// minSdkVersion = 21 // or higher
// compileSdkVersion = 34 // or higher
// targetSdkVersion = 34 // or higher
// appCompatVersion = "1.4.2" // or higher
// }
// repositories {
// google()
// jcenter()
// }

// dependencies {
// classpath 'com.android.tools.build:gradle:7.4.2'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// }
// }


// allprojects {
// repositories {
// google()
// jcenter()
// maven {
// // [required] background_fetch
// url "${project(':background_fetch').projectDir}/libs"
// }
// }
// }

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

// tasks.register("clean", Delete) {
// delete rootProject.buildDir
// }
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M
android.enableD8=true
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 @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
48 changes: 37 additions & 11 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// // Copyright 2014 The Flutter Authors. All rights reserved.
// // Use of this source code is governed by a BSD-style license that can be
// // found in the LICENSE file.

include ':app'
// include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
// def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
// def properties = new Properties()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
// assert localPropertiesFile.exists()
// localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

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"
// 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"

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
}()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.0" apply false
}

include ":app"
Loading

0 comments on commit 8d61729

Please sign in to comment.