migrated to new gradle building shit

This commit is contained in:
Kima 2024-03-17 21:59:32 +01:00
parent 3a2b3fa568
commit 941ed5e0d1
3 changed files with 61 additions and 34 deletions

View File

@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
@ -6,10 +12,10 @@ 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 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) {
@ -21,9 +27,9 @@ if (flutterVersionName == null) {
throw new GradleException("Undefined VersionName")
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// apply plugin: 'com.android.application'
// apply plugin: 'kotlin-android'
// apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file("key.properties")
@ -36,7 +42,8 @@ debugKeystoreProperties.load(new FileInputStream(debugKeystorePropertiesFile))
android {
ndkVersion "25.1.8937393"
compileSdkVersion rootProject.ext.compileSdkVersion
// compileSdkVersion rootProject.ext.compileSdkVersion
compileSdkVersion 34
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@ -52,7 +59,7 @@ android {
defaultConfig {
applicationId "hu.refilc.naplo"
minSdkVersion 21
targetSdkVersion rootProject.ext.targetSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -106,7 +113,7 @@ flutter {
dependencies {
implementation 'com.android.support:multidex:2.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21"
implementation 'joda-time:joda-time:2.9.4'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

View File

@ -1,22 +1,22 @@
buildscript {
ext.kotlin_version = '1.8.21'
// buildscript {
// ext.kotlin_version = '1.8.21'
ext {
compileSdkVersion = 34
targetSdkVersion = 34
appCompatVersion = "1.1.0"
}
// ext {
// compileSdkVersion = 34
// targetSdkVersion = 34
// appCompatVersion = "1.1.0"
// }
repositories {
google()
jcenter()
}
// repositories {
// google()
// jcenter()
// }
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
// dependencies {
// classpath 'com.android.tools.build:gradle:7.1.1'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// }
// }
allprojects {
repositories {

View File

@ -1,11 +1,31 @@
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) }
// ext {
// compileSdkVersion = 34
// targetSdkVersion = 34
// appCompatVersion = "1.1.0"
// }
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"
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.1.1" apply false
id "org.jetbrains.kotlin.android" version "1.8.21" apply false
}
include ":app"