[DEBUG] correct basic path to create the zip file in Windows Target
This commit is contained in:
parent
71e0f242bf
commit
27f6a95d41
@ -239,6 +239,7 @@ class Target:
|
|||||||
self.path_out = os.path.join("out", self._name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
self.path_out = os.path.join("out", self._name + "_" + self.config["arch"] + "_" + self.config["bus-size"], self.config["mode"])
|
||||||
self.path_final = os.path.join("final", self.config["compilator"])
|
self.path_final = os.path.join("final", self.config["compilator"])
|
||||||
self.path_staging = os.path.join("staging", self.config["compilator"])
|
self.path_staging = os.path.join("staging", self.config["compilator"])
|
||||||
|
self.path_staging_tmp = os.path.join("staging_tmp", self.config["compilator"])
|
||||||
self.path_build = os.path.join("build", self.config["compilator"])
|
self.path_build = os.path.join("build", self.config["compilator"])
|
||||||
|
|
||||||
# TODO: Remove this from here ==> this is a tools
|
# TODO: Remove this from here ==> this is a tools
|
||||||
@ -375,8 +376,11 @@ class Target:
|
|||||||
## @param[in] name (string) Name of the module
|
## @param[in] name (string) Name of the module
|
||||||
## @return (string) The path
|
## @return (string) The path
|
||||||
##
|
##
|
||||||
def get_staging_path(self, name):
|
def get_staging_path(self, name, tmp=False):
|
||||||
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
if tmp == False:
|
||||||
|
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging, name)
|
||||||
|
else:
|
||||||
|
return os.path.join(tools.get_run_path(), self.path_out, self.path_staging_tmp, name)
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ...
|
## @brief Get the build path ==> dependency file, object files, cmdlines files, generate files, local install headers ...
|
||||||
@ -475,8 +479,8 @@ class Target:
|
|||||||
## @param[in] name (string) Name of the package
|
## @param[in] name (string) Name of the package
|
||||||
## @return (string) The path
|
## @return (string) The path
|
||||||
##
|
##
|
||||||
def get_staging_path_bin(self, name):
|
def get_staging_path_bin(self, name, tmp=False):
|
||||||
return os.path.join(self.get_staging_path(name), self.path_bin)
|
return os.path.join(self.get_staging_path(name, tmp), self.path_bin)
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief Get the lib path for staging step
|
## @brief Get the lib path for staging step
|
||||||
@ -484,8 +488,8 @@ class Target:
|
|||||||
## @param[in] name (string) Name of the package
|
## @param[in] name (string) Name of the package
|
||||||
## @return (string) The path
|
## @return (string) The path
|
||||||
##
|
##
|
||||||
def get_staging_path_lib(self, name):
|
def get_staging_path_lib(self, name, tmp=False):
|
||||||
return os.path.join(self.get_staging_path(name), self.path_lib, name)
|
return os.path.join(self.get_staging_path(name, tmp), self.path_lib, name)
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief Get the data path for staging step
|
## @brief Get the data path for staging step
|
||||||
@ -493,8 +497,8 @@ class Target:
|
|||||||
## @param[in] name (string) Name of the package
|
## @param[in] name (string) Name of the package
|
||||||
## @return (string) The path
|
## @return (string) The path
|
||||||
##
|
##
|
||||||
def get_staging_path_data(self, name):
|
def get_staging_path_data(self, name, tmp=False):
|
||||||
return os.path.join(self.get_staging_path(name), self.path_data, name)
|
return os.path.join(self.get_staging_path(name, tmp), self.path_data, name)
|
||||||
|
|
||||||
##
|
##
|
||||||
## @brief Get the include path for staging step
|
## @brief Get the include path for staging step
|
||||||
|
@ -72,15 +72,15 @@ class Target(target.Target):
|
|||||||
self.support_dynamic_link = False
|
self.support_dynamic_link = False
|
||||||
|
|
||||||
|
|
||||||
def get_staging_path_data(self, binary_name):
|
def get_staging_path_data(self, binary_name, tmp=False):
|
||||||
return os.path.join(self.get_staging_path(binary_name), binary_name + ".app", self.pkg_path_data)
|
return os.path.join(self.get_staging_path(binary_name, tmp), binary_name + ".app", self.pkg_path_data)
|
||||||
|
|
||||||
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
|
def make_package_binary(self, pkg_name, pkg_properties, base_pkg_path, heritage_list, static):
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
debug.debug("Generate package '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"]))
|
debug.debug("Generate package '" + pkg_name + "' v" + tools.version_to_string(pkg_properties["VERSION"]))
|
||||||
debug.debug("------------------------------------------------------------------------")
|
debug.debug("------------------------------------------------------------------------")
|
||||||
#output path
|
#output path
|
||||||
target_outpath = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app")
|
target_outpath = os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app")
|
||||||
tools.create_directory_of_file(target_outpath)
|
tools.create_directory_of_file(target_outpath)
|
||||||
|
|
||||||
## Create share datas:
|
## Create share datas:
|
||||||
@ -105,19 +105,26 @@ class Target(target.Target):
|
|||||||
or ret_file \
|
or ret_file \
|
||||||
or need_generate_package:
|
or need_generate_package:
|
||||||
# Zip the data
|
# Zip the data
|
||||||
debug.print_element("zip", "data.zip", "<==", self.get_staging_path_data(pkg_name) + "/*")
|
debug.print_element("zip", "data.zip", "<==", self.get_staging_path_data(pkg_name, tmp=True) + "/*")
|
||||||
zip_path = os.path.join(self.get_staging_path(pkg_name), "data.zip")
|
zip_path = os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", "data.zip")
|
||||||
zip.create_zip([
|
zip.create_zip([
|
||||||
self.get_staging_path_data(pkg_name),
|
self.get_staging_path_data(pkg_name, tmp=True),
|
||||||
target_outpath+"/pkg"
|
target_outpath+"/pkg"
|
||||||
], zip_path)
|
], zip_path)
|
||||||
|
# copy if needed the binary:
|
||||||
|
tools.copy_file(
|
||||||
|
os.path.join(self.get_staging_path(pkg_name, tmp=True), pkg_name + ".app", pkg_name + self.suffix_binary),
|
||||||
|
os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary),
|
||||||
|
force_identical=True)
|
||||||
|
|
||||||
zip_path_final = os.path.join(self.get_final_path(), pkg_name + ".zip")
|
zip_path_final = os.path.join(self.get_final_path(), pkg_name + ".zip")
|
||||||
# generate deployed zip (for user)
|
# generate deployed zip (for user)
|
||||||
debug.print_element("zip", pkg_name + ".zip", "<==", self.get_staging_path(pkg_name))
|
debug.print_element("zip", pkg_name + ".zip", "<==", self.get_staging_path(pkg_name), pkg_name + ".app")
|
||||||
zip.create_zip_file([
|
zip.create_zip_file([
|
||||||
zip_path,
|
zip_path,
|
||||||
os.path.join(target_outpath, pkg_name + self.suffix_binary)
|
os.path.join(self.get_staging_path(pkg_name), pkg_name + ".app", pkg_name + self.suffix_binary)
|
||||||
],
|
],
|
||||||
|
pkg_name + ".app",
|
||||||
zip_path_final)
|
zip_path_final)
|
||||||
|
|
||||||
tools.file_write_data(build_package_path_done, "done...")
|
tools.file_write_data(build_package_path_done, "done...")
|
||||||
|
@ -33,7 +33,7 @@ def create_zip(path, outputFile):
|
|||||||
zf.write(file, file[basePathlen:])
|
zf.write(file, file[basePathlen:])
|
||||||
zf.close()
|
zf.close()
|
||||||
|
|
||||||
def create_zip_file(files, outputFile):
|
def create_zip_file(files, base_output, outputFile):
|
||||||
debug.debug("Create Zip : '" + outputFile + "'")
|
debug.debug("Create Zip : '" + outputFile + "'")
|
||||||
tools.create_directory_of_file(outputFile)
|
tools.create_directory_of_file(outputFile)
|
||||||
debug.debug(" from '" + str(files) + "'")
|
debug.debug(" from '" + str(files) + "'")
|
||||||
@ -41,8 +41,8 @@ def create_zip_file(files, outputFile):
|
|||||||
files = [files]
|
files = [files]
|
||||||
zf = zipfile.ZipFile(outputFile, mode='w')
|
zf = zipfile.ZipFile(outputFile, mode='w')
|
||||||
for elem in files:
|
for elem in files:
|
||||||
debug.verbose(" ADD zip = " + str(elem) + " ==> " + elem[len(os.path.dirname(elem)):])
|
debug.verbose(" ADD zip = " + str(elem) + " ==> " + base_output + "/" + elem[len(os.path.dirname(elem)):])
|
||||||
zf.write(elem, elem[len(os.path.dirname(elem)):])
|
zf.write(elem, base_output + "/" + elem[len(os.path.dirname(elem)):])
|
||||||
zf.close()
|
zf.close()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user