Esempio n. 1
0
def build_deploy_webpage(fips_dir, proj_dir, rebuild):
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/oryol-webpage'.format(ws_dir)
    if rebuild:
        if os.path.isdir(webpage_dir):
            shutil.rmtree(webpage_dir)
    if not os.path.isdir(webpage_dir):
        os.makedirs(webpage_dir)

    # compile samples
    if BuildEmscripten and emscripten.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, EmscConfig)
        project.build(fips_dir, proj_dir, EmscConfig)
    if BuildWasm and emscripten.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, WasmConfig)
        project.build(fips_dir, proj_dir, WasmConfig)

    # export sample assets
    if ExportAssets:
        export_assets(fips_dir, proj_dir, webpage_dir)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN,
                'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 2
0
File: open.py Progetto: rbxnk/fips
def run(fips_dir, proj_dir, args):
    """run the 'open' verb (opens project in IDE)"""
    if not util.is_valid_project_dir(proj_dir):
        log.error('must be run in a project directory')
    proj_name = util.get_project_name_from_dir(proj_dir)
    cfg_name = None
    if len(args) > 0:
        cfg_name = args[0]
    if not cfg_name:
        cfg_name = settings.get(proj_dir, 'config')

    # check the cmake generator of this config
    configs = config.load(fips_dir, proj_dir, cfg_name)
    if configs:
        # hmm, only look at first match, 'open' doesn't
        # make sense with config-patterns
        cfg = configs[0]

        # find build dir, if it doesn't exist, generate it
        build_dir = util.get_build_dir(fips_dir, proj_name, cfg['name'])
        if not os.path.isdir(build_dir):
            log.warn("build dir not found, generating...")
            project.gen(fips_dir, proj_dir, cfg['name'])

        # first check if this is a VSCode project
        if cfg['build_tool'] == 'vscode_cmake':
            vscode.run(proj_dir)
            return
        # check if this is a CLion project
        if cfg['build_tool'] == 'clion':
            clion.run(proj_dir)
            return
        # try to open as Xcode project
        proj = glob.glob(build_dir + '/*.xcodeproj')
        if proj:
            subprocess.call('open "{}"'.format(proj[0]), shell=True)
            return
        # try to open as VS project
        proj = glob.glob(build_dir + '/*.sln')
        if proj:
            subprocess.call('cmd /c start {}'.format(proj[0]), shell=True)
            return
        # try to open as eclipse project
        proj = glob.glob(build_dir + '/.cproject')
        if proj:
            subprocess.call(
                'eclipse -nosplash --launcher.timeout 60 -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import "{}"'
                .format(build_dir),
                shell=True)
            subprocess.call('eclipse', shell=True)
            return

        log.error("don't know how to open a '{}' project in {}".format(
            cfg['generator'], build_dir))
    else:
        log.error("config '{}' not found".format(cfg_name))
Esempio n. 3
0
def run(fips_dir, proj_dir, args) :
    """run the gen verb"""
    if not util.is_valid_project_dir(proj_dir) :
        log.error('must be run in a project directory')
    cfg_name = None
    if len(args) > 0 :
        cfg_name = args[0]
    if cfg_name == None :
        cfg_name = settings.get(proj_dir, 'config')
    project.gen(fips_dir, proj_dir, cfg_name)
Esempio n. 4
0
def run(fips_dir, proj_dir, args) :
    if len(args) > 0 :
        cfg_name = args[0]
        project.gen(fips_dir, proj_dir, cfg_name)
        project.build(fips_dir, proj_dir, cfg_name) 
        success, targets = project.get_target_list(fips_dir, proj_dir, cfg_name)
        if success :
            app_targets = [tgt for tgt in targets if targets[tgt] == 'app']
            for app in app_targets :
                project.run(fips_dir, proj_dir, cfg_name, app, None, None)
    else :
        log.error("config name expected!")
Esempio n. 5
0
File: open.py Progetto: floooh/fips
def run(fips_dir, proj_dir, args) :
    """run the 'open' verb (opens project in IDE)"""
    if not util.is_valid_project_dir(proj_dir) :
        log.error('must be run in a project directory')
    proj_name = util.get_project_name_from_dir(proj_dir)
    cfg_name = None
    if len(args) > 0 :
        cfg_name = args[0]
    if not cfg_name :
        cfg_name = settings.get(proj_dir, 'config')

    # check the cmake generator of this config
    configs = config.load(fips_dir, proj_dir, cfg_name)
    if configs :
        # hmm, only look at first match, 'open' doesn't
        # make sense with config-patterns
        cfg = configs[0]

        # find build dir, if it doesn't exist, generate it
        build_dir = util.get_build_dir(fips_dir, proj_name, cfg['name'])
        if not os.path.isdir(build_dir) :
            log.warn("build dir not found, generating...")
            project.gen(fips_dir, proj_dir, cfg['name'])

        # first check if this is a VSCode project
        if cfg['build_tool'] == 'vscode_cmake':
            vscode.run(proj_dir)
            return
        # check if this is a CLion project
        if cfg['build_tool'] == 'clion':
            clion.run(proj_dir)
            return
        # try to open as Xcode project
        proj = glob.glob(build_dir + '/*.xcodeproj')
        if proj :
            subprocess.call('open "{}"'.format(proj[0]), shell=True)
            return
        # try to open as VS project
        proj = glob.glob(build_dir + '/*.sln')
        if proj :
            subprocess.call('cmd /c start {}'.format(proj[0]), shell=True)
            return
        # try to open as eclipse project
        proj = glob.glob(build_dir + '/.cproject')
        if proj :
            subprocess.call('eclipse -nosplash --launcher.timeout 60 -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import "{}"'.format(build_dir), shell=True)
            subprocess.call('eclipse', shell=True)
            return

        log.error("don't know how to open a '{}' project in {}".format(cfg['generator'], build_dir))
    else :
        log.error("config '{}' not found".format(cfg_name))
Esempio n. 6
0
def build_deploy_webpage(fips_dir, proj_dir) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/voxel-test-webpage'.format(ws_dir)
    if os.path.isdir(webpage_dir) :
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    # compile emscripten, pnacl and android samples
    if BuildEmscripten and emscripten.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, 'emsc-ninja-release')
        project.build(fips_dir, proj_dir, 'emsc-ninja-release')
    
    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated web page under {}.'.format(webpage_dir))
Esempio n. 7
0
def build_deploy_webpage(fips_dir, proj_dir) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/oryol-wasm-buildsuite'.format(ws_dir)
    if not os.path.exists(webpage_dir) :
        os.makedirs(webpage_dir)
    config = 'wasmasmjs-make-release'
    project.clean(fips_dir, proj_dir, config) 
    project.gen(fips_dir, proj_dir, config)
    for target in Samples :
        project.build(fips_dir, proj_dir, config, target)
    
    copy_build_files(fips_dir, proj_dir, webpage_dir)
    if ExportAssets :
        export_assets(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Done. ({})'.format(webpage_dir))
Esempio n. 8
0
def build_deploy_webpage(fips_dir, proj_dir):
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/v6502r-webpage'.format(ws_dir)
    if not os.path.isdir(webpage_dir):
        os.makedirs(webpage_dir)

    project.gen(fips_dir, proj_dir, BuildConfig)
    project.build(fips_dir, proj_dir, BuildConfig)

    src_dir = '{}/fips-deploy/v6502r/{}'.format(ws_dir, BuildConfig)
    dst_dir = webpage_dir

    shutil.copy(src_dir + '/v6502r.html', dst_dir + '/index.html')
    shutil.copy(src_dir + '/v6502r.wasm', dst_dir + '/v6502r.wasm')
    shutil.copy(src_dir + '/v6502r.js', dst_dir + '/v6502r.js')

    log.colored(log.GREEN,
                'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 9
0
def build_deploy_webpage(fips_dir, proj_dir, rebuild) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/chips-webpage'.format(ws_dir)
    if rebuild :
        if os.path.isdir(webpage_dir) :
            shutil.rmtree(webpage_dir)
    if not os.path.isdir(webpage_dir) :
        os.makedirs(webpage_dir)

    # compile samples
    project.gen(fips_dir, proj_dir, BuildConfig)
    project.build(fips_dir, proj_dir, BuildConfig)
    
    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 10
0
def build_deploy_webpage(fips_dir, proj_dir, chip):
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/{}-webpage'.format(ws_dir, chip)
    if not os.path.isdir(webpage_dir):
        os.makedirs(webpage_dir)
    project.gen(fips_dir, proj_dir, BuildConfig)
    project.build(fips_dir, proj_dir, BuildConfig)
    proj_name = util.get_project_name_from_dir(proj_dir)
    util.ensure_valid_project_dir(proj_dir)
    src_dir = '{}/fips-deploy/NextSim/{}'.format(ws_dir, BuildConfig)
    dst_dir = webpage_dir
    #This area can be cleaned up sometime
    ns = "NextSim"
    shutil.copy(src_dir + '/' + ns + '.html', dst_dir + '/index.html')
    shutil.copy(src_dir + '/' + ns + '.wasm', dst_dir + '/' + ns + '.wasm')
    shutil.copy(src_dir + '/' + ns + '.js', dst_dir + '/' + ns + '.js')
    shutil.copy(proj_dir + '/src/res/favicon.png', dst_dir + '/favicon.png')
    log.colored(log.GREEN,
                'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 11
0
def build_deploy_webpage(fips_dir, proj_dir) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/oryol-samples-webpage'.format(ws_dir)
    if os.path.isdir(webpage_dir) :
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    if emscripten.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, BuildConfig)
        project.build(fips_dir, proj_dir, BuildConfig)
    
    # export sample assets
    if ExportAssets :
        export_assets(fips_dir, proj_dir, webpage_dir)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 12
0
def build_deploy_webpage(fips_dir, proj_dir) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/yakc-webpage/virtualkc'.format(ws_dir)
    if os.path.isdir(webpage_dir) :
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    # compile emscripten, pnacl and android samples
    if emscripten.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, 'yakc-emsc-make-release')
        project.build(fips_dir, proj_dir, 'yakc-emsc-make-release')
   
    # build the webpage via jekyll
    subprocess.call('jekyll build', cwd=proj_dir+'/web', shell=True)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated web page under {}.'.format(webpage_dir))
Esempio n. 13
0
def build_deploy_webpage(fips_dir, proj_dir) :
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/oryol-webpage'.format(ws_dir)
    if os.path.isdir(webpage_dir) :
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    # compile emscripten, pnacl and android samples
    if BuildEmscripten and emscripten.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, 'emsc-make-release')
        project.build(fips_dir, proj_dir, 'emsc-make-release')
    if BuildPNaCl and nacl.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, 'pnacl-make-release')
        project.build(fips_dir, proj_dir, 'pnacl-make-release')
    if BuildAndroid and android.check_exists(fips_dir) :
        project.gen(fips_dir, proj_dir, 'android-make-release')
        project.build(fips_dir, proj_dir, 'android-make-release')
    
    # export sample assets
    export_assets(fips_dir, proj_dir, webpage_dir)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 14
0
def build_deploy_webpage(fips_dir, proj_dir):
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/oryol-webpage'.format(ws_dir)
    if os.path.isdir(webpage_dir):
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    # compile emscripten, pnacl and android samples
    if BuildEmscripten and emscripten.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, 'emsc-make-release')
        project.build(fips_dir, proj_dir, 'emsc-make-release')
    if BuildPNaCl and nacl.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, 'pnacl-make-release')
        project.build(fips_dir, proj_dir, 'pnacl-make-release')
    if BuildAndroid and android.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, 'android-make-release')
        project.build(fips_dir, proj_dir, 'android-make-release')

    # export sample assets
    export_assets(fips_dir, proj_dir, webpage_dir)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN,
                'Generated Samples web page under {}.'.format(webpage_dir))
Esempio n. 15
0
def build_deploy_webpage(fips_dir, proj_dir):
    # if webpage dir exists, clear it first
    ws_dir = util.get_workspace_dir(fips_dir)
    webpage_dir = '{}/fips-deploy/yakc-webpage/virtualkc'.format(ws_dir)
    if os.path.isdir(webpage_dir):
        shutil.rmtree(webpage_dir)
    os.makedirs(webpage_dir)

    # compile
    if emscripten.check_exists(fips_dir):
        project.gen(fips_dir, proj_dir, 'yakc-emsc-make-release')
        project.build(fips_dir, proj_dir, 'yakc-emsc-make-release')
        project.gen(fips_dir, proj_dir, 'yakc-wasm-make-release')
        project.build(fips_dir, proj_dir, 'yakc-wasm-make-release')

    # build the webpage via jekyll
    subprocess.call('jekyll build', cwd=proj_dir + '/web', shell=True)

    # deploy the webpage
    deploy_webpage(fips_dir, proj_dir, webpage_dir)

    log.colored(log.GREEN, 'Generated web page under {}.'.format(webpage_dir))
Esempio n. 16
0
def run(fips_dir, proj_dir, args) :
    """run the 'open' verb (opens project in IDE)"""
    if not util.is_valid_project_dir(proj_dir) :
        log.error('must be run in a project directory')
    proj_name = util.get_project_name_from_dir(proj_dir)
    cfg_name = None
    if len(args) > 0 :
        cfg_name = args[0]
    if not cfg_name :
        cfg_name = settings.get(proj_dir, 'config')
        
    # check the cmake generator of this config
    configs = config.load(fips_dir, proj_dir, cfg_name)
    if configs :
        # hmm, only look at first match, 'open' doesn't
        # make sense with config-patterns
        cfg = configs[0]

        # find build dir, if it doesn't exist, generate it
        build_dir = util.get_build_dir(fips_dir, proj_name, cfg)
        if not os.path.isdir(build_dir) :
            log.warn("build dir not found, generating...")
            project.gen(fips_dir, proj_dir, cfg['name'])
        
        # try to open as Xcode project
        proj = glob.glob(build_dir + '/*.xcodeproj')
        if proj :
            subprocess.call('open {}'.format(proj[0]), shell=True)
        else :
            # try to open as VS project
            proj = glob.glob(build_dir + '/*.sln')
            if proj :
                subprocess.call('cmd /c start {}'.format(proj[0]), shell=True)
            else :
                log.error("don't know how to open a '{}' project".format(cfg['generator']))
    else :
        log.error("config '{}' not found".format(cfg_name))
Esempio n. 17
0
def run(fips_dir, proj_dir, args):
    """run the 'open' verb (opens project in IDE)"""
    if not util.is_valid_project_dir(proj_dir):
        log.error('must be run in a project directory')
    proj_name = util.get_project_name_from_dir(proj_dir)
    cfg_name = None
    if len(args) > 0:
        cfg_name = args[0]
    if not cfg_name:
        cfg_name = settings.get(proj_dir, 'config')

    # check the cmake generator of this config
    configs = config.load(fips_dir, proj_dir, cfg_name)
    if configs:
        # hmm, only look at first match, 'open' doesn't
        # make sense with config-patterns
        cfg = configs[0]

        # find build dir, if it doesn't exist, generate it
        build_dir = util.get_build_dir(fips_dir, proj_name, cfg)
        if not os.path.isdir(build_dir):
            log.warn("build dir not found, generating...")
            project.gen(fips_dir, proj_dir, cfg['name'])

        if 'Xcode' in cfg['generator']:
            # find the Xcode project
            proj = glob.glob(build_dir + '/*.xcodeproj')
            subprocess.call(['open', proj[0]])
        elif 'Visual Studio' in cfg['generator']:
            # find the VisualStudio project file
            proj = glob.glob(build_dir + '/*.sln')
            subprocess.call(['cmd', '/c', 'start', proj[0]])
        else:
            log.error("don't know how to open a '{}' project".format(
                cfg['generator']))
    else:
        log.error("config '{}' not found".format(cfg_name))