Skip to content

Commit

Permalink
Add automatic dialect support for Android API 34 (#4251)
Browse files Browse the repository at this point in the history
Determined empirically:

    $ adb shell getprop ro.build.version.sdk
    34

    $ adb shell sqlite3 --version
    3.39.2 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603
  • Loading branch information
JakeWharton committed Jun 9, 2023
1 parent ec3c83d commit 7c92b0c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ internal fun Project.packageName(): String {
internal fun Project.sqliteVersion(): String? {
val androidExtension = extensions.getByType(BaseExtension::class.java)
val minSdk = androidExtension.defaultConfig.minSdk ?: return null

// Mapping available at https://developer.android.com/reference/android/database/sqlite/package-summary.
if (minSdk >= 34) return "app.cash.sqldelight:sqlite-3-38-dialect:$VERSION"
if (minSdk >= 31) return "app.cash.sqldelight:sqlite-3-30-dialect:$VERSION"
if (minSdk >= 30) return "app.cash.sqldelight:sqlite-3-25-dialect:$VERSION"
return "app.cash.sqldelight:sqlite-3-18-dialect:$VERSION"
Expand Down

0 comments on commit 7c92b0c

Please sign in to comment.