Exemplo n.º 1
0
def cmd_require (args):
    registry= cryregistry.load()
    project= cryproject.load (args.project_file)

    plugin_dependencies= {}
    require_getall (registry, cryproject.require_list(project), plugin_dependencies)
    plugin_list= require_sortedlist (plugin_dependencies)
    plugin_list= cryregistry.filter_plugin (registry, plugin_list)

    project_path= os.path.dirname (args.project_file)
    plugin_path= os.path.join (project_path, 'cryext.txt')
    if os.path.isfile (plugin_path):
        os.remove (plugin_path)

    plugin_file= open (plugin_path, 'w')
    for k in plugin_list:
        project_file= cryregistry.project_file (registry, k)
        project_path= os.path.dirname (project_file)
        project= cryproject.load (project_file)

        (m_extensionName, shared_path)= cryproject.shared_tuple (project, args.platform, args.config)
        asset_dir= cryproject.asset_dir (project)

        m_extensionBinaryPath= os.path.normpath (os.path.join (project_path, shared_path))
        m_extensionAssetDirectory= asset_dir and os.path.normpath (os.path.join (project_path, asset_dir)) or ''
        m_extensionClassName= 'EngineExtension_%s' % os.path.splitext (os.path.basename (m_extensionBinaryPath))[0]

        line= ';'.join ((m_extensionName, m_extensionClassName, m_extensionBinaryPath, m_extensionAssetDirectory))
        plugin_file.write  (line + os.linesep)

    plugin_file.close()
Exemplo n.º 2
0
def require_getall (registry, require_list, result):

    for k in require_list:
        if k in result:
            continue

        project_file= cryregistry.project_file (registry, k)
        project= cryproject.load (project_file)
        result[k]= cryproject.require_list (project)