Compare commits

...

3 Commits
0.6.3 ... 0.6.4

9 changed files with 56 additions and 57 deletions

View File

@@ -460,7 +460,7 @@ class Module:
# generate tree for this special binary
self.build_tree(target, self.name)
target.copy_to_staging(self.name)
if target.endGeneratePackage==True:
if target.end_generate_package == True:
# generate the package with his properties ...
if target.name=="Android":
self.sub_heritage_list.add_heritage(self.local_heritage)

View File

@@ -20,7 +20,7 @@ import subprocess
import shlex
# Local import
from . import debug
import tools
from . import tools
from . import env
queueLock = threading.Lock()
@@ -42,44 +42,6 @@ isinit = False # the thread are initialized
errorOccured = False # a thread have an error
processorAvaillable = 1 # number of CPU core availlable
def store_command(cmd_line, file):
# write cmd line only after to prevent errors ...
if file != "" \
or file != None:
return;
debug.verbose("create cmd file: " + file)
# Create directory:
tools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmd_line)
file2.flush()
file2.close()
def store_warning(file, output, err):
# write warning line only after to prevent errors ...
if file == "" \
or file == None:
return;
if env.get_warning_mode() == False:
debug.verbose("remove warning file: " + file)
# remove file if exist...
tools.remove_file(file);
return;
debug.verbose("create warning file: " + file)
# Create directory:
tools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write("===== output =====\n")
file2.write(output)
file2.write("\n\n")
file2.write("===== error =====\n")
file2.write(err)
file2.write("\n\n")
file2.flush()
file2.close()
##
## @brief Execute the command and ruturn generate data
##
@@ -128,7 +90,7 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
output = output.decode("utf-8")
err = err.decode("utf-8")
# store error if needed:
store_warning(store_output_file, output, err)
tools.store_warning(store_output_file, output, err)
# Check error :
if p.returncode == 0:
debug.debug(env.print_pretty(cmd_line))
@@ -171,7 +133,7 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
return
debug.verbose("done 3")
# write cmd line only after to prevent errors ...
store_command(cmd_line, store_cmd_line)
tools.store_command(cmd_line, store_cmd_line)

View File

@@ -43,7 +43,7 @@ class Target:
# todo : remove this :
self.sumulator = config["simulation"]
self.name=name
self.name = name
self.end_generate_package = config["generate-package"]
debug.info("=================================");
debug.info("== Target='" + self.name + "' " + config["bus-size"] + " bits for arch '" + config["arch"] + "'");
@@ -464,7 +464,7 @@ class Target:
targetList=[]
__startTargetName="lutinTarget_"
__start_target_name="lutinTarget_"
def import_path(path):
@@ -472,14 +472,14 @@ def import_path(path):
matches = []
debug.debug('TARGET: Start find sub File : "%s"' %path)
for root, dirnames, filenames in os.walk(path):
tmpList = fnmatch.filter(filenames, __startTargetName + "*.py")
tmpList = fnmatch.filter(filenames, __start_target_name + "*.py")
# Import the module :
for filename in tmpList:
debug.debug('TARGET: Find a file : "%s"' %os.path.join(root, filename))
#matches.append(os.path.join(root, filename))
sys.path.append(os.path.dirname(os.path.join(root, filename)) )
targetName = filename.replace('.py', '')
targetName = targetName.replace(__startTargetName, '')
targetName = targetName.replace(__start_target_name, '')
debug.debug("TARGET: integrate module: '" + targetName + "' from '" + os.path.join(root, filename) + "'")
targetList.append([targetName,os.path.join(root, filename)])
@@ -494,8 +494,8 @@ def load_target(name, config):
if mod[0] == name:
debug.verbose("add to path: '" + os.path.dirname(mod[1]) + "'")
sys.path.append(os.path.dirname(mod[1]))
debug.verbose("import target : '" + __startTargetName + name + "'")
theTarget = __import__(__startTargetName + name)
debug.verbose("import target : '" + __start_target_name + name + "'")
theTarget = __import__(__start_target_name + name)
#create the target
tmpTarget = theTarget.Target(config)
return tmpTarget
@@ -513,7 +513,7 @@ def list_all_target_with_desc():
tmpList = []
for mod in targetList:
sys.path.append(os.path.dirname(mod[1]))
theTarget = __import__(__startTargetName + mod[0])
theTarget = __import__(__start_target_name + mod[0])
try:
tmpdesc = theTarget.get_desc()
tmpList.append([mod[0], tmpdesc])

View File

@@ -14,7 +14,7 @@ import fnmatch
# Local import
from . import debug
from . import depend
import multiprocess
from . import env
"""
@@ -106,7 +106,7 @@ def copy_file(src, dst, cmd_file=None, force=False):
debug.print_element("copy file", src, "==>", dst)
create_directory_of_file(dst)
shutil.copyfile(src, dst)
multiprocess.store_command(cmd_line, cmd_file)
store_command(cmd_line, cmd_file)
def copy_anything(src, dst):
@@ -176,5 +176,42 @@ def move_if_needed(src, dst):
file_write_data(dst, src_data)
remove_file(src)
def store_command(cmd_line, file):
# write cmd line only after to prevent errors ...
if file == "" \
or file == None:
return;
debug.verbose("create cmd file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmd_line)
file2.flush()
file2.close()
def store_warning(file, output, err):
# write warning line only after to prevent errors ...
if file == "" \
or file == None:
return;
if env.get_warning_mode() == False:
debug.verbose("remove warning file: " + file)
# remove file if exist...
remove_file(file);
return;
debug.verbose("create warning file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write("===== output =====\n")
file2.write(output)
file2.write("\n\n")
file2.write("===== error =====\n")
file2.write(err)
file2.write("\n\n")
file2.flush()
file2.close()

View File

@@ -104,5 +104,5 @@ def link(file, binary, target, depancy, name, basic_folder):
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)

View File

@@ -65,7 +65,7 @@ def link(file, binary, target, depancy, name, basic_folder):
debug.print_element("jar", name, "==>", file_dst)
multiprocess.run_command(cmdLine, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@@ -97,6 +97,6 @@ def link(file, binary, target, depancy, name, basic_folder):
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@@ -78,5 +78,5 @@ def link(file, binary, target, depancy, name, basic_folder):
file_dst ])
multiprocess.run_command(cmdLineRanLib, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
return file_dst

View File

@@ -7,7 +7,7 @@ def readme():
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
setup(name='lutin',
version='0.6.3',
version='0.6.4',
description='Lutin generic builder',
long_description=readme(),
url='http://github.com/HeeroYui/lutin',