Skip to content

Commit

Permalink
Update dependencies and reestructure build scripts
Browse files Browse the repository at this point in the history
Restructured the build file based on a new blank Flutter project.
Also removed Gradle version catalogs due to the aforementioned changes.

Updated the following dependencies:

Flutter SDK: 3.13.9 -> 3.16.8
http: 1.1.0 -> 1.2.0
meta: 1.9.1 -> 1.10.0
package_info_plus: 4.2.0 -> 5.0.1
path_provider: 2.1.1 -> 2.1.2
url_launcher: 6.2.1 -> 6.2.3
  • Loading branch information
MateusRodCosta committed Jan 19, 2024
1 parent 08e48bb commit 2f0b2ed
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 113 deletions.
28 changes: 12 additions & 16 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias libs.plugins.android.application
alias libs.plugins.kotlin.android
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
Expand All @@ -11,22 +12,16 @@ if (localPropertiesFile.exists()) {
}
}

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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
Expand All @@ -37,11 +32,12 @@ kotlin {

android {
namespace "com.mateusrodcosta.apps.vidyamusic"

compileSdk 34

defaultConfig {
applicationId "com.mateusrodcosta.apps.vidyamusic"
minSdkVersion 26
//noinspection OldTargetApi
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -97,6 +93,12 @@ android {
}
}

flutter {
source '../..'
}

dependencies {}

ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, x86_64: 4]

android.applicationVariants.configureEach { variant ->
Expand All @@ -119,9 +121,3 @@ android.applicationVariants.configureEach { variant ->
}
}

flutter {
source '../..'
}

dependencies {
}
3 changes: 1 addition & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
alias libs.plugins.android.application apply false
alias libs.plugins.kotlin.android apply false
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
}

rootProject.layout.buildDirectory.set(new File('../build'))
Expand Down
9 changes: 0 additions & 9 deletions android/gradle/libs.versions.toml

This file was deleted.

40 changes: 21 additions & 19 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import org.gradle.api.initialization.resolve.RepositoriesMode

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
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
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
settings.ext.flutterSdkPath = flutterSdkPath()

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

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Vidya Music"
include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
}

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.2.1" apply false
}

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"
rootProject.name = "Vidya Music"
include ":app"
2 changes: 1 addition & 1 deletion flutter-sdk
Submodule flutter-sdk updated 2340 files
Loading

0 comments on commit 2f0b2ed

Please sign in to comment.