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
  volumes:
    - .:/qbs
    - ~/.ccache:/home/devel/.ccache
    - /cores:/cores
  network_mode: bridge
  cap_add:
      - SYS_PTRACE
  ulimits:
    core:
      soft: -1
      hard: -1

services:
  noble-qt6: &noble-qt6
    << : *linux
    hostname: noble-qt6
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:noble-qt6-6.8.3_2.5.1-1
    build:
      dockerfile: docker/noble/Dockerfile
      context: .
      args:
        QT_VERSION: 6.8.3
        QBS_VERSION: 2.5.1

  noble:
    << : *noble-qt6

  noble-qt5:
    << : *linux
    hostname: noble-qt5
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:noble-5.15.2_2.5.1-2
    build:
      dockerfile: docker/noble/Dockerfile
      context: .
      args:
        QT_VERSION: 5.15.2
        QBS_VERSION: 2.5.1

  noble-android-65:
    << : *linux
    hostname: noble-android
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:noble-android-6.5.0-0
    build:
      dockerfile: docker/noble/test-android.Dockerfile
      context: .
      args:
        QT_VERSION: 6.5.0
        ANDROID_NDK_VERSION: 25.1.8937393

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

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

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

  noble-qt6-static:
    << : *linux
    hostname: noble-qt6-static
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:noble-qt6-static-6.5.3_2.3.2-0
    build:
      dockerfile: docker/noble/test-qt6-static.Dockerfile
      context: .
      args:
        QT_VERSION: 6.5.3
        QTCREATOR_VERSION: 13.0.2

  noble-qt6-wasm:
    << : *linux
    hostname: noble-qt6-wasm
    image: ${DOCKER_USER:-qbsbuild}/qbsdev:noble-qt6-wasm-6.7.3-0
    build:
      dockerfile: docker/noble/test-qt6-wasm.Dockerfile
      context: .
      args:
        QT_VERSION: 6.7.3
        EMSCRIPTEN_VERSION: 3.1.50

  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.8.3_3.0.1-1
    build:
      dockerfile: docker/windowsservercore/Dockerfile
      context: .
      args:
        QT_VERSION: 6.8.3
        QBS_VERSION: 3.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
