@@ -29,12 +29,25 @@ def get_include_dirs(self, arch):
2929 def prebuild_arch (self , arch ):
3030 # We do not have a folder for each arch on BootstrapNDKRecipe, so we
3131 # need to skip the external deps download if we already have done it.
32- external_deps_dir = os .path .join (
33- self .get_build_dir (arch .arch ), "external"
34- )
35- if not os .path .exists (os .path .join (external_deps_dir , "libwebp" )):
36- with current_directory (external_deps_dir ):
37- shprint (sh .Command ("./download.sh" ))
32+ build_dir = self .get_build_dir (arch .arch )
33+
34+ with open (os .path .join (build_dir , ".gitmodules" ), "r" ) as file :
35+ for section in file .read ().split ('[submodule "' )[1 :]:
36+ line_split = section .split (" = " )
37+ # Parse .gitmodule section
38+ clone_path , url , branch = (
39+ os .path .join (build_dir , line_split [1 ].split ("\n " )[0 ].strip ()),
40+ line_split [2 ].split ("\n " )[0 ].strip (),
41+ line_split [- 1 ].strip ()
42+ )
43+ # Clone if needed
44+ if not os .path .exists (clone_path ) or not os .listdir (clone_path ):
45+ shprint (
46+ sh .git , "clone" , url ,
47+ "--depth" , "1" , "-b" ,
48+ branch , clone_path , "--recursive"
49+ )
50+
3851 super ().prebuild_arch (arch )
3952
4053
0 commit comments