diff --git a/CHANGELOG.md b/CHANGELOG.md index c521b4ef..50826558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -166,6 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Quick Start: - Problems with KiCad 6+ files using KiCad 5 names for layers - Problems scanning dirs without enough privileges +- PCB/SCH Variant + - Makefile/compress targets (missing project) ## [1.6.3] - 2023-06-26 ### Added diff --git a/kibot/gs.py b/kibot/gs.py index 19cd5159..5b84407a 100644 --- a/kibot/gs.py +++ b/kibot/gs.py @@ -523,15 +523,15 @@ def copy_project(new_pcb_name, dry=False): return pro_copy, prl_copy, dru_copy @staticmethod - def copy_project_names(pcb_name): + def copy_project_names(pcb_name, ref_dir): pro_copy, prl_copy, dru_copy = GS.copy_project(pcb_name, dry=True) files = [] if pro_copy: - files.append(pro_copy) + files.append(os.path.join(ref_dir, os.path.basename(pro_copy))) if prl_copy: - files.append(prl_copy) + files.append(os.path.join(ref_dir, os.path.basename(prl_copy))) if dru_copy: - files.append(dru_copy) + files.append(os.path.join(ref_dir, os.path.basename(dru_copy))) return files @staticmethod diff --git a/kibot/out_kicanvas.py b/kibot/out_kicanvas.py index 07e474f4..edd61053 100644 --- a/kibot/out_kicanvas.py +++ b/kibot/out_kicanvas.py @@ -62,9 +62,7 @@ def _get_targets(self, out_dir, only_index=False): elif s == 'schematic' and GS.sch_file: files.extend(GS.sch.file_names_variant(out_dir)) elif s == 'project' and (GS.sch_file or GS.pcb_file): - prj_files = GS.copy_project_names(GS.sch_file or GS.pcb_file) - for f in prj_files: - files.append(os.path.join(out_dir, os.path.basename(f))) + files.extend(GS.copy_project_names(GS.sch_file or GS.pcb_file, ref_dir=out_dir)) return files def get_targets(self, out_dir): diff --git a/kibot/out_pcb_variant.py b/kibot/out_pcb_variant.py index e78552e2..48f9975f 100644 --- a/kibot/out_pcb_variant.py +++ b/kibot/out_pcb_variant.py @@ -29,7 +29,10 @@ def __init__(self): self._expand_ext = 'kicad_pcb' def get_targets(self, out_dir): - return [self._parent.expand_filename(out_dir, self.output)] + targets = [self._parent.expand_filename(out_dir, self.output)] + if self.copy_project: + targets.extend(GS.copy_project_names(targets[0], ref_dir=out_dir)) + return targets def run(self, output): super().run(output) diff --git a/kibot/out_sch_variant.py b/kibot/out_sch_variant.py index ef17fd95..8d4db0f2 100644 --- a/kibot/out_sch_variant.py +++ b/kibot/out_sch_variant.py @@ -21,7 +21,10 @@ def __init__(self): super().__init__() def get_targets(self, out_dir): - return GS.sch.file_names_variant(out_dir) + targets = list(GS.sch.file_names_variant(out_dir)) + if self.copy_project: + targets.extend(GS.copy_project_names(GS.sch_file, ref_dir=out_dir)) + return targets def run(self, output_dir): super().run(output_dir)