clean.py 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. #----------------------------------------------------------------------------------------------------------------------*
  4. import sys, os, shutil
  5. #----------------------------------------------------------------------------------------------------------------------*
  6. #----------------------------------------------------------------- Get script absolute path
  7. scriptDir = os.path.dirname (os.path.abspath (sys.argv [0]))
  8. #----------------------------------------------------------------- Import common definitions
  9. pythonScriptDir = scriptDir + "/../dev-files"
  10. sys.path.append (pythonScriptDir)
  11. import common_definitions
  12. #-----------------------------------------------------------------
  13. GENERATED_SOURCE_DIR = scriptDir + "/" + common_definitions.generatedSourceDirectory ()
  14. if os.path.exists (GENERATED_SOURCE_DIR):
  15. shutil.rmtree (GENERATED_SOURCE_DIR)
  16. BUILD_DIR = scriptDir + "/" + common_definitions.buildDirectory ()
  17. if os.path.exists (BUILD_DIR):
  18. shutil.rmtree (BUILD_DIR)
  19. PRODUCT_DIR = scriptDir + "/" + common_definitions.productDirectory ()
  20. if os.path.exists (PRODUCT_DIR):
  21. shutil.rmtree (PRODUCT_DIR)
  22. AS_DIR = scriptDir + "/" + common_definitions.asDirectory ()
  23. if os.path.exists (AS_DIR):
  24. shutil.rmtree (AS_DIR)
  25. #---
  26. print ("Cleaning " + os.path.basename (scriptDir) + " done")
  27. #----------------------------------------------------------------------------------------------------------------------*