Skip to content

Commit 8dc1315

Browse files
authored
Merge pull request #13590 from TeamNewPipe/misc
Misc changes for building
2 parents d927f44 + 192dc99 commit 8dc1315

4 files changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ jobs:
5555
cache: 'gradle'
5656

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

6060
- name: Upload APK
6161
uses: actions/upload-artifact@v7
6262
with:
6363
name: app
64-
path: app/build/outputs/apk/debug/*.apk
64+
path: app/build/outputs/apk/continuous/*.apk
6565

6666
test-android:
6767
runs-on: ubuntu-latest

app/build.gradle.kts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ plugins {
2121
val gitWorkingBranch = providers.exec {
2222
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
2323
}.standardOutput.asText.map { it.trim() }
24+
val defaultBranches = listOf("master", "dev")
25+
val workingBranch = gitWorkingBranch.getOrElse("")
26+
val normalizedWorkingBranch = workingBranch
27+
.replaceFirst("^[^A-Za-z]+".toRegex(), "")
28+
.replace("[^0-9A-Za-z]+".toRegex(), "")
2429

2530
kotlin {
2631
jvmToolchain(21)
@@ -63,14 +68,7 @@ configure<ApplicationExtension> {
6368
isDebuggable = true
6469

6570
// suffix the app id and the app name with git branch name
66-
val defaultBranches = listOf("master", "dev")
67-
val workingBranch = gitWorkingBranch.getOrElse("")
68-
val normalizedWorkingBranch = workingBranch
69-
.replaceFirst("^[^A-Za-z]+".toRegex(), "")
70-
.replace("[^0-9A-Za-z]+".toRegex(), "")
71-
7271
if (normalizedWorkingBranch.isEmpty() || workingBranch in defaultBranches) {
73-
// default values when branch name could not be determined or is master or dev
7472
applicationIdSuffix = ".debug"
7573
resValue("string", "app_name", "NewPipe Debug")
7674
} else {
@@ -91,6 +89,21 @@ configure<ApplicationExtension> {
9189
"proguard-rules.pro"
9290
)
9391
}
92+
93+
register("continuous") {
94+
initWith(getByName("release"))
95+
signingConfig = signingConfigs.getByName("debug")
96+
isDefault = true
97+
98+
// suffix the app id and the app name with git branch name
99+
if (normalizedWorkingBranch.isEmpty() || workingBranch in defaultBranches) {
100+
applicationIdSuffix = ".continuous"
101+
resValue("string", "app_name", "NewPipe Continuous")
102+
} else {
103+
applicationIdSuffix = ".continuous.$normalizedWorkingBranch"
104+
resValue("string", "app_name", "NewPipe $workingBranch")
105+
}
106+
}
94107
}
95108

96109
lint {

buildSrc/settings.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 NewPipe e.V. <https://newpipe-ev.de>
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
5+
rootProject.name = "buildSrc"

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
55
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
6+
rootProject.name = "NewPipe"
67

78
pluginManagement {
89
repositories {

0 commit comments

Comments
 (0)