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.

78 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. fi
  24. git clean -dfx
  25. if [ $REPO_INITIALIZED_FILE_EXISTS == "true" ]; then
  26. touch .repo_initialized
  27. echo "This file is checked by the 'init_after_clone' script." >> .repo_initialized
  28. fi
  29. echo "############################################################"
  30. echo "# Re-checkout current branch ..."
  31. echo "############################################################"
  32. git checkout
  33. echo "############################################################"
  34. echo "# Create hardware platform ..."
  35. echo "############################################################"
  36. xsct scripts/platform_create.tcl
  37. if [ $IMPORT_HW_PLATFORM_ONLY == "true" ]; then
  38. echo "############################################################"
  39. echo "# Import hw_platform only to workspace ..."
  40. echo "############################################################"
  41. xsct scripts/import_platform_only.tcl
  42. else
  43. echo "############################################################"
  44. echo "# Import all projects to workspace ..."
  45. echo "############################################################"
  46. xsct scripts/import_platform_and_projects.tcl
  47. fi
  48. # Disable Vitis welcome screen
  49. FILE=".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs"
  50. touch $FILE
  51. echo "eclipse.preferences.version=1" >> $FILE
  52. echo "showIntro=false" >> $FILE
  53. echo "############################################################"
  54. echo "# ... finished!"
  55. if [ $START_VITIS == "true" ]; then
  56. echo "#"
  57. echo "# Starting Vitis ..."
  58. echo "############################################################"
  59. vitis -workspace .
  60. else
  61. echo "#"
  62. echo "# Start Vitis with 'vitis -workspace .'"
  63. echo "############################################################"
  64. fi