Skip to content

Commit

Permalink
qt6: don't copy entire build tree to dist, use select set of include …
Browse files Browse the repository at this point in the history
…patterns.
  • Loading branch information
accumulator committed Dec 29, 2023
1 parent 01c6068 commit f534fe9
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions pythonforandroid/bootstraps/qt6/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,35 @@ def assemble_distribution(self):
info_main('# Creating Android project from build and {} bootstrap'.format(
self.name))

info('This currently just copies the build stuff straight from the build dir.')
shprint(sh.rm, '-rf', self.dist_dir)
shprint(sh.cp, '-r', self.build_dir, self.dist_dir)
shprint(sh.mkdir, '-p', self.dist_dir)

file_include_patterns = [
('*', False),
('jni/*', False),
('jni/application/**', True),
('src/**', True),
('templates/**', True),
('gradle/**', True),
('**/*.so', True),
('**/qmldir', True),
]

with current_directory(self.dist_dir):
with open('bootstrap_distfiles.txt', 'w') as fileh:
for pattern, recurse in file_include_patterns:
filenames = glob.glob(pattern, root_dir=self.build_dir, recursive=recurse)
for filename in filenames:
fileh.write(f'{filename}\n')
info(f'pattern {pattern}, recurse={recurse} yielded {len(filenames)} items')

shprint(sh.rsync, '--files-from=bootstrap_distfiles.txt',
self.build_dir, '.')

with current_directory(self.dist_dir):
with open('local.properties', 'w') as fileh:
fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))

with current_directory(self.dist_dir):
info('Copying python distribution')

# self.distribute_aars(arch)
Expand Down

0 comments on commit f534fe9

Please sign in to comment.