You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.5 KiB

  1. #!/bin/bash
  2. NO_PROMPT="false"
  3. START_VITIS="false"
  4. IMPORT_HW_PLATFORM_ONLY="false"
  5. REPO_INITIALIZED_FILE_EXISTS="false"
  6. for arg in "$@"; do
  7. if [ $arg == "--no-prompt" ]; then
  8. NO_PROMPT="true"
  9. elif [ $arg == "--start-vitis" ]; then
  10. START_VITIS="true"
  11. elif [ $arg == "--import-hw-platform-only" ]; then
  12. IMPORT_HW_PLATFORM_ONLY="true"
  13. fi
  14. done
  15. if [ $NO_PROMPT == "false" ]; then
  16. read -p "!!! WARNING !!! All unstaged and untracked files will be deleted! Press ENTER to continue or CTRL+C to abort..."
  17. fi
  18. echo "############################################################"
  19. echo "# Delete all unstaged and untracked files ..."
  20. echo "############################################################"
  21. if [ -f ".repo_initialized" ]; then
  22. REPO_INITIALIZED_FILE_EXISTS="true"
  23. rm -f .repo_initialized
  24. fi
  25. git clean -dfx
  26. if [ $REPO_INITIALIZED_FILE_EXISTS == "true" ]; then
  27. touch .repo_initialized
  28. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  29. fi
  30. echo "############################################################"
  31. echo "# Re-checkout current branch ..."
  32. echo "############################################################"
  33. git checkout
  34. echo "############################################################"
  35. echo "# Create hardware platform ..."
  36. echo "############################################################"
  37. xsct tcl_scripts/platform_create.tcl
  38. if [ $IMPORT_HW_PLATFORM_ONLY == "true" ]; then
  39. echo "############################################################"
  40. echo "# Import hw_platform only to workspace ..."
  41. echo "############################################################"
  42. xsct tcl_scripts/import_platform_only.tcl
  43. else
  44. echo "############################################################"
  45. echo "# Import all projects to workspace ..."
  46. echo "############################################################"
  47. xsct tcl_scripts/import_platform_and_projects.tcl
  48. fi
  49. # Disable Vitis welcome screen
  50. FILE=".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs"
  51. touch $FILE
  52. echo "eclipse.preferences.version=1" >> $FILE
  53. echo "showIntro=false" >> $FILE
  54. echo "############################################################"
  55. echo "# ... finished!"
  56. if [ $START_VITIS == "true" ]; then
  57. echo "#"
  58. echo "# Starting Vitis ..."
  59. echo "############################################################"
  60. vitis -workspace .
  61. else
  62. echo "#"
  63. echo "# Start Vitis with 'vitis -workspace .'"
  64. echo "############################################################"
  65. fi