@@ -24,14 +24,35 @@ def assemble_distribution(self):
2424 info_main ('# Creating Android project from build and {} bootstrap' .format (
2525 self .name ))
2626
27- info ('This currently just copies the build stuff straight from the build dir.' )
2827 shprint (sh .rm , '-rf' , self .dist_dir )
29- shprint (sh .cp , '-r' , self .build_dir , self .dist_dir )
28+ shprint (sh .mkdir , '-p' , self .dist_dir )
29+
30+ file_include_patterns = [
31+ ('*' , False ),
32+ ('jni/*' , False ),
33+ ('jni/application/**' , True ),
34+ ('src/**' , True ),
35+ ('templates/**' , True ),
36+ ('gradle/**' , True ),
37+ ('**/*.so' , True ),
38+ ('**/qmldir' , True ),
39+ ]
40+
41+ with current_directory (self .dist_dir ):
42+ with open ('bootstrap_distfiles.txt' , 'w' ) as fileh :
43+ for pattern , recurse in file_include_patterns :
44+ filenames = glob .glob (pattern , root_dir = self .build_dir , recursive = recurse )
45+ for filename in filenames :
46+ fileh .write (f'{ filename } \n ' )
47+ info (f'pattern { pattern } , recurse={ recurse } yielded { len (filenames )} items' )
48+
49+ shprint (sh .rsync , '--files-from=bootstrap_distfiles.txt' ,
50+ self .build_dir , '.' )
51+
3052 with current_directory (self .dist_dir ):
3153 with open ('local.properties' , 'w' ) as fileh :
3254 fileh .write ('sdk.dir={}' .format (self .ctx .sdk_dir ))
3355
34- with current_directory (self .dist_dir ):
3556 info ('Copying python distribution' )
3657
3758 # self.distribute_aars(arch)
0 commit comments