示例#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')
示例#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')
示例#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')
示例#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'
示例#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'
示例#6
0
文件: builder.py 项目: dasmithii/Kit
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'
示例#7
0
def module_dependencies(name):
    path = storage.module_path(name)
    return directory_dependencies(path)
示例#8
0
def module_references(name):
    path = storage.module_path(name)
    return directory_references(path)
示例#9
0
def module_dependencies(name):
	path = storage.module_path(name)
	return directory_dependencies(path)
示例#10
0
def module_references(name):
	path = storage.module_path(name)
	return directory_references(path)
示例#11
0
文件: scanner.py 项目: dasmithii/Kit
def recursive_module_dependencies(mod):
    path = storage.module_path(mod)
    return recursive_dependencies(path)