You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 9 години
12345678910111213141516171819202122232425262728293031323334
  1. require 'pathname'
  2. require 'fileutils'
  3. OS=RbConfig::CONFIG["host_os"][0..5]
  4. Package = File.join("#{ENV['GOPATH']}", "pkg", "*")
  5. desc 'Remove previously built packages.'
  6. task :clean do
  7. Pathname.glob("#{Package}").map {|item|
  8. if item.basename.to_s.start_with?(OS)
  9. base = File.join(item.to_s, 'github.com', 'goanywhere')
  10. # remove compiled rex sub-packages
  11. if File.exists?(File.join(base, 'rex'))
  12. FileUtils.rm_r File.join(base, 'rex'), :force => true
  13. end
  14. # remove compiled rex package
  15. if File.exists?(File.join(base, 'rex.a'))
  16. FileUtils.rm File.join(base, 'rex.a'), :force => true
  17. end
  18. end
  19. }
  20. end
  21. desc 'Start building whole rex packages.'
  22. task :build => :clean do
  23. sh 'go get -v ./...'
  24. end
  25. desc 'Start testing rex packages...'
  26. task 'test' do
  27. sh 'go test -v ./...'
  28. end