Skip to content

Commit

Permalink
Shorten changelog text
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Oct 4, 2023
1 parent a7b6b36 commit a909bd3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 49 deletions.
50 changes: 25 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
When adding new changelog entries, use [Issue #0] to link to issues and
[PR #0 @user] to link to pull requests. Then run:
[PR #0] to link to pull requests. Then run:
./gradlew changelogUpdateLinks
Expand All @@ -9,30 +9,30 @@

### Unreleased

* Update dependencies ([PR #17 @chenxiaolong], [PR #20 @chenxiaolong], [PR #21 @chenxiaolong])
* Fix non-UTF-8 paths not being accepted by custota-tool's `--cert` option on Linux ([PR #18 @chenxiaolong])
* Update dependencies ([PR #17], [PR #20], [PR #21])
* Fix non-UTF-8 paths not being accepted by custota-tool's `--cert` option on Linux ([PR #18])

### Version 2.2

* Fix crash when showing error notification if the app cannot connect to `update_engine` ([Issue #11], [PR #12 @chenxiaolong])
* Explicitly create `/dev/selinux` during boot to fix SELinux patches on Android 14 ([Issue #11], [PR #14 @chenxiaolong])
* Refactor custota-tool to use code from avbroot ([PR #13 @chenxiaolong])
* Fix crash when showing error notification if the app cannot connect to `update_engine` ([Issue #11], [PR #12])
* Explicitly create `/dev/selinux` during boot to fix SELinux patches on Android 14 ([Issue #11], [PR #14])
* Refactor custota-tool to use code from avbroot ([PR #13])

### Version 2.1

* Add Vietnamese translations ([PR #6 @archandanime])
* Fix crash on initial app launch after installation ([Issue #7], [PR #8 @chenxiaolong])
* Add hint text for OTA server URL text box ([Issue #5], [PR #9 @chenxiaolong])
* Document how periodic update checks work ([Issue #5], [PR #10 @chenxiaolong])
* Add Vietnamese translations ([PR #6])
* Fix crash on initial app launch after installation ([Issue #7], [PR #8])
* Add hint text for OTA server URL text box ([Issue #5], [PR #9])
* Document how periodic update checks work ([Issue #5], [PR #10])

### Version 2.0

* Add support for signed OTA metadata ([PR #2 @chenxiaolong])
* Add support for signed OTA metadata ([PR #2])
* **This is a breaking change.** A new `.csig` file needs to be generated for each OTA. See [the documentation](./README.md#ota-server) for instructions.

### Version 1.1

* Add section for bootloader unlock status ([PR #1 @chenxiaolong])
* Add section for bootloader unlock status ([PR #1])

### Version 1.0

Expand All @@ -42,16 +42,16 @@
[Issue #5]: https://github.com/chenxiaolong/Custota/issues/5
[Issue #7]: https://github.com/chenxiaolong/Custota/issues/7
[Issue #11]: https://github.com/chenxiaolong/Custota/issues/11
[PR #1 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/1
[PR #2 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/2
[PR #6 @archandanime]: https://github.com/chenxiaolong/Custota/pull/6
[PR #8 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/8
[PR #9 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/9
[PR #10 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/10
[PR #12 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/12
[PR #13 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/13
[PR #14 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/14
[PR #17 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/17
[PR #18 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/18
[PR #20 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/20
[PR #21 @chenxiaolong]: https://github.com/chenxiaolong/Custota/pull/21
[PR #1]: https://github.com/chenxiaolong/Custota/pull/1
[PR #2]: https://github.com/chenxiaolong/Custota/pull/2
[PR #6]: https://github.com/chenxiaolong/Custota/pull/6
[PR #8]: https://github.com/chenxiaolong/Custota/pull/8
[PR #9]: https://github.com/chenxiaolong/Custota/pull/9
[PR #10]: https://github.com/chenxiaolong/Custota/pull/10
[PR #12]: https://github.com/chenxiaolong/Custota/pull/12
[PR #13]: https://github.com/chenxiaolong/Custota/pull/13
[PR #14]: https://github.com/chenxiaolong/Custota/pull/14
[PR #17]: https://github.com/chenxiaolong/Custota/pull/17
[PR #18]: https://github.com/chenxiaolong/Custota/pull/18
[PR #20]: https://github.com/chenxiaolong/Custota/pull/20
[PR #21]: https://github.com/chenxiaolong/Custota/pull/21
30 changes: 6 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -397,26 +397,15 @@ android.applicationVariants.all {
}
}

data class LinkRef(val type: String, val number: Int, val user: String?) : Comparable<LinkRef> {
data class LinkRef(val type: String, val number: Int) : Comparable<LinkRef> {
override fun compareTo(other: LinkRef): Int = compareValuesBy(
this,
other,
{ it.type },
{ it.number },
{ it.user },
)

override fun toString(): String = buildString {
append('[')
append(type)
append(" #")
append(number)
if (user != null) {
append(" @")
append(user)
}
append(']')
}
override fun toString(): String = "[$type #$number]"
}

fun checkBrackets(line: String) {
Expand All @@ -440,7 +429,7 @@ fun checkBrackets(line: String) {
fun updateChangelogLinks(baseUrl: String) {
val file = File(rootDir, "CHANGELOG.md")
val regexStandaloneLink = Regex("\\[([^\\]]+)\\](?![\\(\\[])")
val regexAutoLink = Regex("(Issue|PR) #(\\d+)(?: @([\\w-]+))?")
val regexAutoLink = Regex("(Issue|PR) #(\\d+)")
val links = hashMapOf<LinkRef, String>()
var skipRemaining = false
val changelog = mutableListOf<String>()
Expand All @@ -461,23 +450,16 @@ fun updateChangelogLinks(baseUrl: String) {
val ref = match.groupValues[0]
val type = match.groupValues[1]
val number = match.groupValues[2].toInt()
val user = match.groups[3]?.value

val link = when (type) {
"Issue" -> {
require(user == null) { "$ref should not have a username" }
"$baseUrl/issues/$number"
}
"PR" -> {
require(user != null) { "$ref should have a username" }
"$baseUrl/pull/$number"
}
"Issue" -> "$baseUrl/issues/$number"
"PR" -> "$baseUrl/pull/$number"
else -> throw IllegalArgumentException("Unknown link type: $type")
}

// #0 is used for examples only
if (number != 0) {
links[LinkRef(type, number, user)] = link
links[LinkRef(type, number)] = link
}
}

Expand Down

0 comments on commit a909bd3

Please sign in to comment.