您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

35 行
841B

  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