Commandfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Vagrant Commandfile
  3. # (use with vagrant-devcommands plugin)
  4. #
  5. command 'phpize',
  6. description: 'executes "phpize" to configure source tree for installed PHP version',
  7. script: 'cd /data/v8js && phpize'
  8. command 'configure',
  9. description: 'executes "configure" to prepare build',
  10. parameters: {
  11. cxxflags: { default: "-ggdb -Wall -Wno-write-strings" },
  12. ldflags: { default: "-ggdb" },
  13. },
  14. script: <<-eof
  15. bash -c 'cd /data/build; ../v8js/configure `bash -c "if test -d /opt/libv8-*; then echo -n --with-v8js=; echo /opt/libv8-*; fi"` `test -d "/usr/lib64" && echo --with-libdir=lib64` CXXFLAGS="%{cxxflags}" LDFLAGS="%{ldflags}"'
  16. eof
  17. command 'clean',
  18. description: 'executes "make clean"',
  19. script: <<-eof
  20. cd /data/build; `which gmake || which make` clean; rm -rf /data/v8js/coverage_report /data/build/gcov.info
  21. eof
  22. command 'build',
  23. description: 'executes "make"',
  24. script: <<-eof
  25. cd /data/build; `which gmake || which make`
  26. eof
  27. command 'test',
  28. description: 'executes "make test"',
  29. parameters: {
  30. tests: { wrap: "TESTS=tests/%s", optional: true },
  31. },
  32. script: <<-eof
  33. cd /data/build; `which gmake || which make` test %{tests} NO_INTERACTION=1 REPORT_EXIT_STATUS=1
  34. eof
  35. command 'shell',
  36. description: 'execute a PHP CLI interactive shell with V8Js loaded',
  37. script: <<-eof
  38. cd /data/build; php -a -d extension=modules/v8js.so
  39. eof
  40. chain 'all',
  41. commands: [
  42. { command: 'phpize' },
  43. { command: 'configure' },
  44. { command: 'clean' },
  45. { command: 'build' },
  46. { command: 'test' }
  47. ]
  48. command 'coverage_report',
  49. description: 'capture *.gcda files and generate code coverage report',
  50. script: <<-eof
  51. cd /data/build
  52. lcov --base-directory=.libs --directory=.libs --directory ../v8js/ --no-external --capture --output-file gcov.info
  53. genhtml --legend --output-directory ../v8js/coverage_report/ --title "V8Js Code Coverage" gcov.info
  54. eof
  55. chain 'coverage',
  56. commands: [
  57. { command: 'phpize' },
  58. { command: 'configure', argv: ['--cxxflags=-O0 --coverage', '--ldflags=--coverage'] },
  59. { command: 'clean' },
  60. { command: 'build' },
  61. { command: 'test' },
  62. { command: 'coverage_report' },
  63. ]