From 3523190bb7ca1c38caea3a1aae51062d22e56b09 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 15 Mar 2019 10:55:06 +0100 Subject: o Switching PartDb to serialize into many xml files into a single document. --- src/ee/tools/templates/build.ninja.j2 | 50 +++++++++++++++-------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'src/ee/tools/templates') diff --git a/src/ee/tools/templates/build.ninja.j2 b/src/ee/tools/templates/build.ninja.j2 index e91de6c..8552d96 100644 --- a/src/ee/tools/templates/build.ninja.j2 +++ b/src/ee/tools/templates/build.ninja.j2 @@ -13,36 +13,36 @@ rule kicad-gerber # mv $(GERBER_DIR)/tmp.zip $@ rule kicad-make-bom - description = kicad-make-bom $out_dir - command = $ee kicad-make-bom --sch $sch --out $out_dir $strategy + description = kicad-make-bom $out + command = $ee kicad-make-bom --sch $sch --out $out $strategy rule part-create-distributor-search-list - description = part-create-distributor-search-list distributor=$distributor $in_dir => $out_dir - command = $ee part-create-distributor-search-list --in $in_dir --out $out_dir + description = part-create-distributor-search-list distributor: $distributor + command = $ee part-create-distributor-search-list --in $in --out $out rule digikey-search-parts description = digikey-search-parts - command = $ee digikey-search-parts --in $in_dir --out $out_dir + command = $ee digikey-search-parts --in $in --out $out rule digikey-normalize-facts description = digikey-normalize-facts - command = $ee digikey-normalize-facts --in $in_dir --out $out_dir + command = $ee digikey-normalize-facts --in $in --out $out rule element14-search-parts description = element14-search-parts - command = $ee element14-search-parts --in $in_dir --out $out_dir + command = $ee element14-search-parts --in $in --out $out rule element14-normalize-facts description = element14-normalize-facts - command = $ee element14-normalize-facts --in $in_dir --out $out_dir + command = $ee element14-normalize-facts --in $in --out $out rule create-order description = create-order - command = $ee create-order --schematic $sch_dir --part-db $part_dbs --out $out_dir + command = $ee create-order --schematic $schematic --part-db $part_dbs --out $out rule import-parts-yaml description = import-parts-yaml $in - command = $ee import-parts-yaml --in $in --out $out_dir + command = $ee import-parts-yaml --in $in --out $out {% if gerber_zip is defined %} build gerbers: phony {{ gerber_zip }} @@ -50,37 +50,29 @@ build {{ gerber_zip }}: kicad-gerber $pcb gerber_dir = {{ gerber_zip | parent_dir }} {%- endif %} -build ee/sch/index.xml: kicad-make-bom $sch - out_dir = ee/sch +build ee/sch.xml: kicad-make-bom $sch strategy = {{ "--strategy " + kicad_bom_strategy if kicad_bom_strategy else "" }} {%- 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/{{ d }}/search-list +build ee/{{ d }}/search-list.xml: part-create-distributor-search-list ee/sch.xml + distributor = {{ d }} -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 }}/downloaded.xml: {{ d }}-search-parts ee/{{ d }}/search-list.xml -build ee/{{ d }}/normalized/index.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded/index.xml - in_dir = ee/{{ d }}/downloaded - out_dir = ee/{{ d }}/normalized +build ee/{{ d }}/normalized.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded.xml -default ee/{{ d }}/normalized/index.xml +default ee/{{ d }}/normalized.xml {%- endfor %} {%- for f in parts_yaml_files %} -{% set out=(f | parent_dir) / (f | noext) / "index.xml" %} +{% set out=(f | parent_dir) / ((f | noext) + ".xml") %} build {{ out }}: import-parts-yaml {{ f }} - out_dir = {{ f | parent_dir }}/{{ f | noext }} # default {{ out }} {% endfor %} -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 %} +build ee/order.xml: create-order ee/sch.xml {%- for p in part_dbs %} {{ p }}.xml{% endfor %} + schematic = ee/sch.xml + part_dbs ={%- for p in part_dbs %} {{ p }}.xml{% endfor %} -default ee/order/index.xml +default ee/order.xml -- cgit v1.2.3