Play images and video from Synology PhotoStation server

kmake.bat 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @echo off
  2. :=== Parameters ===
  3. python -c "import re,sys; print re.search('<addon.+?version=""([^""]+)""',open('addon.xml').read()).group(1)" >version.txt
  4. set /p ver=<version.txt
  5. python -c "import re,sys; print re.search('<addon.+?id=""([^""]+)""',open('addon.xml').read()).group(1)" >id.txt
  6. set /p pack_name=<id.txt
  7. echo %pack_name% %ver%
  8. pause
  9. set release_dir=release\
  10. set repo_dir=q:\web\repo\
  11. :set feed_dir=q:\web\repo\
  12. set AR=\MinGW\bin\ar.exe
  13. set TAR=\MinGW\msys\1.0\bin\tar.exe
  14. set CP=\MinGW\msys\1.0\bin\cp.exe
  15. set ZIP=
  16. rem set ZIP=\Program Files (x86)\Gow\bin\zip.exe
  17. :=== Create package zip file ===
  18. if exist "%pack_name%" rm -r -f "%pack_name%"
  19. mkdir "%pack_name%""
  20. if not exist %release_dir% mkdir %release_dir%
  21. echo Copying files to %pack_name%
  22. for %%f in (
  23. readme.md
  24. changelog.md
  25. addon.xml
  26. addon.py
  27. icon.png
  28. kodiswift\*.py
  29. resources\__init__.py
  30. resources\settings.xml
  31. resources\icon.png
  32. resources\language\English\*
  33. resources\lib\__init__.py
  34. resources\lib\photostation_api.py
  35. ) do echo f| xcopy %%f %pack_name%\%%f
  36. pause
  37. echo Creating %release_dir%%pack_name%-%ver%.zip
  38. if exist %release_dir%%pack_name%-%ver%.zip rm %release_dir%%pack_name%-%ver%.zip
  39. 7za a -r -tzip -bb0 -bsp1 -bso0 %release_dir%%pack_name%-%ver%.zip %pack_name%
  40. if exist %pack_name% rm -r -f %pack_name%
  41. if ()==(%1%) (
  42. GOTO :EOF
  43. )
  44. :=== Add to git ===
  45. echo Adding to git
  46. echo git add %release_dir%%pack_name%-%ver%.zip
  47. git add %release_dir%%pack_name%-%ver%.zip
  48. git commit -m %ver%
  49. git tag -d %ver%
  50. git tag %ver%
  51. git push
  52. :=== Copy package to repo ===
  53. echo Copying %release_dir%%pack_name%-%ver%.zip to %repo_dir%%pack_name%
  54. if not exist %repo_dir% mkdir %repo_dir%
  55. if not exist %repo_dir%%pack_name% mkdir %repo_dir%%pack_name%
  56. cp addon.xml %repo_dir%%pack_name%\addon.xml -fpv
  57. cp %release_dir%%pack_name%-%ver%.zip %repo_dir%%pack_name%\%pack_name%-%ver%.zip -fpv
  58. python -c "import hashlib; print hashlib.md5(open(r'%repo_dir%%pack_name%\%pack_name%-%ver%.zip','r').read()).hexdigest()" >%repo_dir%%pack_name%\%pack_name%-%ver%.zip.md5
  59. python ..\generate_repo.py %repo_dir%
  60. )