Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

test.ps1 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Automated cordova tests. Installs the correct cordova platform,
  2. # installs the plugin, installs the test app, and then runs it on
  3. # a device or emulator.
  4. #
  5. # usage: .\bin\test.ps1 [android|ios|windows|wp8]
  6. #
  7. # N.B. if you functionally change this script you _must_ change .\bin\test.sh too.
  8. #
  9. # STATUS: UNSUPPORTED
  10. #
  11. # A known issue is that this script needs old coffeescript@1 or coffee-script@1
  12. # to be installed globally while the package script is using locally installed
  13. # version of coffeescript@1.
  14. #
  15. # It is recommended to use the package scripts with npm or yarn tool instead
  16. # of this script.
  17. #
  18. param([string]$platform)
  19. if (! $platform) {
  20. echo "usage: .\bin\test.sh [android|ios|windows|wp8]"
  21. exit 1
  22. }
  23. if (! (get-command coffee) ) {
  24. echo "you need coffeescript. please install with:"
  25. echo "npm install -g coffee-script"
  26. exit 1
  27. }
  28. if (! (get-command cordova) ) {
  29. echo "you need cordova. please install with:"
  30. echo "npm install -g cordova"
  31. exit 1
  32. }
  33. pushd spec
  34. if (!$?) { # run from the bin/ directory
  35. echo "re-pushing"
  36. pushd ../spec
  37. }
  38. try {
  39. # compile coffeescript
  40. coffee --no-header -cl -o ../www ../SQLitePlugin.coffee.md
  41. if (!$?) {
  42. echo "coffeescript compilation failed"
  43. exit 1
  44. }
  45. echo "compiled coffeescript to javascript"
  46. # move everything to a temp folder to avoid infinite recursion errors
  47. if (test-path ../.plugin) {
  48. rm -force -recurse ../.plugin -ErrorAction ignore
  49. }
  50. mkdir -ErrorAction ignore ../.plugin | out-null
  51. cp -recurse ../scripts, ../src, ../package.json, ../plugin.xml, ../www ../.plugin
  52. # update the plugin, run the test app
  53. cordova platform add $platform
  54. cordova plugin rm com.phonegap.plugins.sqlite
  55. cordova plugin add ../.plugin
  56. cordova run $platform
  57. } finally {
  58. popd
  59. }