build-old-arduino-package.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. TAG=$(git describe)
  3. OUTPUT="ArduinoJson-$TAG-old-layout.zip"
  4. cd $(dirname $0)/..
  5. cat > ArduinoJson.h <<END
  6. // WARNING:
  7. // --------
  8. // This file is a workaround for old version of the Arduino IDE.
  9. // If you are using Arduino IDE 1.0.6 or above, then you installed the wrong
  10. // package of ArduinoJson.
  11. // In that case, just delete the current installation and install the package.
  12. END
  13. cp ArduinoJson.h ArduinoJson.cpp
  14. cat "include/ArduinoJson.h" | sed 's!include "!include "include/!g' >> ArduinoJson.h
  15. find src -name "*.cpp" |
  16. while read FILE; do
  17. echo >> ArduinoJson.cpp
  18. echo "// $FILE" >> ArduinoJson.cpp
  19. echo "//" >> ArduinoJson.cpp
  20. cat "$FILE" | sed 's!\.\./!!g' >> ArduinoJson.cpp
  21. done
  22. unix2dos ArduinoJson.cpp
  23. unix2dos ArduinoJson.h
  24. pushd ..
  25. # remove existing file
  26. rm -f $OUTPUT
  27. # create zipman dos2
  28. 7z a $OUTPUT \
  29. ArduinoJson/CHANGELOG.md \
  30. ArduinoJson/examples \
  31. ArduinoJson/include/ArduinoJson \
  32. ArduinoJson/keywords.txt \
  33. ArduinoJson/LICENSE.md \
  34. ArduinoJson/README.md \
  35. ArduinoJson/ArduinoJson.h \
  36. ArduinoJson/ArduinoJson.cpp \
  37. -x!ArduinoJson/src/CMakeLists.txt
  38. popd
  39. rm ArduinoJson.h
  40. rm ArduinoJson.cpp