编译构建 CODEARTS BUILD-对鸿蒙构建工程配置构建加速:配置示例1:依赖解析模式

时间:2025-01-13 16:48:07

配置示例1:依赖解析模式

  1. 获取json文件。

    在分支A编写BuildFlow配置中build_ref指定的accelerate.yml,示例如下:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    version: 2.0 
    
    params: 
      - name: TB_GET_ORI_TRACE
        value: "1" 
    
    steps: 
      PRE_BUILD: 
      - checkout: 
          name: "checkout" 
          inputs: 
            scm: "codehub" 
            url: "git@codehub.devcloud.example.example.com:example.git" 
            branch: "master" 
            lfs: false 
            submodule: false 
      BUILD: 
      - tbuild_execute: 
          inputs: 
            image: "swr.example.example.com/buildimage:ohos-x86-v1"
            command: "cd OpenHarmony && BuildAccelerateL3 -HarmonyOS ./build.sh --product-name rk3568 --build-target make_all --ccache false -v && post_build.sh && mv out/TBTrace_make_all_1.json /example/TB1.json"
    

  2. 执行分布式构建。

    在分支B编写BuildFlow配置中build_ref指定的accelerate.yml,示例如下:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    version: 2.0 
    
    params: 
      - name: TB_BUILDTRACE_ALL 
        value: "1" 
      - name: TB_RSYNC 
        value: ${WORKSPACE}/OpenHarmony/:out/rk3568
    
    steps: 
      PRE_BUILD: 
      - checkout: 
          name: "checkout" 
          inputs: 
            scm: "codehub" 
            url: "git@codehub.devcloud.example.example.com:example.git" 
            branch: "master" 
            lfs: false 
            submodule: false 
      BUILD: 
      - tbuild_execute: 
          inputs: 
            image: "swr.example.example.com/buildimage:ohos-x86-v1" 
            command: "mv /example/TB1.json OpenHarmony/TB1.json && cd OpenHarmony && BuildAccelerateL3 -HarmonyOS ./build.sh --product-name rk3568 --build-target make_all --ccache false -v && post_build.sh"
    

support.huaweicloud.com/usermanual-codeci/codeci_ug_1056.html