streamline-inspector-source.sh 1.6 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # Don't do anything for Debug builds, so the Inspector is easier to debug.
  3. if [[ ${CONFIGURATION:=Debug} == "Debug" ]]; then
  4. exit
  5. fi
  6. # Combine all script resources in the inspector.html file.
  7. "$SRCROOT/../inspector/combine-javascript-resources.pl" --input-html "${SRCROOT}/../inspector/front-end/inspector.html" --generated-scripts-dir ${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore --output-dir "${DERIVED_FILE_DIR}/WebCore" --output-script-name inspector.js
  8. # Inline script imports in HeapSnapshotWorker.js file.
  9. "$SRCROOT/../inspector/inline-javascript-imports.py" "${SRCROOT}/../inspector/front-end/HeapSnapshotWorker.js" "${SRCROOT}/../inspector/front-end" "${DERIVED_FILE_DIR}/WebCore/HeapSnapshotWorker.js"
  10. # Inline script imports in ScriptFormatterWorker.js file.
  11. "$SRCROOT/../inspector/inline-javascript-imports.py" "${SRCROOT}/../inspector/front-end/ScriptFormatterWorker.js" "${SRCROOT}/../inspector/front-end" "${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js"
  12. if [ -d "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector" ]; then
  13. # Remove any JavaScript files, since they will be replaced with the combined files.
  14. cd "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/inspector"
  15. rm *.js
  16. # Copy the modified HTML file and the combined scripts.
  17. cp "${DERIVED_FILE_DIR}/WebCore/inspector.html" inspector.html
  18. cp "${DERIVED_FILE_DIR}/WebCore/inspector.js" inspector.js
  19. cp "${DERIVED_FILE_DIR}/WebCore/HeapSnapshotWorker.js" HeapSnapshotWorker.js
  20. cp "${DERIVED_FILE_DIR}/WebCore/scriptFormatterWorker.js" scriptFormatterWorker.js
  21. fi