use common schematic/layout revision number
This commit is contained in:
parent
4c3e594085
commit
661d5586aa
17
Rakefile
17
Rakefile
|
@ -33,10 +33,15 @@ names.each do |name|
|
|||
sch = "#{name}.sch"
|
||||
# pcb layout
|
||||
pcb = "#{name}.pcb"
|
||||
# schematic revision, based on the number of schematic commits
|
||||
sch_rev = `git log --pretty=oneline "#{sch}" | wc -l`.chomp.to_i
|
||||
# pcb layout revision, based on the number of pcb commits
|
||||
pcb_rev = `git log --pretty=oneline "#{pcb}" | wc -l`.chomp.to_i
|
||||
# get common schematic/layout revision number, based on the total number of commits
|
||||
# this means the layout revision number can increment although only the schematic has been modified (and vice versa), but this is more convenient to have synched revision numbers
|
||||
rev = `git log --pretty=oneline "#{sch}" "#{pcb}" | wc -l`.chomp.to_i
|
||||
sch_rev = rev
|
||||
pcb_rev = rev
|
||||
# get schematic and layout revision numbers, based on the respective number of commits
|
||||
# this allows to have independent number in case an edit in one does not affect the other, but you need to keep track of which revision numbers correspond
|
||||
#sch_rev = `git log --pretty=oneline "#{sch}" | wc -l`.chomp.to_i
|
||||
#pcb_rev = `git log --pretty=oneline "#{pcb}" | wc -l`.chomp.to_i
|
||||
# schema name with version and revision
|
||||
vsch = "#{name}_v#{version}.#{sch_rev.to_s.rjust(3,'0')}.sch"
|
||||
# pcb layout name with version and revision
|
||||
|
@ -319,8 +324,8 @@ end
|
|||
desc "generate printable documentation (PDF) from layout"
|
||||
targets.each do |target|
|
||||
file "#{target[:name]}_layout.pdf" => target[:vpcb] do |t|
|
||||
sh "pcb -x ps --psfile #{t.name}.ps #{t.prerequisites.join(' ')} 2> /dev/null"
|
||||
sh "ps2pdf #{t.name}.ps #{t.name} 2> /dev/null"
|
||||
sh "pcb -x ps --media A4 --psfile #{t.name}.ps #{t.prerequisites.join(' ')} 2> /dev/null"
|
||||
sh "ps2pdf -sPAPERSIZE=a4 #{t.name}.ps #{t.name} 2> /dev/null"
|
||||
sh "rm #{t.name}.ps 2> /dev/null"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue