diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index b38670a9..953a5745 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -31,22 +31,39 @@ jobs:
run: |
git config user.name 'theoplayer-bot[bot]'
git config user.email '873105+theoplayer-bot[bot]@users.noreply.github.com'
+ - name: Setup Java
+ uses: actions/setup-java@v5
+ with:
+ distribution: temurin
+ java-version: 21
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v6
+ with:
+ # https://github.com/gradle/actions/blob/v6.0.0/README.md#licensing-notice
+ cache-disabled: true
- name: Bump version
shell: bash
+ # language=bash
run: |
- node ./scripts/set_version.js ${{ inputs.version }}
+ yq -i '.version="'"$VERSION"'"' --properties-separator="=" ./gradle.properties
+ ./gradlew :patchChangelog
+ env:
+ VERSION: ${{ inputs.version }}
- name: Push to release branch
shell: bash
+ # language=bash
run: |
git commit -a -m ${{ inputs.version }}
git push origin "HEAD:release/${{ inputs.version }}"
- name: Create pull request
shell: bash
+ # language=bash
run: |
+ changelog=$(./gradlew --no-daemon --console=plain --quiet :getChangelog --no-links)
gh pr create \
--base main \
--head "release/${{ inputs.version }}" \
--title "Release ${{ inputs.version }}" \
- --body "$(node ./scripts/github_changelog.js ${{ inputs.version }})"
+ --body "$changelog"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 07ec4dfb..0175c819 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -52,16 +52,20 @@ jobs:
REPOSILITE_PASSWORD: ${{ secrets.REPOSILITE_PASSWORD }}
- name: Get version
shell: bash
+ # language=bash
run: |
- echo "version=$(./gradlew :ui:properties --no-daemon --console=plain --quiet | awk '/^version:/ {print $2}')" >> "$GITHUB_ENV"
+ echo "version=$(yq '.version' ./gradle.properties)" >> "$GITHUB_ENV"
- name: Push tag
+ # language=bash
run: |
git tag "v$version" -m "$version"
git push origin "v$version"
- name: Create GitHub release
+ # language=bash
run: |
+ notes=$(./gradlew --no-daemon --console=plain --quiet :getChangelog --no-header --project-version="$version")
gh release create "v$version" --verify-tag --latest \
--title "$version" \
- --notes "$(node ./scripts/github_changelog.js $version)"
+ --notes "$notes"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
new file mode 100644
index 00000000..69b5ac78
--- /dev/null
+++ b/.idea/deploymentTargetSelector.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 00000000..efd53679
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/markdown.xml b/.idea/markdown.xml
new file mode 100644
index 00000000..b1f3d014
--- /dev/null
+++ b/.idea/markdown.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 00000000..5bd6771a
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c82cbbd0..f0ffff47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,78 +9,80 @@
> - 🏠 Internal
> - 💅 Polish
-## v1.14.1 (2026-04-20)
+## [Unreleased]
+
+## [1.14.1] (2026-04-20)
* 🐛 Fixed the menu background disappearing after opening. ([#100](https://github.com/THEOplayer/android-ui/pull/100))
-## v1.14.0 (2026-04-20)
+## [1.14.0] (2026-04-20)
* 🚀 Added support for THEOplayer 11.0. ([#98](https://github.com/THEOplayer/android-ui/pull/98))
* 🚀 Updated to Jetpack Compose version 1.10.6 ([BOM](https://developer.android.com/jetpack/compose/bom) 2026.03.01).
-## v1.13.4 (2026-04-07)
+## [1.13.4] (2026-04-07)
* 🐛 The language menu now prefers to show CEA-608/708 closed caption tracks with their localized language name (if available) instead of their language code (e.g. "en") or channel number (e.g. "CC1"). ([#84](https://github.com/THEOplayer/android-ui/pull/84), [#95](https://github.com/THEOplayer/android-ui/pull/95))
-## v1.13.3 (2026-03-23)
+## [1.13.3] (2026-03-23)
* 🐛 Changed the minimum supported THEOplayer version to 7.6.0. ([#85](https://github.com/THEOplayer/android-ui/pull/85))
* This was effectively already the minimum version as of Open Video UI for Android version 1.7.2, but it wasn't noticed until now.
* Future versions will be properly tested with the minimum supported THEOplayer version to avoid similar compatibility issues.
* 🐛 `Player.pictureInPicture` now also checks whether the `Activity` itself is in picture-in-picture mode, in case the activity has custom picture-in-picture logic (that does not use THEOplayer's `PiPManager` API). ([#89](https://github.com/THEOplayer/android-ui/pull/89/))
-## v1.13.2 (2026-03-03)
+## [1.13.2] (2026-03-03)
* 🐛 Fixed `PictureInPictureButton` to only be shown when the backing `THEOplayerView` has a valid `PiPConfiguration`. ([#81](https://github.com/THEOplayer/android-ui/pull/81))
-## v1.13.1 (2026-01-05)
+## [1.13.1] (2026-01-05)
* 🐛 Changed THEOplayer to be an `api` dependency in Gradle. ([#76](https://github.com/THEOplayer/android-ui/pull/76))
* 🐛 The alpha value of the `UIController`'s background color is now correctly preserved. ([#78](https://github.com/THEOplayer/android-ui/issues/78), [#79](https://github.com/THEOplayer/android-ui/pull/79))
-## v1.13.0 (2025-09-12)
+## [1.13.0] (2025-09-12)
* 💥 The `minSdk` is now API 23 (Android 6.0 "Marshmallow"), to align with THEOplayer 10.0. ([#74](https://github.com/THEOplayer/android-ui/pull/74))
* 💥 Open Video UI for Android is now compiled using the Kotlin 2 compiler. Update your app to use Kotlin Gradle Plugin 2.0.0 or newer. ([#74](https://github.com/THEOplayer/android-ui/pull/74))
* 💥 Updated to Jetpack Compose version 1.9.0 ([BOM](https://developer.android.com/jetpack/compose/bom) 2025.08.01).
* 🚀 Added support for THEOplayer 10.0. ([#74](https://github.com/THEOplayer/android-ui/pull/74))
-## v1.12.0 (2025-09-08)
+## [1.12.0] (2025-09-08)
* 🚀 Added `PictureInPictureButton`. ([#19](https://github.com/THEOplayer/android-ui/issues/19), [#70](https://github.com/THEOplayer/android-ui/pull/70))
* 🚀 The default UI now shows a minimal set of controls while playing an ad. ([#71](https://github.com/THEOplayer/android-ui/pull/71))
* 🚀 `UIController` no longer hides all controls while playing an ad. ([#71](https://github.com/THEOplayer/android-ui/pull/71))
-## v1.11.1 (2025-08-01)
+## [1.11.1] (2025-08-01)
* 🐛 Fixed clicking on overlays from OptiView Ads not working. ([#68](https://github.com/THEOplayer/android-ui/pull/68))
-## v1.11.0 (2025-04-29)
+## [1.11.0] (2025-04-29)
* 💥 Bumped `compileSdk` to API 35 (Android 15).
* 🚀 Added localization support.
* See `res/values/strings.xml` for the full list of translatable strings, which you can override in your app's `strings.xml`.
* For more information, see [Localize your app on Android Developers](https://developer.android.com/guide/topics/resources/localization).
-## v1.10.0 (2025-04-02)
+## [1.10.0] (2025-04-02)
* 🚀 Added support for THEOplayer 9.0. ([#61](https://github.com/THEOplayer/android-ui/pull/61))
-## v1.9.4 (2024-12-18)
+## [1.9.4] (2024-12-18)
* 🐛 Revert to `compileSdk` 34. ([#56](https://github.com/THEOplayer/android-ui/pull/56/))
-## v1.9.3 (2024-12-17)
+## [1.9.3] (2024-12-17)
* 💥 Updated to Jetpack Compose version 1.7.5 ([BOM](https://developer.android.com/jetpack/compose/bom) 2024.11.00).
* 🐛 Fix `SeekBar` not working for livestreams with a large `player.seekable.start(0)`,
such as MPEG-DASH streams that use Unix timestamps for their MPD timeline. ([#52](https://github.com/THEOplayer/android-ui/pull/52))
-## v1.9.2 (2024-10-15)
+## [1.9.2] (2024-10-15)
* 🐛 Fix `Player.cast` not available before first source change.
-## v1.9.1 (2024-10-01)
+## [1.9.1] (2024-10-01)
* 🐛 Fix `DurationDisplay` to show the time of the live point when playing a live or DVR stream.
* 🐛 Fix `CurrentTimeDisplay` to show the time offset to the live point when playing a live or DVR stream with `showRemaining = true`.
@@ -88,91 +90,91 @@
* 💅 Changed `DefaultUi` to show the time offset to the live point when playing a DVR stream.
* 💅 Changed `LanguageMenuButton` to automatically hide itself when there are no alternative audio or subtitle tracks to select.
-## v1.9.0 (2024-09-10)
+## [1.9.0] (2024-09-10)
* 💥 Updated to Jetpack Compose version 1.7.0 ([BOM](https://developer.android.com/jetpack/compose/bom) 2024.09.00).
* 💥 Changed `colors` parameter in `IconButton` and `LiveButton` to be an `IconButtonColors`.
* 🚀 Added support for Android Lollipop (API 21), to align with the THEOplayer Android SDK.
* 🚀 Added `rememberPlayer(THEOplayerView)` to create a `Player` wrapping an existing `THEOplayerView`.
-## v1.8.0 (2024-09-06)
+## [1.8.0] (2024-09-06)
* 🚀 Added support for THEOplayer 8.0. ([#37](https://github.com/THEOplayer/android-ui/pull/37))
-## v1.7.4 (2024-09-02)
+## [1.7.4] (2024-09-02)
* 🐛 Fixed a crash when playing a live stream on Chromecast.
-## v1.7.3 (2024-09-02)
+## [1.7.3] (2024-09-02)
* 🐛 Fixed the Chromecast button never appearing. ([#34](https://github.com/THEOplayer/android-ui/pull/34))
* 🐛 Fixed the seek bar being disabled while casting. ([#35](https://github.com/THEOplayer/android-ui/issues/35), [#36](https://github.com/THEOplayer/android-ui/pull/36))
* 📝 Added a ["Setting up Chromecast" guide](./docs/guides/chromecast.md).
-## v1.7.2 (2024-08-28)
+## [1.7.2] (2024-08-28)
* 🐛 Fixed ad clickthrough not working. ([#33](https://github.com/THEOplayer/android-ui/pull/33))
* 🐛 Fixed UI not re-appearing after playing an ad. ([#33](https://github.com/THEOplayer/android-ui/pull/33))
* 🐛 Fixed exiting fullscreen disabling [edge-to-edge display](https://developer.android.com/develop/ui/views/layout/edge-to-edge-manually). ([#32](https://github.com/THEOplayer/android-ui/pull/32))
-## v1.7.1 (2024-08-20)
+## [1.7.1] (2024-08-20)
-* 🐛 Disable system gestures on the `SeekBar` component. ([#30](https://github.com/THEOplayer/android-ui/pull/30))
+* 🐛 Disable system gestures on the `SeekBar` component. ([#30](https://github.com/THEOplayer/android-ui/pull/30))
-## v1.7.0 (2024-08-12)
+## [1.7.0] (2024-08-12)
* 💥 Updated to Jetpack Compose version 1.6.8 ([BOM](https://developer.android.com/jetpack/compose/bom) 2024.06.00).
* 🚀 Added basic support for advertisements. (Requires THEOplayer SDK version 7.10.0 or higher.)
-## v1.6.0 (2024-04-16)
+## [1.6.0] (2024-04-16)
* 🚀 Added support for THEOplayer Android SDK version 7.
-## v1.5.0 (2024-02-21)
+## [1.5.0] (2024-02-21)
* 💥 Updated to Jetpack Compose version 1.6.1 ([BOM](https://developer.android.com/jetpack/compose/bom) 2024.02.00).
* 🐛 Fixed dragging the `SeekBar` when
using [Compose Material 3 version 1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-material3#1.2.0)
or higher. ([#24](https://github.com/THEOplayer/android-ui/issues/24))
-## v1.4.0 (2023-11-27)
+## [1.4.0] (2023-11-27)
* 💥 Updated to Jetpack Compose version 1.5.4 ([BOM](https://developer.android.com/jetpack/compose/bom) 2023.10.01).
* 💅 Renamed project to "THEOplayer Open Video UI for Android".
-## v1.3.4 (2023-10-17)
+## [1.3.4] (2023-10-17)
* 🚀 Allow THEOplayer Android SDK 6.
-## v1.3.3 (2023-07-13)
+## [1.3.3] (2023-07-13)
* 💅 `UIController` now sizes itself to match the video's aspect ratio, except if this were to
conflict with a different size constraint (such as `Modifier.fillMaxSize()`).
-## v1.3.2 (2023-07-13)
+## [1.3.2] (2023-07-13)
* 🏠 Publish to THEOplayer's own Maven repository.
-## v1.3.1 (2023-06-30)
+## [1.3.1] (2023-06-30)
* 🚀 Added `Player.source`, `.videoWidth` and `.videoHeight` properties.
* 🚀 Added `Player.play()` and `.pause()` shortcut methods.
* 🐛 Fixed player not following device rotation while fullscreen.
* 💅 When autoplaying a new video, the UI now starts out as hidden.
-## v1.3.0 (2023-06-29)
+## [1.3.0] (2023-06-29)
* 🚀 Added `THEOplayerTheme.playerAnimations` to control the animation settings of the various UI components.
* 🐛 Fix consuming apps unable to install different version of the THEOplayer Android SDK.
-## v1.2.0 (2023-06-28)
+## [1.2.0] (2023-06-28)
* 💥 Renamed `PlayerState` to `Player`.
* 🚀 Added overloads to `DefaultUI` and `UIController` that accept a `Player`.
This allows constructing a player instance in advance, and even moving it between custom UIs when recomposing.
* 🚀 Added `UIControllerScope.player` as an non-null alternative to `Player.current`.
-## v1.1.0 (2023-06-27)
+## [1.1.0] (2023-06-27)
* 💥 Update to THEOplayer Android SDK 5.
To migrate, switch to `com.theoplayer.theoplayer-sdk-android:core` in your Gradle dependencies.
@@ -185,6 +187,41 @@
```
* 🚀 Added a `UIController` overload which accepts a `THEOplayerView` directly.
-## v1.0.0 (2023-04-05)
+## [1.0.0] (2023-04-05)
* 🚀 Initial release.
+
+[Unreleased]: https://github.com/THEOplayer/android-ui/compare/v1.14.1...HEAD
+[1.14.1]: https://github.com/THEOplayer/android-ui/compare/v1.14.0...v1.14.1
+[1.14.0]: https://github.com/THEOplayer/android-ui/compare/v1.13.4...v1.14.0
+[1.13.4]: https://github.com/THEOplayer/android-ui/compare/v1.13.3...v1.13.4
+[1.13.3]: https://github.com/THEOplayer/android-ui/compare/v1.13.2...v1.13.3
+[1.13.2]: https://github.com/THEOplayer/android-ui/compare/v1.13.1...v1.13.2
+[1.13.1]: https://github.com/THEOplayer/android-ui/compare/v1.13.0...v1.13.1
+[1.13.0]: https://github.com/THEOplayer/android-ui/compare/v1.12.0...v1.13.0
+[1.12.0]: https://github.com/THEOplayer/android-ui/compare/v1.11.1...v1.12.0
+[1.11.1]: https://github.com/THEOplayer/android-ui/compare/v1.11.0...v1.11.1
+[1.11.0]: https://github.com/THEOplayer/android-ui/compare/v1.10.0...v1.11.0
+[1.10.0]: https://github.com/THEOplayer/android-ui/compare/v1.9.4...v1.10.0
+[1.9.4]: https://github.com/THEOplayer/android-ui/compare/v1.9.3...v1.9.4
+[1.9.3]: https://github.com/THEOplayer/android-ui/compare/v1.9.2...v1.9.3
+[1.9.2]: https://github.com/THEOplayer/android-ui/compare/v1.9.1...v1.9.2
+[1.9.1]: https://github.com/THEOplayer/android-ui/compare/v1.9.0...v1.9.1
+[1.9.0]: https://github.com/THEOplayer/android-ui/compare/v1.8.0...v1.9.0
+[1.8.0]: https://github.com/THEOplayer/android-ui/compare/v1.7.4...v1.8.0
+[1.7.4]: https://github.com/THEOplayer/android-ui/compare/v1.7.3...v1.7.4
+[1.7.3]: https://github.com/THEOplayer/android-ui/compare/v1.7.2...v1.7.3
+[1.7.2]: https://github.com/THEOplayer/android-ui/compare/v1.7.1...v1.7.2
+[1.7.1]: https://github.com/THEOplayer/android-ui/compare/v1.7.0...v1.7.1
+[1.7.0]: https://github.com/THEOplayer/android-ui/compare/v1.6.0...v1.7.0
+[1.6.0]: https://github.com/THEOplayer/android-ui/compare/v1.5.0...v1.6.0
+[1.5.0]: https://github.com/THEOplayer/android-ui/compare/v1.4.0...v1.5.0
+[1.4.0]: https://github.com/THEOplayer/android-ui/compare/v1.3.4...v1.4.0
+[1.3.4]: https://github.com/THEOplayer/android-ui/compare/v1.3.3...v1.3.4
+[1.3.3]: https://github.com/THEOplayer/android-ui/compare/v1.3.2...v1.3.3
+[1.3.2]: https://github.com/THEOplayer/android-ui/compare/v1.3.1...v1.3.2
+[1.3.1]: https://github.com/THEOplayer/android-ui/compare/v1.3.0...v1.3.1
+[1.3.0]: https://github.com/THEOplayer/android-ui/compare/v1.2.0...v1.3.0
+[1.2.0]: https://github.com/THEOplayer/android-ui/compare/v1.1.0...v1.2.0
+[1.1.0]: https://github.com/THEOplayer/android-ui/compare/v1.0.0...v1.1.0
+[1.0.0]: https://github.com/THEOplayer/android-ui/commits/v1.0.0
diff --git a/build.gradle.kts b/build.gradle.kts
index 5ec283a6..a88d168e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,3 +1,5 @@
+import org.jetbrains.changelog.date
+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
@@ -15,4 +17,30 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.dokka) apply false
+ alias(libs.plugins.changelog)
+}
+
+changelog {
+ version = project.version.toString()
+ path = file("CHANGELOG.md").canonicalPath
+ header = provider { "${version.get()} (${date()})" }
+ headerParserRegex = """(\d+\.\d+\.\d+)""".toRegex()
+ introduction =
+ """
+ > **Tags:**
+ > - 💥 Breaking Change
+ > - 🚀 New Feature
+ > - 🐛 Bug Fix
+ > - 👎 Deprecation
+ > - 📝 Documentation
+ > - 🏠 Internal
+ > - 💅 Polish
+ """.trimIndent()
+ itemPrefix = "*"
+ keepUnreleasedSection = true
+ unreleasedTerm = "Unreleased"
+ groups = listOf()
+ lineSeparator = "\n"
+ combinePreReleases = true
+ repositoryUrl = "https://github.com/THEOplayer/android-ui"
}
diff --git a/gradle.properties b/gradle.properties
index 9ec8a235..447bf4e0 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,6 +7,11 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+org.gradle.configuration-cache=true
+
+# Enable Dokka v2
+org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
+
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -15,15 +20,15 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
-# Kotlin code style for this project: "official" or "obsolete":
-kotlin.code.style=official
+
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonFinalResIds=true
-org.gradle.configuration-cache=true
-# Enable Dokka v2
-org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
+
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
+
# The version of the THEOplayer Open Video UI for Android.
version=1.14.1
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index feefc378..9df13bfa 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -18,6 +18,7 @@ androidx-espresso = "3.7.0"
androidx-mediarouter = "1.8.1"
desugar-jdk-libs = "2.1.5"
dokka = "2.2.0"
+changelog = "2.5.0"
theoplayer = { prefer = "11.+", strictly = "[7.6.0, 12.0)" }
theoplayer-compile = { prefer = "11.+", strictly = "[10.13.0, 12.0)" }
theoplayer-min = { strictly = "7.6.0" }
@@ -65,3 +66,4 @@ android-library = { id = "com.android.library", version.ref = "gradle" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc" }
+changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
diff --git a/scripts/github_changelog.js b/scripts/github_changelog.js
deleted file mode 100755
index e94dbb77..00000000
--- a/scripts/github_changelog.js
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env node
-const fs = require("node:fs");
-const path = require("node:path");
-const version = process.argv[2];
-if (!version) {
- console.error("Missing required argument: version");
- process.exit(1);
-}
-
-// Find block with current version
-const changelogPath = path.resolve(__dirname, "../CHANGELOG.md");
-const changelog = fs.readFileSync(changelogPath, "utf-8");
-const headingStart = "## ";
-const block = changelog
- .split(headingStart)
- .find((block) => block.startsWith(`v${version}`))
- .trim();
-let lines = block.split("\n");
-// Remove version heading
-lines.splice(0, 1);
-
-console.log(lines.join("\n").trim());
diff --git a/scripts/set_version.js b/scripts/set_version.js
deleted file mode 100755
index af77b902..00000000
--- a/scripts/set_version.js
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env node
-const fs = require("node:fs");
-const path = require("node:path");
-const version = process.argv[2];
-if (!version) {
- console.error("Missing required argument: version");
- process.exit(1);
-}
-
-// Update "version=1.2.3" in gradle.properties
-const gradlePropertiesPath = path.resolve(__dirname, "../gradle.properties");
-let gradleProperties = fs.readFileSync(gradlePropertiesPath, "utf8");
-gradleProperties = gradleProperties.replace(
- /^version=.+$/m,
- `version=${version}`
-);
-fs.writeFileSync(gradlePropertiesPath, gradleProperties);
-
-// Update heading in CHANGELOG.md
-const changelogPath = path.resolve(__dirname, "../CHANGELOG.md");
-let changelog = fs.readFileSync(changelogPath, "utf8");
-const now = new Date();
-const today = `${now.getFullYear()}-${(now.getMonth() + 1)
- .toString()
- .padStart(2, "0")}-${now.getDate().toString().padStart(2, "0")}`;
-changelog = changelog.replace(
- /^## Unreleased$/m,
- `## v${version} (${today})`
-);
-fs.writeFileSync(changelogPath, changelog);