From 9c2b85ad5890030b154d832ff17b620f32a0ffc4 Mon Sep 17 00:00:00 2001 From: Edward Chen <18449977+edgchen1@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:29:02 -0700 Subject: [PATCH] Fix Android build on Windows (#21304) - Pass a list of files instead of path separator-delimited string to project.files(). See this issue: https://github.com/gradle/gradle/issues/19817 - Check for host (instead of target) being Windows when using fallback patch program. --- cmake/CMakeLists.txt | 2 +- java/build-android.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e2fc3da9de35e..fb9f2f8f32b34 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -551,7 +551,7 @@ if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android") endif() find_package(Patch) -if (WIN32 AND NOT Patch_FOUND) +if (CMAKE_HOST_WIN32 AND NOT Patch_FOUND) # work around CI machines missing patch from the git install by falling back to the binary in this repo. # replicate what happens in https://github.com/Kitware/CMake/blob/master/Modules/FindPatch.cmake but without # the hardcoded suffixes in the path to the patch binary. diff --git a/java/build-android.gradle b/java/build-android.gradle index afbad9f03d08d..fd22fa27e8db9 100644 --- a/java/build-android.gradle +++ b/java/build-android.gradle @@ -105,7 +105,7 @@ task sourcesJar(type: Jar) { task javadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += project.files(android.getBootClasspath()) } task javadocJar(type: Jar, dependsOn: javadoc) {