Adding a locally generated changelog.#1355
Conversation
- Adds a last_version_code_viewed, that gets updated in the DB, and compared against the current version to show the changelog. This means we never have to manually update that column again. - Add a generate_changelog.sh script that uses git-cliff. It copies the changelog into code assets, which can be done before the release. - Fixes #1272
| } | ||
| } | ||
|
|
||
| val MIGRATION_22_21 = |
There was a problem hiding this comment.
I removed all these down migrations since they were useless.
|
|
||
| fun Context.getVersionCode(): Int = |
There was a problem hiding this comment.
That's one way to do it. Another is through BuildConfig, you can enable it in the gradle build it's a static class containing all the info of the build
| defaultValue = "0", | ||
| ) | ||
| val themeColor: Int, | ||
| // TODO get rid of this column next time you regenerate the app |
There was a problem hiding this comment.
Why next time? why cant we drop it already?
There was a problem hiding this comment.
android SQLite can't drop columns, you have to regenerate the entire table. Should probably be done at some point, but probably when we go over all the columns and everything we need to refactor.
There was a problem hiding this comment.
We have done this before, see when I changed the default of a column
| name = "last_version_code_viewed", | ||
| defaultValue = "0", | ||
| ) | ||
| val lastVersionCodeViewed: Int, |
There was a problem hiding this comment.
I would probably have made a separate table for this. It's not really a app setting. But this is fine
| val res = API.httpClient.newCall(req).execute() | ||
| _changelog.value = res.body.string() | ||
| Log.d("jerboa", "Getting RELEASES.md from assets...") | ||
| val releasesStr = ctx.assets.open("RELEASES.md").bufferedReader().use { it.readText() } |
There was a problem hiding this comment.
I rather have this logic in the viewmodel. Just pass a stream or string.
I see that we did this before but we shouldn't have
There was a problem hiding this comment.
I'll try to refactor that now.
|
|
||
| @WorkerThread | ||
| suspend fun updateChangelog() { | ||
| withContext(Dispatchers.IO) { |
There was a problem hiding this comment.
I removed this withContext when I moved this to the viewmodel. It didn't seem to have any effect.
last_version_code_viewedrather thanchangelog_viewedfor showing the changelog #1272