self.infos["PROJECT_NAME"] = project_data.get("PROJECT_NAME", os.path.basename(project_dir))
self.infos["PROJECT_PATH"] = os.path.dirname(project_file)
- # Check for the Wizard version
- wizard_version = project_data.get("WIZARD_VERSION", 0)
- if wizard_version < 1:
- # Ignore the SOURCES_PATH inside the project file for older projects
+ preset = project_data.get("PRESET", False)
+ if not preset:
+ # Ignore the SOURCES_PATH inside the project file if it's not setted as 'preset'
project_data["SOURCES_PATH"] = project_dir
+ else:
+ linked_sources_path = project_data["SOURCES_PATH"]
+ sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path))
+ project_data["SOURCES_PATH"] = sources_abspath
+
self._loadBertosSourceStuff(project_data["SOURCES_PATH"], info_dict.get("SOURCES_PATH", None))
+
+ self.infos["PRESET"] = preset
# For those projects that don't have a VERSION file create a dummy one.
if not isBertosDir(project_dir):
if information["enabled"]:
enabled_modules.append(module)
project_data["ENABLED_MODULES"] = enabled_modules
- # Use the local BeRTOS version instead of the original one
- # project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH")
- project_data["SOURCES_PATH"] = directory
+ if project_info.info("PRESET"):
+ # For presets save again the SOURCES_PATH into project file
+ project_data["PRESET"] = True
+ project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH")
+ else:
+ # Use the local BeRTOS version instead of the original one
+ # project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH")
+ project_data["SOURCES_PATH"] = directory
project_data["PROJECT_NAME"] = project_info.info("PROJECT_NAME", os.path.basename(directory))
project_data["TOOLCHAIN"] = project_info.info("TOOLCHAIN")
project_data["CPU_NAME"] = project_info.info("CPU_NAME")