def reload(unhandled_args): ''' Run reload module command ''' if not os.path.isdir(defaults.SRC_DIR): raise ForgeError( 'Source folder "{src}" does not exist - have you run {prog} create yet?'.format( src=defaults.SRC_DIR, prog=ENTRY_POINT_NAME, ) ) try: generate_dynamic = forge_build.import_generate_dynamic() except ForgeError: # don't have generate_dynamic available yet raise ForgeError("Unable to use reload until a build has completed") build_to_run = forge_build.create_build( "development", targets=[], ) generate_dynamic.reload.run_command( build_to_run, unhandled_args, )
def migrate(unhandled_args): ''' Migrate the app to the next major platform (if possible) ''' if not os.path.isdir(defaults.SRC_DIR): raise ForgeError( 'Source folder "{src}" does not exist - have you run {prog} create yet?'.format( src=defaults.SRC_DIR, prog=ENTRY_POINT_NAME, ) ) try: generate_dynamic = forge_build.import_generate_dynamic() except ForgeError: # don't have generate_dynamic available yet raise ForgeError("Unable to migrate until a build has completed") build_to_run = forge_build.create_build( "development", targets=[], extra_args=unhandled_args, ) generate_dynamic.customer_goals.migrate_app( generate_dynamic, build_to_run, )
def check(unhandled_args): ''' Run basic linting on project JS to save the user some trouble. ''' if not os.path.isdir(defaults.SRC_DIR): raise ForgeError( 'Source folder "{src}" does not exist - have you run {prog} create yet?'.format( src=defaults.SRC_DIR, prog=ENTRY_POINT_NAME, ) ) try: generate_dynamic = forge_build.import_generate_dynamic() except ForgeError: # don't have generate_dynamic available yet LOG.info("Unable to check local settings until a build has completed") return build_to_run = forge_build.create_build( "development", targets=[], extra_args=unhandled_args, ) generate_dynamic.customer_goals.check_settings( generate_dynamic, build_to_run, )
def all(self, target_dir, user_dir, extra_args, config, target): """Re-create all local files in built targets :param target_dir: the parent directory of the per-platform builds :param user_dir: the directory holding user's code """ generate_dynamic = import_generate_dynamic() build_to_run = create_build(target_dir, config=config, extra_args=extra_args, targets=[target]) generate_dynamic.customer_goals.generate_app_from_template( generate_module=generate_dynamic, build_to_run=build_to_run )
def command_run(target=None): import forge.build as forge_build import generate as generate_dynamic build_type_dir = 'development' build_to_run = forge_build.create_build( build_type_dir, targets=[target], generate_dynamic=generate_dynamic, ) generate_dynamic.customer_goals.run_app(generate_module=generate_dynamic, build_to_run=build_to_run)
def package(unhandled_args): #TODO: ensure dev build has been done first (probably lower down?) generate_dynamic = forge_build.import_generate_dynamic() build_type_dir = 'development' build_to_run = forge_build.create_build( build_type_dir, targets=[forge.settings['platform']], extra_args=unhandled_args, ) generate_dynamic.customer_goals.package_app( generate_module=generate_dynamic, build_to_run=build_to_run, )
def command_run(target=None): import forge.build as forge_build import generate as generate_dynamic build_type_dir = 'development' build_to_run = forge_build.create_build( build_type_dir, targets=[target], generate_dynamic=generate_dynamic, ) generate_dynamic.customer_goals.run_app( generate_module=generate_dynamic, build_to_run=build_to_run )
def run(unhandled_args): _check_working_directory_is_safe() build_type_dir = 'development' _assert_have_development_folder() _assert_have_target_folder(build_type_dir, forge.settings['platform']) generate_dynamic = forge_build.import_generate_dynamic() build_to_run = forge_build.create_build( build_type_dir, targets=[forge.settings['platform']], extra_args=unhandled_args, ) generate_dynamic.customer_goals.run_app( generate_module=generate_dynamic, build_to_run=build_to_run, )