def rebrand_atom_logo(): if system.darwin(): src = ap.prep_path('../resources/logo.icns') dst = ap.prep_path( '../dist/third-party/Atom.app/Contents/Resources/atom.icns') shutil.copy(src, dst) subprocess.run(['touch', ap.prep_path('../dist/third-party/Atom.app')])
def copy_atom_configs (): dst_path = ap.prep_path('../dist/user-config/atom') configs_files = [ '../config/config.cson', '../config/keymap.cson', '../config/snippets.cson', '../config/styles.cson', ] for config in configs_files: shutil.copy(ap.prep_path(config), dst_path)
def link_resources (): with working_directory(ap.prep_path('../dist/bin')): os.makedirs('main/resources', exist_ok=True) for src_path2 in glob('public/luna-studio/resources/*'): dst_path = os.path.join('main/resources', os.path.basename(src_path2)) if os.path.isfile(dst_path): os.remove(dst_path) if os.path.isfile(src_path2): create_symlink_or_copy(dst_path, src_path2)
def link_main_bin (): with working_directory(ap.prep_path('../dist/bin')): os.makedirs('main', exist_ok=True) for src_path in glob('public/luna-studio/*'): dst_path = os.path.join('main', os.path.basename(src_path)) if os.path.isfile(dst_path): os.remove(dst_path) if os.path.isfile(src_path): os.symlink(os.path.relpath(src_path,'main/'), dst_path)
def copy_configs(supervisor,env, windows): config_path = ap.prep_path('../dist/config/') supervisor_path = config_path + '/supervisor' env_path = config_path + '/env' windows_path = config_path + '/windows' dir_util.copy_tree(env, env_path) if system.windows(): dir_util.copy_tree(windows, windows_path) else: dir_util.copy_tree(supervisor, supervisor_path)
#!/usr/bin/env python3 import argparse import os import subprocess import sys sys.path.append(os.getcwd()) import atom_prepare import atom_apm import copy_configs import stack_build app_dir = atom_prepare.prep_path('..') backend_dir = atom_prepare.prep_path('../backend') frontend_dir = atom_prepare.prep_path('../frontend') def build_app(backend_args, frontend_args, runner_args, gui_url, dev_mode=False, dry_run=False, frontend_retries=3): try: build_runner(runner_args, dry_run) build_backend(backend_args, dry_run) build_frontend(frontend_args, gui_url, dev_mode, dry_run, frontend_retries)
def copy_resources(resources): resources_path=ap.prep_path('../dist/bin/public/luna-studio/resources') dir_util.copy_tree(resources, resources_path)
#!/usr/bin/env python3 import atom_prepare as ap import os from common import create_symlink_or_copy from distutils import dir_util from glob import glob import shutil import subprocess import system as system from common import working_directory resources_dir = ap.prep_path('../resources') supervisor_dir = ap.prep_path('../supervisor') windows_dir = ap.prep_path('../windows') env_dir = ap.prep_path('../env') def copy_configs(supervisor,env, windows): config_path = ap.prep_path('../dist/config/') supervisor_path = config_path + '/supervisor' env_path = config_path + '/env' windows_path = config_path + '/windows' dir_util.copy_tree(env, env_path) if system.windows(): dir_util.copy_tree(windows, windows_path) else: dir_util.copy_tree(supervisor, supervisor_path)
#!/usr/bin/env python3 import argparse import os import subprocess import sys sys.path.append(os.getcwd()) import atom_prepare import atom_apm import copy_configs import stack_build app_dir = atom_prepare.prep_path('..') backend_dir = atom_prepare.prep_path('../build-config/backend') frontend_dir = atom_prepare.prep_path('../luna-studio') def build_app(backend_args, frontend_args, runner_args, gui_url, dev_mode=False, dry_run=False, frontend_retries=3): try: build_runner(runner_args, dry_run) build_backend(backend_args, dry_run) build_frontend(frontend_args, gui_url, dev_mode, dry_run, frontend_retries)
def copy_std_lib(): std_lib_path = ap.prep_path( '../build-config/backend/.stack-work') + '/**/stdlib' std_lib_folder = glob(std_lib_path, recursive=True) print(std_lib_folder)
def mv_runner(runner): if system.windows(): runner_src = runner + '/src/' + '/StudioRunner.exe' runner_dst = ap.prep_path( '../dist/bin/public/luna-studio/luna-studio.exe') os.replace(runner_src, runner_dst)
def create_bin_dirs(): for path in ('../dist/bin/private', '../dist/bin/public/luna-studio'): os.makedirs(ap.prep_path(path), exist_ok=True)
#!/usr/bin/env python3 import atom_prepare as ap from glob import glob import os import subprocess import system as system from common import create_symlink_or_copy, working_directory app_dir = ap.prep_path('..') backend_dir = ap.prep_path('../build-config/backend') frontend_dir = ap.prep_path('../luna-studio') runner_dir = ap.prep_path('../runner') def create_bin_dirs(): for path in ('../dist/bin/private', '../dist/bin/public/luna-studio'): os.makedirs(ap.prep_path(path), exist_ok=True) def build_ghcjs(frontend_args, dev_mode): with working_directory(frontend_dir): if dev_mode: subprocess.check_output(['stack', 'build'] + frontend_args) def build_runner(runner_args): with working_directory(runner_dir): print("build runner") runnerPath = runner_dir + '/src/StudioRunner.hs' hostPath = runner_dir + '/src/System/Host.hs'
import platform import requests import zipfile import io import sys import system as system from common import working_directory import stack_build import atom_prepare import re, tempfile ######################################################### # PATHS # ######################################################### third_party_path = ap.prep_path('../dist/third-party/') atom_home_path = ap.prep_path('../dist/user-config/atom') studio_package_name = "luna-studio" studio_atom_source_path = ap.prep_path("../luna-studio/atom") package_config_path = ap.prep_path("../config/packages") packages_path = atom_home_path + '/packages/' dist_package_folder = ap.prep_path('../dist-package') gui_package_path = ap.prep_path('../dist-package/gui.zip') studio_folder = ap.prep_path('../luna-studio/atom') version_file = ap.prep_path('../dist/config/version.txt') logo_ico = ap.prep_path('../resources/logo.ico') logo_png = ap.prep_path('../resources/logo.png') atom_logo = ap.prep_path( '../dist/third-party/atom/usr/share/atom/resources/app/resources/atom.png') paths = {
#!/usr/bin/env python3 import atom_prepare as ap from glob import glob import os import subprocess import system as system from common import create_symlink_or_copy, working_directory app_dir = ap.prep_path('..') backend_dir = ap.prep_path('../backend') frontend_dir = ap.prep_path('../frontend') runner_dir = ap.prep_path('../runner') def create_bin_dirs(): for path in ('../dist/bin/private', '../dist/bin/public/luna-studio'): os.makedirs(ap.prep_path(path), exist_ok=True) def build_ghcjs(frontend_args, dev_mode): with working_directory(frontend_dir): if dev_mode: subprocess.check_output(['stack', 'build'] + frontend_args) def build_runner(runner_args): with working_directory(runner_dir): print("build runner") runnerPath = runner_dir + '/src/StudioRunner.hs' hostPath = runner_dir + '/src/System/Host.hs'