基于Jenkins 构建keil自动编译环境--git item创建与构建(三)

简要描述

  • 本文主要展如何示在genkins上ci任务,用于自动化编译。并展示完整的编译过程日记。

如何操作

  1. 指定工程的git仓库所在的路径

  2. 指定工程的触发的类型
    周期性编译及代码提交时自动编译

  3. 指定工程的编译脚本

  4. 工程编译目录如下所示

  5. 工程编译过程输出如下所示

    Started by timer
    Running as SYSTEM
    Building in workspace D:\jenkins\workspace\git-test
    The recommended git tool is: NONE
    using credential c6b04636-e0a9-41d5-b3e8-26ff1c8dfe43

    git.exe rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
    git.exe config remote.origin.url git://192.168.43.64/rt1052-sdk2.1.2.git # timeout=10
    Fetching upstream changes from git://192.168.43.64/rt1052-sdk2.1.2.git
    git.exe --version # timeout=10
    git --version # ‘git version 2.16.2.windows.1’
    using GIT_ASKPASS to set credentials
    git.exe fetch --tags --progress – git://192.168.43.64/rt1052-sdk2.1.2.git +refs/heads/:refs/remotes/origin/ # timeout=10
    git.exe rev-parse “refs/remotes/origin/master^{commit}” # timeout=10
    Checking out Revision 64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c (refs/remotes/origin/master)
    git.exe config core.sparsecheckout # timeout=10
    git.exe checkout -f 64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c # timeout=10
    Commit message: “update keil_compile.bat for make rar package”
    git.exe rev-list --no-walk 64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c # timeout=10
    [git-test] $ cmd /c call C:\Windows\TEMP\jenkins531949878620539568.bat

    D:\jenkins\workspace\git-test>keil_compile.bat
    UV_PRO_PATH=D:\jenkins\workspace\git-test\projects\easy_arm_rt1052_debug_mdk\easy_arm_rt1052.uvprojx
    You are not currently on a branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details.

     git pull <remote> <branch>
    

    D:\jenkins\workspace\git-test>echo #define UTS_VERSION “2021/01/13-15:20:04” 1>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>echo #define RT1052FW_COMPILE_TIME “2021/01/13-15:20:04” 1>>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>echo #define RT1052FW_COMPILE_BY “MS-20180322BJUK$” 1>>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>echo #define RT1052FW_COMPILE_DOMAIN 1>>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>echo #define RTFW_COMPILER “Keil compiler” 1>>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>FOR /F “delims=” %i IN (‘git rev-list HEAD -n 1’) DO set “Version=%i”

    D:\jenkins\workspace\git-test>set “Version=64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c”

    D:\jenkins\workspace\git-test>echo #define RT1052FW_VERSION “1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c” 1>>D:\jenkins\workspace\git-test\examples\application\app_awtk_demo\prj\easy_arm_rt1052_awtk_mdk\build_info.h

    D:\jenkins\workspace\git-test>echo Init building …
    Init building …

    D:\jenkins\workspace\git-test>echo . 1>build_log.txt

    D:\jenkins\workspace\git-test>D:\Keil_v5\UV4\UV4.exe -j0 -r D:\jenkins\workspace\git-test\projects\easy_arm_rt1052_debug_mdk\easy_arm_rt1052.uvprojx -o D:\jenkins\workspace\git-test\build_log.txt

    D:\jenkins\workspace\git-test>type build_log.txt
    *** Using Compiler ‘V5.06 update 3 (build 300)’, folder: ‘d:\Keil_v5\ARM\ARMCC\Bin’
    Rebuild target ‘Release flexspi flash’
    compiling asctime_r.c…
    assembling flexram_config_for_armcc.S…
    user_config\flexram_config_for_armcc.S(74): warning: A1581W: Added 2 bytes of padding at address 0x6a
    user_config\flexram_config_for_armcc.S(246): warning: A1581W: Added 2 bytes of padding at address 0x11e
    compiling aw_prj_usr_app_init.c…
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(182): warning: #1296-D: extended constant initialiser used

    EAP_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(183): warning: #1296-D: extended constant initialiser used

    EAP_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(191): warning: #1296-D: extended constant initialiser used

    OM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(192): warning: #1296-D: extended constant initialiser used

    OM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(202): warning: #1296-D: extended constant initialiser used

    AM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(203): warning: #1296-D: extended constant initialiser used

    AM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(212): warning: #1296-D: extended constant initialiser used

    EAP_DMA_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(213): warning: #1296-D: extended constant initialiser used

    EAP_DMA_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(240): warning: #1296-D: extended constant initialiser used

    LEXSPI_DRV_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(241): warning: #1296-D: extended constant initialiser used

    LEXSPI_DRV_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(251): warning: #1296-D: extended constant initialiser used

    LASH_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(252): warning: #1296-D: extended constant initialiser used

    LASH_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(261): warning: #1296-D: extended constant initialiser used

    RAM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(262): warning: #1296-D: extended constant initialiser used

    RAM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(271): warning: #1296-D: extended constant initialiser used

    ELOCODE_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(272): warning: #1296-D: extended constant initialiser used

    ELOCODE_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(296): warning: #1296-D: extended constant initialiser used

    EAP_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(297): warning: #1296-D: extended constant initialiser used

    EAP_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(306): warning: #1296-D: extended constant initialiser used

    OM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(307): warning: #1296-D: extended constant initialiser used

    OM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(317): warning: #1296-D: extended constant initialiser used

    AM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(318): warning: #1296-D: extended constant initialiser used

    AM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(327): warning: #1296-D: extended constant initialiser used

    EAP_DMA_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(328): warning: #1296-D: extended constant initialiser used

    EAP_DMA_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(355): warning: #1296-D: extended constant initialiser used

    LEXSPI_DRV_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(356): warning: #1296-D: extended constant initialiser used

    LEXSPI_DRV_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(365): warning: #1296-D: extended constant initialiser used

    LASH_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(366): warning: #1296-D: extended constant initialiser used

    LASH_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(375): warning: #1296-D: extended constant initialiser used

    RAM_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(376): warning: #1296-D: extended constant initialiser used

    RAM_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(385): warning: #1296-D: extended constant initialiser used

    ELOCODE_START,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c(386): warning: #1296-D: extended constant initialiser used

    ELOCODE_END,
    …\easy_arm_rt1052_debug\user_config\aw_prj_usr_app_init.c: 32 warnings, 0 errors
    compiling awbl_hwconf_cyw43362.c…
    compiling detection.c…
    compiling heap.c…
    compiling strnlen.c…
    compiling gmtime_r.c…
    compiling main.c…
    …\easy_arm_rt1052_debug\user_code\main.c(31): warning: #111-D: statement is unreachable
    return 0;
    …\easy_arm_rt1052_debug\user_code\main.c: 1 warning, 0 errors
    compiling mutex.c…
    aw_libc\mutex.c(54): warning: #1-D: last line of file ends without a newline
    /* end of file /
    aw_libc\mutex.c: 1 warning, 0 errors
    compiling libspace.c…
    aw_libc\libspace.c(40): warning: #1-D: last line of file ends without a newline
    /
    end of file */
    aw_libc\libspace.c: 1 warning, 0 errors
    assembling imx1052_ivt_armcc.s…
    compiling awbus_lite_hwconf_usrcfg.c…
    compiling boot_flexspi_nor_cfg.c…
    compiling aw_prj_config.c…
    …\aworks_sdk\apollo\rtk\config\all/aworks_startup.c(115): warning: #188-D: enumerated type mixed with another type
    AW_TASK_INIT(info,
    …\aworks_sdk\apollo\components\base\config\os/aw_isr_defer_cfg.c(51): warning: #188-D: enumerated type mixed with another type
    AW_DEFER_START(&g_sys_isr_defer,
    …\aworks_sdk\apollo\components\base\config\os/aw_nor_defer_cfg.c(49): warning: #188-D: enumerated type mixed with another type
    AW_DEFER_START(&g_sys_nor_defer,
    …\aworks_sdk\apollo\components\shell\config\aw_shell_serial_cfg.c(84): warning: #188-D: enumerated type mixed with another type
    __g_serial_shell.tsk = AW_TASK_INIT(__g_shell_task,
    …\aworks_sdk\apollo\components\base\config\util/aw_event_cfg.c(54): warning: #188-D: enumerated type mixed with another type
    AW_TASK_INIT(__g_event_task,
    …\aworks_sdk\apollo\components\base\config\util/aw_event_cfg.c(65): warning: #68-D: integer conversion resulted in a change of sign
    return AW_MSGQ_SEND(__g_event_msgq,
    …\aworks_sdk\apollo\components\base\config\ts/aw_ts_calc_cfg.c(106): warning: #177-D: variable “ret” was declared but never referenced
    aw_err_t ret;
    …\easy_arm_rt1052_debug\user_config\aw_prj_config.c: 7 warnings, 0 errors
    compiling sys_exit.c…
    compiling aw_bsp_mem.c…
    compiling aw_bsp_system.c…
    …\easy_arm_rt1052_debug\bsp_dtcm\aw_bsp_system.c(202): warning: #61-D: integer operation result is out of range
    } while (!(temp & (1 << 31)));
    …\easy_arm_rt1052_debug\bsp_dtcm\aw_bsp_system.c(202): warning: #68-D: integer conversion resulted in a change of sign
    } while (!(temp & (1 << 31)));
    …\easy_arm_rt1052_debug\bsp_dtcm\aw_bsp_system.c(67): warning: #177-D: function “reconfig_pll3_clock” was declared but never referenced
    static void reconfig_pll3_clock(void)
    …\easy_arm_rt1052_debug\bsp_dtcm\aw_bsp_system.c: 3 warnings, 0 errors
    linking…
    Program Size: Code=82868 RO-data=20712 RW-data=788 ZI-data=122044
    FromELF: creating hex file…
    After Build - User command #1: fromelf.exe --m32 Objects\Release_flexspi_flash\easy_arm_rt1052.axf -o Objects\Release_flexspi_flash\easy_arm_rt1052.srec
    “.\Objects\Release_flexspi_flash\easy_arm_rt1052.axf” - 0 Error(s), 47 Warning(s).
    Build Time Elapsed: 00:00:05

    D:\jenkins\workspace\git-test>set zip_cmd=D:\jenkins\workspace\git-test\tools\rar.exe

    D:\jenkins\workspace\git-test>FOR /F “delims=” %i IN (‘git rev-list HEAD -n 1’) DO set “Version=MD11-1.1.g%i”

    D:\jenkins\workspace\git-test>set “Version=MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c”

    D:\jenkins\workspace\git-test>set zip_file=D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c

    D:\jenkins\workspace\git-test>mkdir D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c
    子目录或文件 D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c 已经存在。

    D:\jenkins\workspace\git-test>set release_bin_path=D:\jenkins\workspace\git-test\projects\easy_arm_rt1052_debug_mdk\Objects\Release_flexspi_flash\easy_arm_rt1052.hex

    D:\jenkins\workspace\git-test>set release_doc_path=D:\jenkins\workspace\git-test\doc\MD11-RT1052-Release-Notes.docx

    D:\jenkins\workspace\git-test>copy D:\jenkins\workspace\git-test\projects\easy_arm_rt1052_debug_mdk\Objects\Release_flexspi_flash\easy_arm_rt1052.hex D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c
    已复制 1 个文件。

    D:\jenkins\workspace\git-test>copy D:\jenkins\workspace\git-test\doc\MD11-RT1052-Release-Notes.docx D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c
    已复制 1 个文件。

    D:\jenkins\workspace\git-test>D:\jenkins\workspace\git-test\tools\rar.exe a -df -ep -ag[yyyyMMddhhmmss] MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c-.rar D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c\

    RAR 3.92 版权 © 1993-2010 Alexander Roshal 10 二月 2010
    共享版本 输入 RAR -? 获得帮助

    评估版本,请注册

    正在创建 压缩文件 MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c-[20210113152012].rar

    正在添加 D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c\easy_arm_rt1052.hex 8% 16% 24% 33% 41% 49% 58% 66% 74% 79% 完成
    正在添加 D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c\MD11-RT1052-Release-Notes.docx 87% 95%100% 完成
    正在删除 D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c\MD11-RT1052-Release-Notes.docx 已删除
    正在删除 D:\jenkins\workspace\git-test\MD11-1.1.g64ba914a9a6ee5a4b9539eb5ea09b5780d417e4c\easy_arm_rt1052.hex 已删除
    完成

    D:\jenkins\workspace\git-test>echo Done.
    Done.

    D:\jenkins\workspace\git-test>pause
    请按任意键继续. . .
    Finished: SUCCESS

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌入式实操

希望博文有助于您,您不必加班。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值