aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools/templates/build.ninja.j2
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/tools/templates/build.ninja.j2')
-rw-r--r--src/ee/tools/templates/build.ninja.j251
1 files changed, 42 insertions, 9 deletions
diff --git a/src/ee/tools/templates/build.ninja.j2 b/src/ee/tools/templates/build.ninja.j2
index 79a2bc1..e91de6c 100644
--- a/src/ee/tools/templates/build.ninja.j2
+++ b/src/ee/tools/templates/build.ninja.j2
@@ -28,6 +28,22 @@ rule digikey-normalize-facts
description = digikey-normalize-facts
command = $ee digikey-normalize-facts --in $in_dir --out $out_dir
+rule element14-search-parts
+ description = element14-search-parts
+ command = $ee element14-search-parts --in $in_dir --out $out_dir
+
+rule element14-normalize-facts
+ description = element14-normalize-facts
+ command = $ee element14-normalize-facts --in $in_dir --out $out_dir
+
+rule create-order
+ description = create-order
+ command = $ee create-order --schematic $sch_dir --part-db $part_dbs --out $out_dir
+
+rule import-parts-yaml
+ description = import-parts-yaml $in
+ command = $ee import-parts-yaml --in $in --out $out_dir
+
{% if gerber_zip is defined %}
build gerbers: phony {{ gerber_zip }}
build {{ gerber_zip }}: kicad-gerber $pcb
@@ -38,16 +54,33 @@ build ee/sch/index.xml: kicad-make-bom $sch
out_dir = ee/sch
strategy = {{ "--strategy " + kicad_bom_strategy if kicad_bom_strategy else "" }}
-build ee/digikey/search-list/index.xml: part-create-distributor-search-list ee/sch/index.xml
+{%- for d in distributors %}
+# Distributor {{ d }}
+build ee/{{ d }}/search-list/index.xml: part-create-distributor-search-list ee/sch/index.xml
in_dir = ee/sch
- out_dir = ee/digikey/search-list
+ out_dir = ee/{{ d }}/search-list
+
+build ee/{{ d }}/downloaded/index.xml: {{ d }}-search-parts ee/{{ d }}/search-list/index.xml
+ in_dir = ee/{{ d }}/search-list
+ out_dir = ee/{{ d }}/downloaded
+
+build ee/{{ d }}/normalized/index.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded/index.xml
+ in_dir = ee/{{ d }}/downloaded
+ out_dir = ee/{{ d }}/normalized
+
+default ee/{{ d }}/normalized/index.xml
+{%- endfor %}
-build ee/digikey/downloaded/index.xml: digikey-search-parts ee/digikey/search-list/index.xml
- in_dir = ee/digikey/search-list
- out_dir = ee/digikey/downloaded
+{%- for f in parts_yaml_files %}
+{% set out=(f | parent_dir) / (f | noext) / "index.xml" %}
+build {{ out }}: import-parts-yaml {{ f }}
+ out_dir = {{ f | parent_dir }}/{{ f | noext }}
+# default {{ out }}
+{% endfor %}
-build ee/digikey/normalized/index.xml: digikey-normalize-facts ee/digikey/downloaded/index.xml
- in_dir = ee/digikey/downloaded
- out_dir = ee/digikey/normalized
+build ee/order/index.xml: create-order ee/sch/index.xml {%- for p in part_dbs %} {{ p / "index.xml" }}{% endfor %}
+ sch_dir = ee/sch
+ out_dir = ee/order
+ part_dbs ={%- for p in part_dbs %} {{ p }}{% endfor %}
-default ee/digikey/normalized/index.xml
+default ee/order/index.xml