@@ -21,11 +21,6 @@ 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(), " " )
2924
3025kotlin {
3126 jvmToolchain(21 )
@@ -68,7 +63,14 @@ configure<ApplicationExtension> {
6863 isDebuggable = true
6964
7065 // 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+
7172 if (normalizedWorkingBranch.isEmpty() || workingBranch in defaultBranches) {
73+ // default values when branch name could not be determined or is master or dev
7274 applicationIdSuffix = " .debug"
7375 resValue(" string" , " app_name" , " NewPipe Debug" )
7476 } else {
@@ -89,21 +91,6 @@ configure<ApplicationExtension> {
8991 " proguard-rules.pro"
9092 )
9193 }
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- }
10794 }
10895
10996 lint {
0 commit comments