Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/com/kawomi/githugandroid/GitRuntime.kt
This commit is contained in:
@@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "com.kawomi.githugandroid"
|
applicationId = "com.kawomi.githugandroid"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 15
|
versionCode = 16
|
||||||
versionName = "0.1.14"
|
versionName = "0.1.15"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -159,6 +159,14 @@ class GitRepositoryRuntime(private val context: Context) {
|
|||||||
val logResult = runGit(nativeGit, sandbox, listOf("log", "--pretty=format:%h\t%s"))
|
val logResult = runGit(nativeGit, sandbox, listOf("log", "--pretty=format:%h\t%s"))
|
||||||
val branchResult = runGit(nativeGit, sandbox, listOf("branch", "--list"))
|
val branchResult = runGit(nativeGit, sandbox, listOf("branch", "--list"))
|
||||||
val headResult = runGit(nativeGit, sandbox, listOf("branch", "--show-current"))
|
val headResult = runGit(nativeGit, sandbox, listOf("branch", "--show-current"))
|
||||||
|
val commits = if (logResult.exitCode == 0) {
|
||||||
|
logResult.outputLines.filter { it.isNotBlank() }.mapNotNull { line ->
|
||||||
|
val parts = line.split('\t', limit = 2)
|
||||||
|
if (parts.isEmpty()) null else CommitNode(parts[0], parts.getOrElse(1) { "" })
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
return RepoState(
|
return RepoState(
|
||||||
initialized = true,
|
initialized = true,
|
||||||
@@ -171,10 +179,7 @@ class GitRepositoryRuntime(private val context: Context) {
|
|||||||
tracked = tracked,
|
tracked = tracked,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
commits = logResult.outputLines.filter { it.isNotBlank() }.mapNotNull { line ->
|
commits = commits,
|
||||||
val parts = line.split('\t', limit = 2)
|
|
||||||
if (parts.isEmpty()) null else CommitNode(parts[0], parts.getOrElse(1) { "" })
|
|
||||||
},
|
|
||||||
headBranch = headResult.outputLines.firstOrNull()?.ifBlank { null } ?: "master",
|
headBranch = headResult.outputLines.firstOrNull()?.ifBlank { null } ?: "master",
|
||||||
branches = branchResult.outputLines.map { it.removePrefix("*").trim() }.filter { it.isNotBlank() }.associateWith { 0 },
|
branches = branchResult.outputLines.map { it.removePrefix("*").trim() }.filter { it.isNotBlank() }.associateWith { 0 },
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user