Skip to content

Commit ec3e07c

Browse files
SteinerOknpurushe
andauthored
Update SQLite to v3.41.2 (#179)
* Update to 3.41.2 and Readme corrections * Update dependencies and cleanup Co-authored-by: Nikhil Purushe <npurushe@gmail.com>
1 parent 679b34e commit ec3e07c

File tree

8 files changed

+65
-64
lines changed

8 files changed

+65
-64
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
with:
1818
fetch-depth: 1
1919

20-
- name: Set up JDK 11
20+
- name: Set up JDK 17
2121
uses: actions/setup-java@v2
2222
with:
23-
java-version: "11"
23+
java-version: "17"
2424
distribution: "adopt"
2525

2626
- name: Run Android tests

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Change Log
22
==========
33

4+
## 3.42.0
5+
- [SQLite 3.42.0](https://www.sqlite.org/releaselog/3_42_0.html)
6+
- [SQLite 3.41.2](https://www.sqlite.org/releaselog/3_41_2.html)
7+
48
## 3.41.1
59
- [SQLite 3.41.1](https://www.sqlite.org/releaselog/3_41_1.html)
610
- [SQLite 3.41.0](https://www.sqlite.org/releaselog/3_41_0.html)

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
![Build Status](https://github.com/requery/sqlite-android/actions/workflows/ci.yml/badge.svg)
44
[![Download](https://jitpack.io/v/requery/sqlite-android.svg)](https://jitpack.io/#requery/sqlite-android)
55

6-
This is an Android specific distribution of the latest versions of SQLite. It contains the latest
7-
SQLite version and the Android specific database APIs derived from AOSP packaged as an AAR
8-
library distributed on jitpack.
6+
This is an Android specific distribution of the latest versions of SQLite.
7+
It contains the latest SQLite version and the Android specific database APIs
8+
derived from AOSP packaged as an AAR library distributed on jitpack.
99

1010
Why?
1111
----
@@ -15,9 +15,9 @@ Why?
1515
- **Up-to-date**
1616

1717
Even the latest version of Android is several versions behind the latest version of SQLite.
18-
Theses versions do not have the bug fixes, performance improvements, or new features present in
18+
These versions do not have the bug fixes, performance improvements, or new features present in
1919
current versions of SQLite. This problem is worse the older the version of the OS the device has.
20-
Using this library you can keep up to date with the latest versions of SQLite and provide a
20+
Using this library, you can keep up to date with the latest versions of SQLite and provide a
2121
consistent version across OS versions and devices.
2222

2323
Use new SQLite features:
@@ -32,9 +32,11 @@ Use new SQLite features:
3232
Usage
3333
-----
3434

35-
Follow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository to your build file if you have not.
35+
Follow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository
36+
to your build file if you have not.
3637

37-
Typically, this means an edit to your `build.gradle` file to add a new `repository` definition in the `allprojects` block, like this:
38+
Typically, this means an edit to your `build.gradle` file to add a new `repository` definition
39+
in the `allprojects` block, like this:
3840

3941
```gradle
4042
allprojects {
@@ -49,7 +51,7 @@ Then add the sqlite-android artifact from this repository as a dependency:
4951

5052
```gradle
5153
dependencies {
52-
implementation 'com.github.requery:sqlite-android:3.41.1'
54+
implementation 'com.github.requery:sqlite-android:3.42.0'
5355
}
5456
```
5557
Then change usages of `android.database.sqlite.SQLiteDatabase` to
@@ -61,7 +63,7 @@ depended on `android.database.sqlite.SQLiteDatabase` equivalent APIs are provide
6163

6264
If you expose `Cursor` instances across processes you should wrap the returned cursors in a
6365
[CrossProcessCursorWrapper](http://developer.android.com/reference/android/database/CrossProcessCursorWrapper.html)
64-
for performance reasons the cursors are not cross process by default.
66+
for performance reasons the cursors are not a cross process by default.
6567

6668
### Support library compatibility
6769

@@ -83,8 +85,8 @@ The native library is built for the following CPU architectures:
8385
- `x86` ~1.7 MB
8486
- `x86_64` ~1.8 MB
8587

86-
However you may not want to include all binaries in your apk. You can exclude certain variants by
87-
using `packagingOptions`:
88+
However, you may not want to include all binaries in your apk.
89+
You can exclude certain variants by using `packagingOptions`:
8890

8991
```gradle
9092
android {
@@ -97,36 +99,36 @@ android {
9799
}
98100
```
99101

100-
The size of the artifacts with only the armeabi-v7a binary is **~1.2 MB**. In general you can use
101-
armeabi-v7a on the majority of Android devices including Intel Atom which provides a native
102-
translation layer, however performance under the translation layer is worse than using the x86
103-
binary.
102+
The size of the artifacts with only the armeabi-v7a binary is **~1.2 MB**.
103+
In general, you can use armeabi-v7a on the majority of Android devices including Intel Atom
104+
which provides a native translation layer, however, performance under the translation layer
105+
is worse than using the x86 binary.
104106

105107
Note that starting August 1, 2019, your apps published on Google Play will [need to support 64-bit architectures](https://developer.android.com/distribute/best-practices/develop/64-bit).
106108

107109
Requirements
108110
------------
109111

110-
The min SDK level is API level 14 (Ice Cream Sandwich).
112+
The min SDK level is API level 19 (KitKat).
111113

112114
Versioning
113115
----------
114116

115117
The library is versioned after the version of SQLite it contains. For changes specific to just the
116-
wrapper API a revision number is added e.g. 3.41.1-X, where X is the revision number.
118+
wrapper API a revision number is added e.g. 3.42.0-X, where X is the revision number.
117119

118120
Acknowledgements
119121
----------------
120122
This project is based on the AOSP code and the [Android SQLite bindings](https://www.sqlite.org/android/doc/trunk/www/index.wiki)
121-
No official distributions are made from the Android SQLite bindings it and it has not been updated
123+
No official distributions are made from the Android SQLite bindings it, and it has not been updated
122124
in a while, this project starts there and makes significant changes:
123125

124126
Changes
125127
-------
126128

127-
- **Fast read performance:** The original SQLite bindings filled the CursorWindow using it's
129+
- **Fast read performance:** The original SQLite bindings filled the CursorWindow using its
128130
Java methods from native C++. This was because there is no access to the native CursorWindow
129-
native API from the NDK. Unfortunately this slowed read performance significantly (roughly 2x
131+
native API from the NDK. Unfortunately, this slowed read performance significantly (roughly 2x
130132
worse vs the android database API) because of extra JNI roundtrips. This has been rewritten
131133
without the JNI to Java calls (so more like the original AOSP code) and also using a local memory
132134
CursorWindow.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
plugins {
2-
id 'com.android.library' version '7.4.2' apply false
3-
id 'de.undercouch.download' version '5.3.1' apply false
2+
id "com.android.library" version "8.0.1" apply false
3+
id "de.undercouch.download" version "5.4.0" apply false
44
}

gradle.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
android.useAndroidX=true
2-
android.disableAutomaticComponentCreation=true
32

43
# Disabling unused build features
54
android.defaults.buildfeatures.aidl=false
@@ -24,4 +23,4 @@ POM_DEVELOPER_ID=TODO
2423
POM_DEVELOPER_NAME=TODO
2524
POM_DEVELOPER_URL=TODO
2625
POM_INCEPTION_YEAR=TODO
27-
VERSION_NAME=3.41.1-SNAPSHOT
26+
VERSION_NAME=3.42.0-SNAPSHOT
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

jitpack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jdk:
2+
- openjdk17

sqlite-android/build.gradle

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
import com.vanniktech.maven.publish.SonatypeHost
22

33
plugins {
4-
id 'de.undercouch.download'
5-
id 'com.android.library'
6-
id 'com.vanniktech.maven.publish' version '0.24.0'
4+
id "de.undercouch.download"
5+
id "com.android.library"
6+
id "com.vanniktech.maven.publish" version "0.25.2"
77
}
88

99
android {
10-
buildToolsVersion "33.0.2"
11-
ndkVersion '25.2.9519653'
12-
compileSdkVersion 33
10+
buildToolsVersion = "33.0.2"
11+
ndkVersion "25.2.9519653"
12+
13+
compileSdk 33
1314

1415
namespace "io.requery.android.sqlite"
1516

1617
defaultConfig {
1718
minSdkVersion 19
1819
versionName VERSION_NAME
1920

20-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
21-
consumerProguardFiles 'proguard-rules.pro'
21+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
22+
consumerProguardFiles "proguard-rules.pro"
2223
ndk {
23-
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
24+
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
2425
}
2526
}
2627

2728
buildTypes {
2829
release {
2930
minifyEnabled false
30-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
31+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
3132
}
3233
}
3334

@@ -41,64 +42,57 @@ android {
4142

4243
externalNativeBuild {
4344
ndkBuild {
44-
path 'src/main/jni/Android.mk'
45+
path "src/main/jni/Android.mk"
4546
}
4647
}
4748
}
4849

4950
dependencies {
50-
api 'androidx.core:core:1.9.0'
51-
api 'androidx.sqlite:sqlite:2.3.0'
52-
testImplementation 'junit:junit:4.13.2'
53-
androidTestImplementation 'androidx.test:core:1.5.0'
54-
androidTestImplementation 'androidx.test:runner:1.5.2'
55-
androidTestImplementation 'androidx.test:rules:1.5.0'
56-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
51+
api("androidx.core:core:1.10.1")
52+
api("androidx.sqlite:sqlite:2.3.1")
53+
testImplementation("junit:junit:4.13.2")
54+
androidTestImplementation("androidx.test:core:1.5.0")
55+
androidTestImplementation("androidx.test:runner:1.5.2")
56+
androidTestImplementation("androidx.test:rules:1.5.0")
57+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
5758
}
5859

5960
ext {
60-
sqliteDistributionUrl = 'https://www.sqlite.org/2023/sqlite-amalgamation-3410100.zip'
61+
sqliteDistributionUrl = "https://www.sqlite.org/2023/sqlite-amalgamation-3420000.zip"
6162
}
6263

63-
task downloadSqlite(type: Download) {
64+
tasks.register("downloadSqlite", Download) {
6465
src project.sqliteDistributionUrl
65-
dest 'src/main/jni/sqlite.zip'
66+
dest "src/main/jni/sqlite.zip"
6667
}
6768

68-
task installSqlite(dependsOn: downloadSqlite, type: Copy) {
69+
tasks.register("installSqlite", Copy) {
70+
dependsOn downloadSqlite
6971
from zipTree(downloadSqlite.dest).matching {
70-
include '*/sqlite3.*'
72+
include "*/sqlite3.*"
7173
eachFile { it.setPath(it.getName()) }
7274
}
73-
into 'src/main/jni/sqlite'
75+
into "src/main/jni/sqlite"
7476
}
7577

7678
preBuild.dependsOn installSqlite
7779

78-
task javadoc(type: Javadoc) {
80+
tasks.register("javadoc", Javadoc) {
7981
source = android.sourceSets.main.java.srcDirs
8082
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
81-
android.libraryVariants.all { variant ->
82-
if (variant.name == 'release') {
83+
android.libraryVariants.configureEach { variant ->
84+
if (variant.name == "release") {
8385
owner.classpath += variant.javaCompileProvider.get().classpath
8486
}
8587
}
86-
exclude '**/R.html', '**/R.*.html', '**/index.html'
88+
exclude "**/R.html", "**/R.*.html", "**/index.html"
8789
if (JavaVersion.current().isJava9Compatible()) {
88-
options.addBooleanOption('html5', true)
90+
options.addBooleanOption("html5", true)
8991
}
9092

9193
failOnError false
9294
}
9395

94-
// https://issuetracker.google.com/issues/207403732
95-
tasks.whenTaskAdded { task ->
96-
if (task.name.startsWith("configureNdkBuildDebug")
97-
|| task.name.startsWith("configureNdkBuildRelease")) {
98-
task.dependsOn preBuild
99-
}
100-
}
101-
10296
mavenPublishing {
10397
publishToMavenCentral(SonatypeHost.DEFAULT, /* automaticRelease */ true)
10498
signAllPublications()

0 commit comments

Comments
 (0)