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.j224
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ee/tools/templates/build.ninja.j2 b/src/ee/tools/templates/build.ninja.j2
index 9fff519..1ab6102 100644
--- a/src/ee/tools/templates/build.ninja.j2
+++ b/src/ee/tools/templates/build.ninja.j2
@@ -56,8 +56,8 @@ rule element14-search-parts
rule create-bom
command = $ee create-bom {{ log }} --schematic $schematic --part-db $part_dbs --out $out $strategy
-rule split-parts-by-supplier
- command = $ee split-parts-by-supplier {{ log }} --parts $in --out $out $part_dbs
+rule split-bom-by-supplier
+ command = $ee split-bom-by-supplier {{ log }} --bom $in $part_dbs $suppliers $orders
rule import-parts-yaml
description = import-parts-yaml $in
@@ -151,6 +151,12 @@ build $public_dir/{{ s.key }}/souffle/out/fact.csv: souffle {{ alt if is_file(al
build {{ s.part_db }}: part-apply-souffle-post $public_dir/{{ s.key }}/souffle/out/fact.csv
in_sch = $public_dir/{{ s.key }}/downloaded.xml
work = $public_dir/{{ s.key }}/souffle
+
+rule {{ s.key }}-create-bom
+ command = $ee {{ s.key }}-create-bom {{ log }} --bom $in --out $out $part_dbs --allow-incomplete
+
+build {{ s.bom_output }}: {{ s.key }}-create-bom {{ s.bom_input }}
+ part_dbs = --part-db {{ s.part_db }}
{%- endfor %}
{%- for f in parts_yaml_files %}
@@ -167,11 +173,10 @@ build $public_dir/bom.xml | $report_dir/bom.rst: create-bom $public_dir/sch.xml
{%- endif %}
{%- set reports=reports+["$report_dir/bom.rst"] %}
-{#
-build $public_dir/orders/index.xml: split-parts-by-supplier $public_dir/bom.xml | {%- for s in suppliers %} {{ s.part_db }}{% endfor %}
- part_dbs ={%- for s in suppliers %} {{ s.part_db }}{% endfor %}
- suppliers = {% s for s in suppliers %}
-#}
+build {%- for s in suppliers %} {{ s.bom_input }}{% endfor %}: split-bom-by-supplier $public_dir/bom.xml | {%- for s in suppliers %} {{ s.part_db }}{% endfor %}
+ part_dbs = {%- for s in suppliers %} --part-db {{ s.part_db }}{% endfor %}
+ suppliers = {%- for s in suppliers %} --supplier {{ s.key }}={{ s.supplier.uri }}{% endfor %}
+ orders = {%- for s in suppliers %} --order {{ s.key }}={{ s.bom_input }}{% endfor %}
rule seeed-download-opl
description = seeed-download-opl $opl
@@ -190,5 +195,6 @@ build $public_dir/seeed/opl/{{ opl }}.xml: seeed-download-opl
# Reports
build ee-reports: phony {{ " ".join(reports) }}
-build part-dbs: phony {%- for s in suppliers %} {{ s.part_db }}{% endfor %}
-build ee-all: phony ee-reports part-dbs
+build ee-part-dbs: phony {%- for s in suppliers %} {{ s.part_db }}{% endfor %}
+build ee-orders: phony {%- for s in suppliers %} {{ s.bom_output }}{% endfor %}
+build ee-all: phony ee-reports ee-orders