Skip to content

Commit 11c78bb

Browse files
Merge branch 'stage' into ADFA-2880-git-commit-operations
2 parents a9f43ef + 4755d0b commit 11c78bb

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

app/build.gradle.kts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ dependencies {
302302
implementation(projects.idetooltips)
303303
implementation(projects.cvImageToXml)
304304
implementation(projects.composePreview)
305-
implementation(projects.gitCore)
305+
implementation(projects.gitCore)
306306

307307
// This is to build the tooling-api-impl project before the app is built
308308
// So we always copy the latest JAR file to assets
@@ -318,7 +318,7 @@ dependencies {
318318
androidTestImplementation(libs.tests.junit.kts)
319319
androidTestImplementation(libs.tests.androidx.test.runner)
320320
androidTestUtil(libs.tests.orchestrator)
321-
testImplementation(libs.tests.kotlinx.coroutines)
321+
testImplementation(libs.tests.kotlinx.coroutines)
322322

323323
// brotli4j
324324
implementation(libs.brotli4j)
@@ -503,6 +503,21 @@ fun createAssetsZip(arch: String) {
503503

504504
// 4. Set the full command line
505505
commandLine(d8Command)
506+
507+
// Prepend JAVA_HOME/bin to PATH, so that `java` can be resolved
508+
// on systems which don't already have `java` in PATH
509+
val javaHome = System.getProperty("java.home")
510+
if (javaHome.isNotBlank()) {
511+
val javaHomeBin = javaHome + File.separator + "bin"
512+
val currentPath = System.getenv("PATH") ?: ""
513+
var finalPath = javaHomeBin
514+
if (currentPath.isNotBlank()) {
515+
finalPath += File.pathSeparator
516+
finalPath += currentPath
517+
}
518+
519+
environment("PATH", finalPath)
520+
}
506521
}.assertNormalExitValue()
507522

508523
if (!dexOutputFile.exists()) {
@@ -814,9 +829,9 @@ afterEvaluate {
814829
}
815830

816831
dependsOn(bundleLlamaV8Assets)
817-
if (!isCiCd) {
818-
dependsOn("assetsDownloadDebug")
819-
}
832+
if (!isCiCd) {
833+
dependsOn("assetsDownloadDebug")
834+
}
820835
}
821836

822837
tasks.named("assembleV7Debug").configure {
@@ -835,9 +850,9 @@ afterEvaluate {
835850
}
836851

837852
dependsOn(bundleLlamaV7Assets)
838-
if (!isCiCd) {
839-
dependsOn("assetsDownloadDebug")
840-
}
853+
if (!isCiCd) {
854+
dependsOn("assetsDownloadDebug")
855+
}
841856
}
842857
}
843858

0 commit comments

Comments
 (0)