|
|
@@ -513,7 +513,9 @@ class build_apps(setuptools.Command):
|
|
|
else: # e.g. x86, x86_64, mips, mips64
|
|
|
suffix = '_' + abi.replace('-', '_')
|
|
|
|
|
|
- self.build_binaries(lib_dir, platform + suffix)
|
|
|
+ # We end up copying the data multiple times to the same
|
|
|
+ # directory, but that's probably fine for now.
|
|
|
+ self.build_binaries(platform + suffix, lib_dir, data_dir)
|
|
|
|
|
|
# Write out the icons to the res directory.
|
|
|
for appname, icon in self.icon_objects.items():
|
|
|
@@ -532,13 +534,13 @@ class build_apps(setuptools.Command):
|
|
|
if icon.getLargestSize() >= 192:
|
|
|
icon.writeSize(192, os.path.join(res_dir, 'mipmap-xxxhdpi-v4', basename))
|
|
|
|
|
|
- self.build_data(data_dir, platform)
|
|
|
+ self.build_assets(platform, data_dir)
|
|
|
|
|
|
# Generate an AndroidManifest.xml
|
|
|
self.generate_android_manifest(os.path.join(build_dir, 'AndroidManifest.xml'))
|
|
|
else:
|
|
|
- self.build_binaries(build_dir, platform)
|
|
|
- self.build_data(build_dir, platform)
|
|
|
+ self.build_binaries(platform, build_dir, build_dir)
|
|
|
+ self.build_assets(platform, build_dir)
|
|
|
|
|
|
# Bundle into an .app on macOS
|
|
|
if self.macos_main_app and 'macosx' in platform:
|
|
|
@@ -750,7 +752,7 @@ class build_apps(setuptools.Command):
|
|
|
with open(path, 'wb') as fh:
|
|
|
tree.write(fh, encoding='utf-8', xml_declaration=True)
|
|
|
|
|
|
- def build_binaries(self, binary_dir, platform):
|
|
|
+ def build_binaries(self, platform, binary_dir, data_dir=None):
|
|
|
""" Builds the binary data for the given platform. """
|
|
|
|
|
|
use_wheels = True
|
|
|
@@ -1121,6 +1123,9 @@ class build_apps(setuptools.Command):
|
|
|
os.path.join(binary_dir, '..', '..', 'classes.dex'))
|
|
|
|
|
|
# Extract any other data files from dependency packages.
|
|
|
+ if data_dir is None:
|
|
|
+ return
|
|
|
+
|
|
|
for module, datadesc in self.package_data_dirs.items():
|
|
|
if module not in freezer_modules:
|
|
|
continue
|
|
|
@@ -1161,11 +1166,11 @@ class build_apps(setuptools.Command):
|
|
|
else:
|
|
|
self.copy(source_path, target_path)
|
|
|
|
|
|
- def build_data(self, data_dir, platform):
|
|
|
+ def build_assets(self, platform, data_dir):
|
|
|
""" Builds the data files for the given platform. """
|
|
|
|
|
|
# Copy Game Files
|
|
|
- self.announce('Copying game files for platform: {}'.format(platform), distutils.log.INFO)
|
|
|
+ self.announce('Copying assets for platform: {}'.format(platform), distutils.log.INFO)
|
|
|
ignore_copy_list = [
|
|
|
'**/__pycache__/**',
|
|
|
'**/*.pyc',
|