aboutsummaryrefslogtreecommitdiff
path: root/src/ee/tools/templates
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-14 06:27:16 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-15 08:22:02 +0100
commit8d17fb5bc4b0dae0758e01a44d77d87acf2e686a (patch)
treea13ed043962b8a8da355bba956dc9e77b7fb217e /src/ee/tools/templates
parent2315d1a34cb777f1731368619a4ca14f46125bb4 (diff)
downloadee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.gz
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.bz2
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.tar.xz
ee-python-8d17fb5bc4b0dae0758e01a44d77d87acf2e686a.zip
o Adding module for searching on element14.
o Starting on functionality create orders. Very WIP. o Adding a concept of an "ee project". Can load a gitconfig-like config file. o Adding a tool to import a yaml file into a part xml file.
Diffstat (limited to 'src/ee/tools/templates')
-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