Skip to content

Commit 17f2551

Browse files
committed
Update android build files to have legacy packaging and use new kotlin config
1 parent de31b8e commit 17f2551

File tree

9 files changed

+86
-49
lines changed

9 files changed

+86
-49
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,4 +870,4 @@ jobs:
870870
identifier: LinwoodDev.Flow.Nightly
871871
version: ${{ needs.deploy.outputs.version }}
872872
release-tag: v${{ needs.deploy.outputs.version }}
873-
token: ${{ secrets.CI_PAT }}
873+
token: ${{ secrets.CI_PAT }}

app/android/.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ gradle-wrapper.jar
44
/gradlew
55
/gradlew.bat
66
/local.properties
7-
GeneratedPluginRegistrant.java
87
/app/.cxx/
8+
GeneratedPluginRegistrant.java
9+
/.kotlin/
910
/build/
1011

1112
# Remember to never publicly share your keystore.
1213
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1314
key.properties
14-
key.jks
15+
**/*.keystore
16+
**/*.jks
1517
play-store-credentials.json
18+
19+
# Fastlane
20+
.bundle

app/android/Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ GEM
227227

228228
PLATFORMS
229229
ruby
230+
x64-mingw-ucrt
230231
x86_64-linux
231232

232233
DEPENDENCIES

app/android/app/build.gradle.kts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import java.util.Properties
23
import java.io.FileInputStream
34

@@ -19,16 +20,21 @@ android {
1920
compileSdk = flutter.compileSdkVersion
2021
ndkVersion = flutter.ndkVersion
2122

23+
// Flutter-friendly toggles:
24+
// - Env: USE_LEGACY_PACKAGING=true
25+
val useLegacy = (System.getenv("USE_LEGACY_PACKAGING") ?: "false").toBoolean()
26+
27+
packaging {
28+
jniLibs {
29+
useLegacyPackaging = useLegacy
30+
}
31+
}
2232
compileOptions {
23-
sourceCompatibility = JavaVersion.VERSION_11
24-
targetCompatibility = JavaVersion.VERSION_11
33+
sourceCompatibility = JavaVersion.VERSION_17
34+
targetCompatibility = JavaVersion.VERSION_17
2535
isCoreLibraryDesugaringEnabled = true
2636
}
2737

28-
kotlinOptions {
29-
jvmTarget = JavaVersion.VERSION_11.toString()
30-
}
31-
3238
flavorDimensions += "default"
3339
productFlavors {
3440
create("production") {
@@ -56,7 +62,6 @@ android {
5662
targetSdk = flutter.targetSdkVersion
5763
versionCode = flutter.versionCode
5864
versionName = flutter.versionName
59-
multiDexEnabled = true
6065
}
6166

6267
signingConfigs {
@@ -85,11 +90,16 @@ android {
8590
includeInBundle = false
8691
}
8792
}
88-
8993
dependencies {
9094
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
9195
}
9296

97+
kotlin {
98+
compilerOptions {
99+
jvmTarget = JvmTarget.fromTarget("17")
100+
}
101+
}
102+
93103
flutter {
94104
source = "../.."
95105
}

app/android/build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ subprojects {
1212
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
1313
project.layout.buildDirectory.value(newSubprojectBuildDir)
1414
}
15+
16+
subprojects {
17+
afterEvaluate {
18+
if (project.extensions.findByName("android") != null) {
19+
project.extensions.configure<com.android.build.gradle.BaseExtension>("android") {
20+
if (compileSdkVersion == "android-31" || compileSdkVersion == "android-33" || compileSdkVersion == "android-34") {
21+
val appProject = rootProject.project(":app")
22+
val appAndroid = appProject.extensions.findByType(com.android.build.gradle.BaseExtension::class.java)
23+
if (appAndroid != null && appAndroid.compileSdkVersion != null) {
24+
println("Setting compileSdkVersion to ${appAndroid.compileSdkVersion} for ${project.name}")
25+
compileSdkVersion = appAndroid.compileSdkVersion
26+
} else {
27+
println("Could not find compileSdkVersion from app project for ${project.name}")
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
34+
1535
subprojects {
1636
project.evaluationDependsOn(":app")
1737
}

app/android/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pluginManagement {
1818

1919
plugins {
2020
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21-
id("com.android.application") version "8.12.2" apply false
21+
id("com.android.application") version "8.13.2" apply false
2222
id("org.jetbrains.kotlin.android") version "2.3.0" apply false
2323
}
2424

app/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ packages:
302302
dependency: transitive
303303
description:
304304
name: ffi
305-
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
305+
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
306306
url: "https://pub.dev"
307307
source: hosted
308-
version: "2.1.4"
308+
version: "2.1.5"
309309
file:
310310
dependency: transitive
311311
description:

docs/pnpm-lock.yaml

Lines changed: 35 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metadata/en-US/changelogs/14.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Support for more ical properties (status, location)
33
* Better handling of malformed ical data
44
* Improve dashboard layout
5+
* Add legacy android binaries
56
* Fix markdown field does not exit edit mode on tap outside
67
* Fix note description not updated when note changes
78
* Fix setup not running on mobile platforms

0 commit comments

Comments
 (0)