@@ -21,6 +21,11 @@ plugins {
2121val 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
2530kotlin {
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 {
0 commit comments