mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
deploy-ng: Add user_options and finalize_options to build_apps
This commit is contained in:
parent
44a4d18a8e
commit
56ebf981df
@ -12,6 +12,7 @@ import io
|
|||||||
import distutils.core
|
import distutils.core
|
||||||
import distutils.dir_util
|
import distutils.dir_util
|
||||||
import distutils.file_util
|
import distutils.file_util
|
||||||
|
import distutils.log
|
||||||
|
|
||||||
from . import FreezeTool
|
from . import FreezeTool
|
||||||
from . import pefile
|
from . import pefile
|
||||||
@ -24,7 +25,10 @@ if 'basestring' not in globals():
|
|||||||
|
|
||||||
class build_apps(distutils.core.Command):
|
class build_apps(distutils.core.Command):
|
||||||
description = 'build Panda3D applications'
|
description = 'build Panda3D applications'
|
||||||
user_options = [] # TODO
|
user_options = [
|
||||||
|
('build-base', None, 'directory to build applications in'),
|
||||||
|
('requirements-path', None, 'path to requirements.txt file for pip'),
|
||||||
|
]
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
self.build_base = os.path.join(os.getcwd(), 'build')
|
self.build_base = os.path.join(os.getcwd(), 'build')
|
||||||
@ -55,8 +59,14 @@ class build_apps(distutils.core.Command):
|
|||||||
return zip
|
return zip
|
||||||
|
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
# TODO
|
for path in self.copy_paths:
|
||||||
pass
|
if isinstance(path, basestring):
|
||||||
|
src = path
|
||||||
|
else:
|
||||||
|
src, _ = path
|
||||||
|
assert os.path.exists(src), 'Copy path source does not exist: {}'.format(src)
|
||||||
|
assert self.deploy_platforms, 'At least one deploy platform must be defined'
|
||||||
|
assert os.path.exists(self.requirements_path), 'Requirements.txt path does not exist: {}'.format(self.requirements_path)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not self.deploy_platforms:
|
if not self.deploy_platforms:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user