- project:
    name: #{RR}-#{RR_PROJECT}
    aosp_modules:
      - aosp:
          build_timeout: 600
          bisect_timeout: 6000
#if RR_PROJECT_code_size
      - dalvikvm
      - dex2oat
      - surfaceflinger
#endif
    build_timeout: 300
    bisect_timeout: 3000
    aosp_target:
      - oriole
    aosp_ver:
      - master
    jobs:
      - '#{RR}-#{RR_PROJECT}-{aosp_modules}--{aosp_target}-{aosp_ver}-build'
      - '#{RR}-#{RR_PROJECT}-{aosp_modules}--{aosp_target}-{aosp_ver}-bisect'
    ci_project: '#{RR}-#{RR_PROJECT}-{aosp_modules}'
    ci_config: '{aosp_target}-{aosp_ver}'

#include tcwg/round-robin.yaml.inc

- job-template:
    name: '#{RR}-#{RR_PROJECT}-{aosp_modules}--{aosp_target}-{aosp_ver}-build'
    project-type: freestyle
    defaults: global
    properties:
      - build-properties:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
    parameters:
      - build-parameters:
          default_git: 'default'
          distro: 'default'
    disabled: false
    node: tcwg-x86_64 && tcwg-build
    concurrent: false
    display-name: 'TCWG Build {ci_project}/{ci_config}'
    workspace: workspace/#{RR}_$EXECUTOR_NUMBER
    scm:
      - build-scms:
          aosp_superproject_url: 'https://android.googlesource.com/platform/superproject/main.git'
          aosp_superproject_branch: 'main'
          llvm_url: 'https://github.com/llvm/llvm-project.git'
          llvm_branch: 'main'
          # Toolchain_superproject_url doesn't have .git at the end to make it
          # different from aosp_superproject_url -- to workaround a bug in
          # git-scm.
          # When cloning 2 branches of same repository both GIT_COMMIT_n and
          # GIT_COMMIT_m get set to the sha1 value of the second branch.
          # I'm guessing git-scm plugin is indexing repos by URL, so sha1 of
          # the first branch gets overwritten.
          toolchain_superproject_url: 'https://android.googlesource.com/platform/superproject'
          toolchain_superproject_branch: 'llvm-toolchain'
    triggers:
      - pollscm:
          cron: 'H H * * *'
    wrappers:
      - build-wrappers:
          timeout: '{build_timeout}'
    builders:
      - run-build:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: '#{RR}-build.sh'
    publishers:
      - build-publishers:
          email_on_failure: false
          email_on_success: true

- job-template:
    name: '#{RR}-#{RR_PROJECT}-{aosp_modules}--{aosp_target}-{aosp_ver}-bisect'
    project-type: freestyle
    defaults: global
    properties:
      - bisect-properties:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
    parameters:
      - bisect-parameters:
          distro: 'default'
    disabled: false
    node: tcwg-x86_64 && tcwg-build && tcwg-fast-disk
    concurrent: false
    display-name: 'TCWG Bisect {ci_project}/{ci_config}'
    workspace: workspace/#{RR}_$EXECUTOR_NUMBER
    scm:
      - jenkins-scripts
    wrappers:
      - bisect-wrappers:
          timeout: '{bisect_timeout}'
    builders:
      - run-bisect:
          ci_project: '{ci_project}'
          ci_config: '{ci_config}'
          build_script: '#{RR}-build.sh'
    publishers:
      - bisect-publishers
