Rework utils

pull/15/head
Andre Richter 5 years ago
parent 0802adca1c
commit 0824b0ecaa
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -2,19 +2,21 @@
require 'fileutils'
crates = Dir["**/Cargo.toml"].sort!
def clean_all
crates = Dir["**/Cargo.toml"].sort!
crates.each do |x|
next if x.include?('raspi3_boot')
crates.each do |x|
next if x.include?('raspi3_boot')
x = File.dirname(x)
puts "\n\n" + x.to_s + "\n\n"
Dir.chdir(x) do
unless system('make clean')
puts "\n\nBuild failed!"
exit(1) # Exit with error code
x = File.dirname(x)
Dir.chdir(x) do
system('make clean') or exit(1)
end
end
FileUtils.rm_rf('xbuild_sysroot')
end
FileUtils.rm_rf('xbuild_sysroot')
if __FILE__ == $0
clean_all()
end

@ -1,12 +1,18 @@
#!/usr/bin/env ruby
crates = Dir["*/Cargo.toml"]
crates.delete_if { |x| x.include?('bareminimum') }
def clippy_all
crates = Dir["*/Cargo.toml"].sort!
crates.delete_if { |x| x.include?('bareminimum') }
crates.each do |x|
x = File.dirname(x)
crates.each do |x|
x = File.dirname(x)
Dir.chdir(x) do
`make clippy`
Dir.chdir(x) do
system('make clippy')
end
end
end
if __FILE__ == $0
clippy_all()
end

@ -1,11 +1,17 @@
#!/usr/bin/env ruby
crates = Dir["**/Cargo.toml"]
def fmt_all
crates = Dir["**/Cargo.toml"].sort!
crates.each do |x|
x = File.dirname(x)
crates.each do |x|
x = File.dirname(x)
Dir.chdir(x) do
`cargo fmt`
Dir.chdir(x) do
system('cargo fmt')
end
end
end
if __FILE__ == $0
fmt_all()
end

@ -1,16 +1,22 @@
#!/usr/bin/env ruby
crates = Dir["**/Cargo.toml"].sort!
def make_all
crates = Dir["**/Cargo.toml"].sort!
crates.each do |x|
next if x.include?('raspi3_boot')
crates.each do |x|
next if x.include?('raspi3_boot')
x = File.dirname(x)
puts "\n\n" + x.to_s + "\n\n"
Dir.chdir(x) do
unless system('make')
puts "\n\nBuild failed!"
exit(1) # Exit with error code
x = File.dirname(x)
puts "\n\n" + x.to_s + "\n\n"
Dir.chdir(x) do
unless system('make')
puts "\n\nBuild failed!"
exit(1) # Exit with error code
end
end
end
end
if __FILE__ == $0
make_all()
end

@ -1,13 +1,19 @@
#!/usr/bin/env ruby
crates = Dir["**/Cargo.toml"].sort!
def make_panic_test
crates = Dir["**/Cargo.toml"].sort!
crates.each do |x|
next if x.include?('raspi3_boot')
crates.each do |x|
next if x.include?('raspi3_boot')
x = File.dirname(x)
puts "\n" + x.to_s + ':'
Dir.chdir(x) do
system('make nm | grep panic_fmt')
x = File.dirname(x)
puts "\n" + x.to_s + ':'
Dir.chdir(x) do
system('make nm | grep panic_fmt')
end
end
end
if __FILE__ == $0
make_panic_test()
end

@ -0,0 +1,17 @@
#!/usr/bin/env ruby
require_relative 'clean_all'
require_relative 'clippy_all'
require_relative 'fmt_all'
require_relative 'make_all'
require_relative 'make_panic_test'
require_relative 'sanity_checks'
clean_all()
clippy_all()
clean_all()
fmt_all()
make_all()
make_panic_test()
sanity_checks()

@ -0,0 +1,16 @@
#!/usr/bin/env ruby
def sanity_checks
crates = Dir["**/Cargo.toml"].sort!
crates.each do |x|
if File.readlines(x).grep(/patch.crates-io/).size > 0
puts "#{x} contains patch.crates-io!"
exit(1)
end
end
end
if __FILE__ == $0
sanity_checks()
end
Loading…
Cancel
Save