Skip to content

Commit b0b25e8

Browse files
authored
Merge pull request #222 from Piwigo/Gradle-KotlinDSL-Migration
Gradle kotlin dsl migration
2 parents 9702a70 + b97cd85 commit b0b25e8

9 files changed

Lines changed: 118 additions & 112 deletions

File tree

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.32.4"
2+
"flutter": "3.32.5"
33
}

android/app/build.gradle

Lines changed: 0 additions & 68 deletions
This file was deleted.

android/app/build.gradle.kts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import java.util.Properties
2+
import java.io.FileInputStream
3+
4+
plugins {
5+
id("com.android.application")
6+
id("kotlin-android")
7+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
8+
id("dev.flutter.flutter-gradle-plugin")
9+
}
10+
11+
// https://docs.flutter.dev/deployment/android#configure-signing-in-gradle
12+
val keystoreProperties = Properties()
13+
val keystorePropertiesFile = rootProject.file("key.properties")
14+
if (keystorePropertiesFile.exists()) {
15+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
16+
}
17+
18+
android {
19+
namespace = "com.remi.piwigo_ng"
20+
//compileSdkVersion flutter.compileSdkVersion
21+
//ndkVersion = flutter.ndkVersion
22+
compileSdk = 36
23+
ndkVersion = "29.0.13599879"
24+
25+
compileOptions {
26+
// Flag to enable support for the new language APIs
27+
isCoreLibraryDesugaringEnabled = true
28+
// Sets Java compatibility to Java 17
29+
sourceCompatibility = JavaVersion.VERSION_17
30+
targetCompatibility = JavaVersion.VERSION_17
31+
}
32+
33+
kotlinOptions {
34+
jvmTarget = JavaVersion.VERSION_17.toString()
35+
}
36+
37+
defaultConfig {
38+
applicationId = "com.piwigo.piwigo_ng"
39+
multiDexEnabled = true
40+
minSdk = 26
41+
targetSdk = 36
42+
versionCode = flutter.versionCode
43+
versionName = flutter.versionName
44+
}
45+
46+
signingConfigs {
47+
create("release") {
48+
keyAlias = keystoreProperties["keyAlias"] as String
49+
keyPassword = keystoreProperties["keyPassword"] as String
50+
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
51+
storePassword = keystoreProperties["storePassword"] as String
52+
}
53+
}
54+
55+
buildTypes {
56+
release {
57+
signingConfig = signingConfigs.getByName("release")
58+
}
59+
}
60+
}
61+
62+
flutter {
63+
source = "../.."
64+
}
65+
66+
dependencies {
67+
implementation("androidx.window:window:1.4.0")
68+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
69+
}

android/build.gradle

Lines changed: 0 additions & 16 deletions
This file was deleted.

android/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9+
rootProject.layout.buildDirectory.value(newBuildDir)
10+
11+
subprojects {
12+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13+
project.layout.buildDirectory.value(newSubprojectBuildDir)
14+
}
15+
subprojects {
16+
project.evaluationDependsOn(":app")
17+
}
18+
19+
tasks.register<Delete>("clean") {
20+
delete(rootProject.layout.buildDirectory)
21+
}

android/settings.gradle

Lines changed: 0 additions & 25 deletions
This file was deleted.

android/settings.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
val flutterSdkPath = run {
3+
val properties = java.util.Properties()
4+
file("local.properties").inputStream().use { properties.load(it) }
5+
val flutterSdkPath = properties.getProperty("flutter.sdk")
6+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7+
flutterSdkPath
8+
}
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21+
id("com.android.application") version "8.10.1" apply false
22+
id("org.jetbrains.kotlin.android") version "2.0.21" apply false
23+
}
24+
25+
include(":app")

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,4 +1477,4 @@ packages:
14771477
version: "3.1.3"
14781478
sdks:
14791479
dart: ">=3.8.0 <4.0.0"
1480-
flutter: ">=3.32.4"
1480+
flutter: ">=3.32.5"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 2.4.0+240
77

88
environment:
99
sdk: ">=3.0.0 <4.0.0"
10-
flutter: 3.32.4
10+
flutter: 3.32.5
1111

1212
dependencies:
1313
flutter:

0 commit comments

Comments
 (0)