version: "3.7"

x-default-service: &linux
  working_dir: /qbs
  environment:
    - BUILD_OPTIONS
    - QTEST_FUNCTION_TIMEOUT
    - QBS_AUTOTEST_PROFILE
    - QBS_TEST_SOURCE_ROOT
    - WITH_ARCHIVE
    - WITH_TESTS
    - CLCACHE_DIR
  volumes:
    - .:/qbs
    - ~/.ccache:/home/devel/.ccache
  network_mode: bridge
  cap_add:
      - SYS_PTRACE

services:
  focal-qt5: &focal-qt5
    << : *linux
    hostname: focal-qt5
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-5.15.2_1.24.1-0
    build:
      dockerfile: docker/focal/Dockerfile
      context: .
      args:
        QT_VERSION: 5.15.2
        QTCREATOR_VERSION: 9.0.2

  focal-qt6:
    << : *linux
    hostname: focal-qt6
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-qt6-6.5.0_1.24.1-0
    build:
      dockerfile: docker/focal/Dockerfile
      context: .
      args:
        QT_VERSION: 6.5.0
        QTCREATOR_VERSION: 9.0.2

  focal:
    << : *focal-qt5

  focal-qt6-static:
    << : *linux
    hostname: focal-qt6-static
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-qt6-static-6.3.1_1.20.1-0
    build:
      dockerfile: docker/focal/test-qt6-static.Dockerfile
      context: .
      args:
        QT_VERSION: 6.3.1
        QTCREATOR_VERSION: 5.0.3

  focal-android-513:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-5.13.2-4
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 5.13.2
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-514:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-5.14.0-4
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 5.14.0
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-515:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-5.15.1-4
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 5.15.1
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-600:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-6.0.0-4
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 6.0.0
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-620:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-6.2.0-4
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 6.2.0
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-630:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-6.3.0-0
    build:
      dockerfile: docker/focal/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 6.3.0
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-android-ndk-r19c:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-ndk-r19c-0
    build:
      dockerfile: docker/focal/test-android-no-qt.Dockerfile
      context: .
      args:
       ANDROID_NDK_VERSION: 19.2.5345600

  focal-android-ndk-r21e:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-ndk-r21e-0
    build:
      dockerfile: docker/focal/test-android-no-qt.Dockerfile
      context: .
      args:
        ANDROID_NDK_VERSION: 21.4.7075529

  focal-android-ndk-r23:
    << : *linux
    hostname: focal-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-android-ndk-r23-0
    build:
      dockerfile: docker/focal/test-android-no-qt.Dockerfile
      context: .
      args:
        ANDROID_NDK_VERSION: 23.0.7599858

  focal-baremetal:
    << : *linux
    hostname: focal-baremetal
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-baremetal-4
    build:
      dockerfile: docker/focal/test-baremetal.Dockerfile
      context: .

  focal-qt4:
    << : *linux
    hostname: focal-qt4
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:focal-qt4-1
    build:
      dockerfile: docker/focal/test-qt4.Dockerfile
      context: .

  leap:
    << : *linux
    hostname: leap
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:leap-5.15.2_1.20.1-1
    build:
      dockerfile: docker/leap/Dockerfile
      context: .
      args:
        QT_VERSION: 5.15.2
        QTCREATOR_VERSION: 5.0.3

  windows:
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:windowsservercore-6.2.4_1.24.0-0
    build:
      dockerfile: docker/windowsservercore/Dockerfile
      context: .
      args:
        QT_VERSION: 6.2.4
        QTCREATOR_VERSION: 9.0.1
    working_dir: 'C:/qbs'
    environment:
      - BUILD_OPTIONS
      - WITH_DOCS
    volumes:
      - type: bind
        source: .
        target: C:\qbs
      - type: bind
        source: ~/.ccache
        target: C:\.ccache
    network_mode: nat
