diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83ee4350..b071d949 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,10 @@ jobs: with: fetch-depth: 1 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: "11" + java-version: "17" distribution: "adopt" - name: Run Android tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ece1e2d..ea80491a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Change Log ========== +## 3.42.0 +- [SQLite 3.42.0](https://www.sqlite.org/releaselog/3_42_0.html) +- [SQLite 3.41.2](https://www.sqlite.org/releaselog/3_41_2.html) + ## 3.41.1 - [SQLite 3.41.1](https://www.sqlite.org/releaselog/3_41_1.html) - [SQLite 3.41.0](https://www.sqlite.org/releaselog/3_41_0.html) diff --git a/README.md b/README.md index 8ead72cb..8a3ae18e 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ ![Build Status](https://github.com/requery/sqlite-android/actions/workflows/ci.yml/badge.svg) [![Download](https://jitpack.io/v/requery/sqlite-android.svg)](https://jitpack.io/#requery/sqlite-android) -This is an Android specific distribution of the latest versions of SQLite. It contains the latest -SQLite version and the Android specific database APIs derived from AOSP packaged as an AAR -library distributed on jitpack. +This is an Android specific distribution of the latest versions of SQLite. +It contains the latest SQLite version and the Android specific database APIs +derived from AOSP packaged as an AAR library distributed on jitpack. Why? ---- @@ -15,9 +15,9 @@ Why? - **Up-to-date** Even the latest version of Android is several versions behind the latest version of SQLite. -Theses versions do not have the bug fixes, performance improvements, or new features present in +These versions do not have the bug fixes, performance improvements, or new features present in current versions of SQLite. This problem is worse the older the version of the OS the device has. -Using this library you can keep up to date with the latest versions of SQLite and provide a +Using this library, you can keep up to date with the latest versions of SQLite and provide a consistent version across OS versions and devices. Use new SQLite features: @@ -32,9 +32,11 @@ Use new SQLite features: Usage ----- -Follow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository to your build file if you have not. +Follow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository +to your build file if you have not. -Typically, this means an edit to your `build.gradle` file to add a new `repository` definition in the `allprojects` block, like this: +Typically, this means an edit to your `build.gradle` file to add a new `repository` definition +in the `allprojects` block, like this: ```gradle allprojects { @@ -49,7 +51,7 @@ Then add the sqlite-android artifact from this repository as a dependency: ```gradle dependencies { - implementation 'com.github.requery:sqlite-android:3.41.1' + implementation 'com.github.requery:sqlite-android:3.42.0' } ``` Then change usages of `android.database.sqlite.SQLiteDatabase` to @@ -61,7 +63,7 @@ depended on `android.database.sqlite.SQLiteDatabase` equivalent APIs are provide If you expose `Cursor` instances across processes you should wrap the returned cursors in a [CrossProcessCursorWrapper](http://developer.android.com/reference/android/database/CrossProcessCursorWrapper.html) -for performance reasons the cursors are not cross process by default. +for performance reasons the cursors are not a cross process by default. ### Support library compatibility @@ -83,8 +85,8 @@ The native library is built for the following CPU architectures: - `x86` ~1.7 MB - `x86_64` ~1.8 MB -However you may not want to include all binaries in your apk. You can exclude certain variants by -using `packagingOptions`: +However, you may not want to include all binaries in your apk. +You can exclude certain variants by using `packagingOptions`: ```gradle android { @@ -97,36 +99,36 @@ android { } ``` -The size of the artifacts with only the armeabi-v7a binary is **~1.2 MB**. In general you can use -armeabi-v7a on the majority of Android devices including Intel Atom which provides a native -translation layer, however performance under the translation layer is worse than using the x86 -binary. +The size of the artifacts with only the armeabi-v7a binary is **~1.2 MB**. +In general, you can use armeabi-v7a on the majority of Android devices including Intel Atom +which provides a native translation layer, however, performance under the translation layer +is worse than using the x86 binary. 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). Requirements ------------ -The min SDK level is API level 14 (Ice Cream Sandwich). +The min SDK level is API level 19 (KitKat). Versioning ---------- The library is versioned after the version of SQLite it contains. For changes specific to just the -wrapper API a revision number is added e.g. 3.41.1-X, where X is the revision number. +wrapper API a revision number is added e.g. 3.42.0-X, where X is the revision number. Acknowledgements ---------------- This project is based on the AOSP code and the [Android SQLite bindings](https://www.sqlite.org/android/doc/trunk/www/index.wiki) -No official distributions are made from the Android SQLite bindings it and it has not been updated +No official distributions are made from the Android SQLite bindings it, and it has not been updated in a while, this project starts there and makes significant changes: Changes ------- -- **Fast read performance:** The original SQLite bindings filled the CursorWindow using it's +- **Fast read performance:** The original SQLite bindings filled the CursorWindow using its Java methods from native C++. This was because there is no access to the native CursorWindow - native API from the NDK. Unfortunately this slowed read performance significantly (roughly 2x + native API from the NDK. Unfortunately, this slowed read performance significantly (roughly 2x worse vs the android database API) because of extra JNI roundtrips. This has been rewritten without the JNI to Java calls (so more like the original AOSP code) and also using a local memory CursorWindow. diff --git a/build.gradle b/build.gradle index 9e17d471..77d27aa5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ plugins { - id 'com.android.library' version '7.4.2' apply false - id 'de.undercouch.download' version '5.3.1' apply false + id "com.android.library" version "8.0.1" apply false + id "de.undercouch.download" version "5.4.0" apply false } diff --git a/gradle.properties b/gradle.properties index 717cbcf1..6fb2ffdd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,4 @@ android.useAndroidX=true -android.disableAutomaticComponentCreation=true # Disabling unused build features android.defaults.buildfeatures.aidl=false @@ -24,4 +23,4 @@ POM_DEVELOPER_ID=TODO POM_DEVELOPER_NAME=TODO POM_DEVELOPER_URL=TODO POM_INCEPTION_YEAR=TODO -VERSION_NAME=3.41.1-SNAPSHOT +VERSION_NAME=3.42.0-SNAPSHOT \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdc9a83b..37aef8d3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..1e41e00b --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk17 \ No newline at end of file diff --git a/sqlite-android/build.gradle b/sqlite-android/build.gradle index 039811c9..a962680e 100644 --- a/sqlite-android/build.gradle +++ b/sqlite-android/build.gradle @@ -1,15 +1,16 @@ import com.vanniktech.maven.publish.SonatypeHost plugins { - id 'de.undercouch.download' - id 'com.android.library' - id 'com.vanniktech.maven.publish' version '0.24.0' + id "de.undercouch.download" + id "com.android.library" + id "com.vanniktech.maven.publish" version "0.25.2" } android { - buildToolsVersion "33.0.2" - ndkVersion '25.2.9519653' - compileSdkVersion 33 + buildToolsVersion = "33.0.2" + ndkVersion "25.2.9519653" + + compileSdk 33 namespace "io.requery.android.sqlite" @@ -17,17 +18,17 @@ android { minSdkVersion 19 versionName VERSION_NAME - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - consumerProguardFiles 'proguard-rules.pro' + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "proguard-rules.pro" ndk { - abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' + abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } } buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } @@ -41,64 +42,57 @@ android { externalNativeBuild { ndkBuild { - path 'src/main/jni/Android.mk' + path "src/main/jni/Android.mk" } } } dependencies { - api 'androidx.core:core:1.9.0' - api 'androidx.sqlite:sqlite:2.3.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:core:1.5.0' - androidTestImplementation 'androidx.test:runner:1.5.2' - androidTestImplementation 'androidx.test:rules:1.5.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' + api("androidx.core:core:1.10.1") + api("androidx.sqlite:sqlite:2.3.1") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test:core:1.5.0") + androidTestImplementation("androidx.test:runner:1.5.2") + androidTestImplementation("androidx.test:rules:1.5.0") + androidTestImplementation("androidx.test.ext:junit:1.1.5") } ext { - sqliteDistributionUrl = 'https://www.sqlite.org/2023/sqlite-amalgamation-3410100.zip' + sqliteDistributionUrl = "https://www.sqlite.org/2023/sqlite-amalgamation-3420000.zip" } -task downloadSqlite(type: Download) { +tasks.register("downloadSqlite", Download) { src project.sqliteDistributionUrl - dest 'src/main/jni/sqlite.zip' + dest "src/main/jni/sqlite.zip" } -task installSqlite(dependsOn: downloadSqlite, type: Copy) { +tasks.register("installSqlite", Copy) { + dependsOn downloadSqlite from zipTree(downloadSqlite.dest).matching { - include '*/sqlite3.*' + include "*/sqlite3.*" eachFile { it.setPath(it.getName()) } } - into 'src/main/jni/sqlite' + into "src/main/jni/sqlite" } preBuild.dependsOn installSqlite -task javadoc(type: Javadoc) { +tasks.register("javadoc", Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - android.libraryVariants.all { variant -> - if (variant.name == 'release') { + android.libraryVariants.configureEach { variant -> + if (variant.name == "release") { owner.classpath += variant.javaCompileProvider.get().classpath } } - exclude '**/R.html', '**/R.*.html', '**/index.html' + exclude "**/R.html", "**/R.*.html", "**/index.html" if (JavaVersion.current().isJava9Compatible()) { - options.addBooleanOption('html5', true) + options.addBooleanOption("html5", true) } failOnError false } -// https://issuetracker.google.com/issues/207403732 -tasks.whenTaskAdded { task -> - if (task.name.startsWith("configureNdkBuildDebug") - || task.name.startsWith("configureNdkBuildRelease")) { - task.dependsOn preBuild - } -} - mavenPublishing { publishToMavenCentral(SonatypeHost.DEFAULT, /* automaticRelease */ true) signAllPublications()