Compile Git for host and Android target platforms
- Rename CrossCompileGitForAndroid.sh to CompileGitForAllTargetPlatforms.sh and support host, Android-only, and all-target modes. - Compile a development-host Git binary at build/host-git/libgit.so for JVM tests. - Route level and sandbox tests through GITHUG_TEST_GIT_BINARY so they exercise the compiled host Git rather than the system Git fallback. - Cross-compile packaged Git binaries for arm64-v8a, armeabi-v7a, x86, and x86_64 Android targets. - Remove the temporary device-bound Pull rebase instrumentation path from the previous debugging attempt.
This commit is contained in:
@@ -31,7 +31,7 @@ class LevelSolutionsTest {
|
||||
@Test
|
||||
fun knownSolutionsCompleteEveryLevel() {
|
||||
val evidence = StringBuilder()
|
||||
val gitBinary = systemGitBinary()
|
||||
val gitBinary = testGitBinary()
|
||||
val runtimeRoot = testSandboxRoot().apply {
|
||||
deleteRecursively()
|
||||
mkdirs()
|
||||
@@ -120,7 +120,16 @@ class LevelSolutionsTest {
|
||||
return File(appDir, "build/test-sandboxes/level-solutions")
|
||||
}
|
||||
|
||||
fun systemGitBinary(): File {
|
||||
fun testGitBinary(): File {
|
||||
System.getenv("GITHUG_TEST_GIT_BINARY")
|
||||
?.takeIf { it.isNotBlank() }
|
||||
?.let { File(it) }
|
||||
?.takeIf { it.exists() && it.canExecute() }
|
||||
?.let { return it }
|
||||
|
||||
val repoHostGit = File(repoRoot(), "build/host-git/libgit.so")
|
||||
if (repoHostGit.exists() && repoHostGit.canExecute()) return repoHostGit
|
||||
|
||||
val candidates = listOf(
|
||||
File("/usr/bin/git"),
|
||||
File("/usr/local/bin/git"),
|
||||
@@ -136,6 +145,11 @@ class LevelSolutionsTest {
|
||||
return File(output)
|
||||
}
|
||||
|
||||
fun repoRoot(): File {
|
||||
val userDir = File(System.getProperty("user.dir") ?: ".")
|
||||
return if (File(userDir, "app/build.gradle.kts").exists()) userDir else userDir.parentFile ?: userDir
|
||||
}
|
||||
|
||||
fun RepoState.describeForEvidence(): String = buildString {
|
||||
appendLine("initialized=$initialized")
|
||||
appendLine("headBranch=$headBranch")
|
||||
|
||||
Reference in New Issue
Block a user