build_get_git.bat 578 B

1234567891011121314151617
  1. @echo off
  2. echo current time is %date% %time%
  3. echo get git sha
  4. echo.
  5. for /f "delims=" %%i in ('git rev-parse HEAD') do set git_head=%%i
  6. echo git sha=%git_head%
  7. echo git sha_short=%git_head:~0,10%
  8. echo #ifndef _ONE_CHIP_GITINF_H > ../BoardInterface/one_chip_git_inf.h
  9. echo #define _ONE_CHIP_GITINF_H >> ../BoardInterface/one_chip_git_inf.h
  10. echo #define ONE_CHIP_GIT_SHA "%git_head%">> ../BoardInterface/one_chip_git_inf.h
  11. echo #define ONE_CHIP_GIT_SHA_SHORT "%git_head:~0,10%">> ../BoardInterface/one_chip_git_inf.h
  12. echo #endif >> ../BoardInterface/one_chip_git_inf.h