aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools')
-rw-r--r--src/ee/tools/init.py3
-rw-r--r--src/ee/tools/kicad_make_bom.py8
-rw-r--r--src/ee/tools/templates/build.ninja.j23
3 files changed, 12 insertions, 2 deletions
diff --git a/src/ee/tools/init.py b/src/ee/tools/init.py
index 1e01dc7..711e623 100644
--- a/src/ee/tools/init.py
+++ b/src/ee/tools/init.py
@@ -1,5 +1,6 @@
import argparse
import configparser
+import uuid
from pathlib import Path
from typing import List
@@ -19,6 +20,8 @@ def init_kicad_project(basedir: Path, cfg, args):
sch_file: Path = pro_file.parent / (pro_file.name[0:-4] + ".sch")
pcb_file: Path = pro_file.parent / (pro_file.name[0:-4] + ".kicad_pcb")
+ cfg["kicad-project"]["uuid"] = str(uuid.uuid4())
+
if sch_file.is_file():
print("Found KiCAD project and schematic")
cfg["kicad-project"]["sch"] = str(sch_file)
diff --git a/src/ee/tools/kicad_make_bom.py b/src/ee/tools/kicad_make_bom.py
index 0e36c6d..925cad6 100644
--- a/src/ee/tools/kicad_make_bom.py
+++ b/src/ee/tools/kicad_make_bom.py
@@ -1,4 +1,5 @@
import argparse
+import uuid
from pathlib import Path
from ee.kicad.make_bom import make_bom
@@ -13,13 +14,18 @@ parser.add_argument("--sch",
help="The schematic to read")
parser.add_argument("--out",
+ required=True,
metavar="PART DB")
parser.add_argument("--strategy",
metavar="FUNC")
+parser.add_argument("--uuid",
+ required=True,
+ metavar="UUID")
+
args = parser.parse_args()
new_mode = True
-make_bom(Path(args.sch), Path(args.out), new_mode, pretty)
+make_bom(Path(args.sch), Path(args.out), uuid.UUID(args.uuid), new_mode, pretty)
diff --git a/src/ee/tools/templates/build.ninja.j2 b/src/ee/tools/templates/build.ninja.j2
index 522b010..0706b11 100644
--- a/src/ee/tools/templates/build.ninja.j2
+++ b/src/ee/tools/templates/build.ninja.j2
@@ -1,5 +1,6 @@
{% set reports=[] -%}
ee = {{ ee }}
+uuid = {{ project.uuid }}
report_dir = {{ project.report_dir }}
{%- if sch is defined %}
sch = {{ sch | ninja_path }}
@@ -20,7 +21,7 @@ rule kicad-gerber
rule kicad-make-bom
description = kicad-make-bom $out
- command = $ee kicad-make-bom --sch $sch --out $out
+ command = $ee kicad-make-bom --sch $sch --out $out --uuid $uuid
rule pn-part-search-list
description = pn-part-search-list supplier: $supplier