The Android and Rust code have previously managed joint custody of the derived data database. With more complex migrations now required, we need to make the Android side read-only. To achieve that, the Android side will remove Room and instead rely on more primitive SQLite APIs for read-only access.
As part of implementing this change, database management throughout the SDK is being refactored.
There will be multiple representations of the data:
- Database representation (and some Entity representations in the places that Room hasn’t been removed yet). These representations are not as type safe and don’t match Kotlin best practices in all cases.
- Once #615 is implemented there will also be network representations
- Type safe models, which often appear in the public API The Database and Network representations will be converted to and from the type safe model representation.
* [#509] Remove OkHttp and Okio dependencies
- Okio -> Java NIO anf OkHttp -> HttpURLConnection in SaplingParamTool class
- Both replaced also in the test packages
- Removed dependencies to the replaced components
- Again switched a few assertions from JUnit to kotlin.test
- Created readLinesInFlow() function which is now reused in few places and runs without OkHttp
- Added subsequent TODOs to code base
- Wrapped to withContext to move it to an IO thread.
- Added use function on the stream and close() at the end of the channels use.
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
The third party plugin that we’ve used for publishing has introduced multiple breaking changes recently.
By migrating to more standard Gradle publishing APIs, the deployment process is more explicit for those unfamiliar with Gradle. It also will simplify some upcoming changes to modularize this SDK project.
Simplifies running the SDK test suite versus darkside tests (which require special environment setup).
Note that the darkside tests are still broken. This is not a regression, as they were broken before. This is an intermediate step towards fixing those tests.
This will provide reports on dependecy updates that are available.
Its outside the critical path of the build, so it can be readily disabled or replaced in the future.
In addition to using build-conventions to make the build scripts more DRY, the following additional changes are included in this commit:
- Convert build scripts to kts
- Fix a double-build issue with the SDK
- Add configurable options for treating compiler warnings as errors (disabled for now, due to extensive warnings that need to be corrected first)
- Added detekt as an additional static analysis tool
Move SDK from the root gradle project to its own Gradle module
Move the demo app to be a peer of the SDK
This will simplify integration with CI on Bitrise.