Exemple #1
0
def ready_indexed_module(name):
    if storage.module_compiled(name):
        print utility.color(' - already compiled', 'green')
    else:
        path = storage.module_path(name)
        build_directory(path)
        prepare_headers(name)
        print utility.color(' - compiled module: ' + name, 'green')
Exemple #2
0
def ready_indexed_module(name):
	if storage.module_compiled(name):
		print utility.color(' - already compiled', 'green')
	else:
		path = storage.module_path(name)
		build_directory(path)
		prepare_headers(name)
		print utility.color(' - compiled module: ' + name, 'green')
Exemple #3
0
def install(context):
	build(None)
	name = os.path.abspath('.').split('/')[-1]
	if os.path.exists('sources/main.c'):
		shutil.copy('build/bin/' + name, '/usr/local/bin/' + name)
	else:
		dest = storage.module_path(name)
		shutil.copytree('.', dest)
		storage.index(name, 'none')
Exemple #4
0
def prepare_headers(name):
    root = storage.module_path(name)
    baseheaders = root + '/build/headers/kit'
    headers = baseheaders + '/' + name
    for path in utility.headers_under(root):
        if path.find('build') == 0:
            continue
        dest = path.replace(root + '/', '')
        dest = '/'.join(dest.split('/')[1:])
        if not os.path.exists(headers):
            os.makedirs(headers)
        shutil.copy(path, headers + '/' + dest)

        if path.replace(root + '/sources/', '') == name + '.h':
            shutil.copy(path, baseheaders)
    print ' - prepared headers'
Exemple #5
0
def prepare_headers(name):
	root = storage.module_path(name)
	baseheaders = root + '/build/headers/kit'
	headers = baseheaders + '/' + name
	for path in utility.headers_under(root):
		if path.find('build') == 0:
			continue
		dest = path.replace(root + '/', '')
		dest = '/'.join(dest.split('/')[1:])
		if not os.path.exists(headers):
			os.makedirs(headers)
		shutil.copy(path, headers + '/' + dest)

		if path.replace(root + '/sources/', '') == name + '.h':
			shutil.copy(path, baseheaders)
	print ' - prepared headers'
Exemple #6
0
def prepare_headers(name):
    root = storage.module_path(name)
    baseheaders = root + '/build/headers/kit'
    headers = baseheaders + '/' + name
    for path in utility.headers_under(root):
        # don't duplicate if already prepared
        if path.find('build') == 0:
            continue

        # move file
        dest = path.replace(root + '/', '')
        dest = '/'.join(dest.split('/')[1:])
        if not os.path.exists(headers):
            os.makedirs(headers)
        shutil.copy(path, headers + '/' + dest)

        # make `#include <kit/name.h>` function as `#include <kit/name/{api.h,
        # name.h}>`
        short = path.replace(root + '/sources/', '')
        if short in ['api.h', 'api.hh', name + '.h', name + '.hh']:
            shutil.copy(
                path, baseheaders + '/' + name + short[short.find('.'):])
    print ' - prepared headers'
Exemple #7
0
def module_dependencies(name):
    path = storage.module_path(name)
    return directory_dependencies(path)
Exemple #8
0
def module_references(name):
    path = storage.module_path(name)
    return directory_references(path)
Exemple #9
0
def module_dependencies(name):
	path = storage.module_path(name)
	return directory_dependencies(path)
Exemple #10
0
def module_references(name):
	path = storage.module_path(name)
	return directory_references(path)
Exemple #11
0
def recursive_module_dependencies(mod):
    path = storage.module_path(mod)
    return recursive_dependencies(path)