Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ jobs:
cache: 'gradle'

- name: Build debug APK and run jvm tests
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
run: ./gradlew assembleContinuous lintContinuous testDebugUnitTest --stacktrace -DskipFormatKtlint

- name: Upload APK
uses: actions/upload-artifact@v7
with:
name: app
path: app/build/outputs/apk/debug/*.apk
path: app/build/outputs/apk/continuous/*.apk

test-android:
runs-on: ubuntu-latest
Expand Down
27 changes: 20 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ plugins {
val gitWorkingBranch = providers.exec {
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
}.standardOutput.asText.map { it.trim() }
val defaultBranches = listOf("master", "dev")
val workingBranch = gitWorkingBranch.getOrElse("")
val normalizedWorkingBranch = workingBranch
.replaceFirst("^[^A-Za-z]+".toRegex(), "")
.replace("[^0-9A-Za-z]+".toRegex(), "")

kotlin {
jvmToolchain(21)
Expand Down Expand Up @@ -63,14 +68,7 @@ configure<ApplicationExtension> {
isDebuggable = true

// suffix the app id and the app name with git branch name
val defaultBranches = listOf("master", "dev")
val workingBranch = gitWorkingBranch.getOrElse("")
val normalizedWorkingBranch = workingBranch
.replaceFirst("^[^A-Za-z]+".toRegex(), "")
.replace("[^0-9A-Za-z]+".toRegex(), "")

if (normalizedWorkingBranch.isEmpty() || workingBranch in defaultBranches) {
// default values when branch name could not be determined or is master or dev
applicationIdSuffix = ".debug"
resValue("string", "app_name", "NewPipe Debug")
} else {
Expand All @@ -91,6 +89,21 @@ configure<ApplicationExtension> {
"proguard-rules.pro"
)
}

register("continuous") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
isDefault = true

// suffix the app id and the app name with git branch name
if (normalizedWorkingBranch.isEmpty() || workingBranch in defaultBranches) {
applicationIdSuffix = ".continuous"
resValue("string", "app_name", "NewPipe Continuous")
} else {
applicationIdSuffix = ".continuous.$normalizedWorkingBranch"
resValue("string", "app_name", "NewPipe $workingBranch")
}
}
Comment thread
theimpulson marked this conversation as resolved.
}

lint {
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
* SPDX-License-Identifier: GPL-3.0-or-later
*/
rootProject.name = "buildSrc"
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "NewPipe"

pluginManagement {
repositories {
Expand Down
Loading