Skip to content

Commit

Permalink
[PCB/SCH Variant] Fixed targets (missing project files)
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Jan 30, 2024
1 parent 263db4e commit ea06a32
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions kibot/gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions kibot/out_kicanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 4 additions & 1 deletion kibot/out_pcb_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion kibot/out_sch_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea06a32

Please sign in to comment.