gen_js.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. for protocol in 1.0; do
  3. for xml in ../../message_definitions/v$protocol/*.xml; do
  4. base=$(basename $xml .xml)
  5. mkdir -p javascript/implementations/mavlink_${base}_v${protocol}
  6. # Generate MAVLink implementation
  7. ../tools/mavgen.py --lang=JavaScript --wire-protocol=$protocol --output=javascript/implementations/mavlink_${base}_v${protocol}/mavlink.js $xml || exit 1
  8. # Create package.json file
  9. cat >javascript/implementations/mavlink_${base}_v${protocol}/package.json <<EOF
  10. {
  11. "name" : "mavlink_${base}_v${protocol}",
  12. "version" : "0.0.1",
  13. "description" : "Implementation of the MAVLink protocol",
  14. "keywords" : ["mavlink", "arduino", "megapilot", "ros", "robot", "uav", "drone", "awesome"],
  15. "homepage": "https://github.com/mavlink/mavlink",
  16. "bugs" : "https://github.com/mavlink/mavlink/issues",
  17. "license" : {
  18. "type" : "LGPL-3.0",
  19. "url" : "http://opensource.org/licenses/LGPL-3.0"
  20. },
  21. "contributors" : ["Bruce Crevensten <bruce.crevensten@gmail.com>"],
  22. "main" : "mavlink.js",
  23. "repository" : {
  24. "type" : "git",
  25. "url" : "https://github.com/mavlink/mavlink"
  26. },
  27. "dependencies" : {
  28. "underscore" : "",
  29. "jspack":"",
  30. "winston": ""
  31. },
  32. "devDependencies" : {
  33. "should" : "",
  34. "mocha" : "",
  35. "sinon" : ""
  36. }
  37. }
  38. EOF
  39. done
  40. done