def modify_atom_icon(): if system.windows(): atom = get_path('atom_app') appdata = os.environ.get('APPDATA') winresourcer = os.path.join(appdata,'npm','node_modules','winresourcer','lib','WinResourcer') proc=run_process('node', winresourcer, '--operation=Update', '--exeFile='+atom, '--resourceType=Icongroup', '--resourceName=1', '--resourceFile='+logo_ico) print(proc) elif system.linux(): shutil.copyfile(logo_png, atom_logo)
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)
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' resPath = runner_dir + '/../resources/my.res' if system.windows(): subprocess.check_output(['stack', 'build']) os.system('stack exec ghc -- ' + runnerPath + ' ' + hostPath + ' ' + resPath + ' -optl -mwindows') subprocess.check_output(['stack', 'build'] + runner_args) mv_runner(runner_dir)
def build_backend(backend_args): with working_directory(backend_dir): # subprocess.check_output(['stack', 'build', 'luna-empire', '--test', '--no-run-tests']) sys_opts = ['--ghc-options=-fexternal-interpreter' ] if system.windows() else [] # Note: -fno-omit-interface-pragmas is specific to our backend stack.yaml project. # It adds -fomit-interface-pragmas option that negatively affects performance. # This script wants to create a fully-optimized build, so we need to overwtite the flag. # # TODO: this behaviour should be eventually optional and script should be usable # for building development packages (that also care about build-speed). args = sys_opts + backend_args + [ '--ghc-options=-fno-omit-interface-pragmas' ] subprocess.check_output(['stack', 'build'] + args)
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)