rake: fix cleaning

This commit is contained in:
King Kévin 2022-06-19 17:36:02 +02:00
parent 9ec8c983ca
commit 0a65e91714
1 changed files with 6 additions and 7 deletions

View File

@ -44,8 +44,7 @@ task :default => [:print, :fabrication, :bom]
desc "print schematic and layout (as pdf)"
prints = [ "#{name}.sch.pdf", "#{name}.brd-top.png", "#{name}.brd-bot.png" ]
task :print => prints
CLEAN.include([ "#{name}.versioned.kicad_sch", "#{name}.versioned.kicad_pcb" ])
CLOBBER.include(prints)
CLEAN.include(prints)
desc "generate fabrication files (gerbers/drill/BoM/PnP)"
FABRICATION_DIR = "fabrication"
@ -64,22 +63,21 @@ end
desc "export Bill of Material (as CSV)"
boms = [ "#{name}.bom.csv" ]
task :bom => boms
CLEAN.include([ "#{name}.versioned.xml" ])
CLOBBER.include(boms)
CLEAN.include(boms)
desc "generate panel"
PANEL_DIR = "panel"
panels = ["panel.kicad_pcb", "panel.kicad_pro", "panel.top.png", "panel.bot.png"]
task :panel => panels
CLOBBER.include(panels)
CLOBBER.include(PANEL_DIR)
CLEAN.include(panels)
CLEAN.include(PANEL_DIR)
# ===============
# file generation
# ===============
desc "generate file with version information"
VERSIONED = [".kicad_sch", ".kicad_pcb", ".kicad_pro", ".json"]
VERSIONED = [".kicad_sch", ".kicad_pcb", ".kicad_pro", ".json"] + [".xml", ".csv"]
VERSIONED.each do |ext|
rule ".versioned" + ext => ext do |t|
sh "cp #{t.source} #{t.name}"
@ -87,6 +85,7 @@ VERSIONED.each do |ext|
sh "sed --in-place 's/\\$date\\$/#{date}/g' #{t.name}"
sh "sed --in-place 's/\\$revision\\$/#{revision}/g' #{t.name}"
end
CLEAN.include(["#{name}.versioned#{ext}"])
end
desc "generate printable version (PDF) of schematic"