rake: fix cleaning
This commit is contained in:
parent
9ec8c983ca
commit
0a65e91714
13
Rakefile
13
Rakefile
|
@ -44,8 +44,7 @@ task :default => [:print, :fabrication, :bom]
|
||||||
desc "print schematic and layout (as pdf)"
|
desc "print schematic and layout (as pdf)"
|
||||||
prints = [ "#{name}.sch.pdf", "#{name}.brd-top.png", "#{name}.brd-bot.png" ]
|
prints = [ "#{name}.sch.pdf", "#{name}.brd-top.png", "#{name}.brd-bot.png" ]
|
||||||
task :print => prints
|
task :print => prints
|
||||||
CLEAN.include([ "#{name}.versioned.kicad_sch", "#{name}.versioned.kicad_pcb" ])
|
CLEAN.include(prints)
|
||||||
CLOBBER.include(prints)
|
|
||||||
|
|
||||||
desc "generate fabrication files (gerbers/drill/BoM/PnP)"
|
desc "generate fabrication files (gerbers/drill/BoM/PnP)"
|
||||||
FABRICATION_DIR = "fabrication"
|
FABRICATION_DIR = "fabrication"
|
||||||
|
@ -64,22 +63,21 @@ end
|
||||||
desc "export Bill of Material (as CSV)"
|
desc "export Bill of Material (as CSV)"
|
||||||
boms = [ "#{name}.bom.csv" ]
|
boms = [ "#{name}.bom.csv" ]
|
||||||
task :bom => boms
|
task :bom => boms
|
||||||
CLEAN.include([ "#{name}.versioned.xml" ])
|
CLEAN.include(boms)
|
||||||
CLOBBER.include(boms)
|
|
||||||
|
|
||||||
desc "generate panel"
|
desc "generate panel"
|
||||||
PANEL_DIR = "panel"
|
PANEL_DIR = "panel"
|
||||||
panels = ["panel.kicad_pcb", "panel.kicad_pro", "panel.top.png", "panel.bot.png"]
|
panels = ["panel.kicad_pcb", "panel.kicad_pro", "panel.top.png", "panel.bot.png"]
|
||||||
task :panel => panels
|
task :panel => panels
|
||||||
CLOBBER.include(panels)
|
CLEAN.include(panels)
|
||||||
CLOBBER.include(PANEL_DIR)
|
CLEAN.include(PANEL_DIR)
|
||||||
|
|
||||||
# ===============
|
# ===============
|
||||||
# file generation
|
# file generation
|
||||||
# ===============
|
# ===============
|
||||||
|
|
||||||
desc "generate file with version information"
|
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|
|
VERSIONED.each do |ext|
|
||||||
rule ".versioned" + ext => ext do |t|
|
rule ".versioned" + ext => ext do |t|
|
||||||
sh "cp #{t.source} #{t.name}"
|
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/\\$date\\$/#{date}/g' #{t.name}"
|
||||||
sh "sed --in-place 's/\\$revision\\$/#{revision}/g' #{t.name}"
|
sh "sed --in-place 's/\\$revision\\$/#{revision}/g' #{t.name}"
|
||||||
end
|
end
|
||||||
|
CLEAN.include(["#{name}.versioned#{ext}"])
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "generate printable version (PDF) of schematic"
|
desc "generate printable version (PDF) of schematic"
|
||||||
|
|
Loading…
Reference in New Issue