version: 2
accept_configuration:
  condition: or
  conditions:
      - condition: and
        conditions:
          - condition: property  # No cross compilation
            property: host.os
            equals_property: target.os
          - condition: property  # qtnamespace is not supported
            property: configureArgs
            not_contains_value: -qtnamespace
          - condition: property  # no-widgets is notsupported
            property: configureArgs
            not_contains_value: -no-widgets
          - condition: property  # no-gui is not supported
            property: configureArgs
            not_contains_value: -no-gui
          - condition: property   # Following configs are not supported
            property: target.osVersion
            not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15]
          - condition: property  # MibnGW and msvc2015 are not supported
            property: target.compiler
            not_in_values: [Mingw73, MSVC2015]
      - condition: and
        conditions:
          - condition: property
            property: target.osVersion
            equals_value: Ubuntu_18_04
          - condition: property
            property: features
            contains_value: LicenseCheck

upload_pyside: &upload_pyside
     type: Group
     instructions:
       - type: UploadArtifact
         archiveDirectory: "{{.AgentWorkingDir}}\\pyside"
         transferType: UploadModuleBuildArtifact
         maxTimeInSeconds: 1200
         maxTimeBetweenOutput: 1200
         enable_if:
           condition: property
           property: host.os
           equals_value: Windows
       - type: UploadArtifact
         archiveDirectory: "{{.AgentWorkingDir}}/pyside"
         transferType: UploadModuleBuildArtifact
         maxTimeInSeconds: 1200
         maxTimeBetweenOutput: 1200
         enable_if:
           condition: property
           property: host.os
           not_equals_value: Windows

instructions:
     LicenseCheck:
      - !include "{{pyside/pyside-setup}}/execute_license_check.yaml"
     Build:
      - !include "{{pyside/pyside-setup}}/common_environment.yaml"
      - !include "{{pyside/pyside-setup}}/find_path_to_msvc_compiler.yaml"
      - !include "{{pyside/pyside-setup}}/execute_build_instructions.yaml"
      - *upload_pyside
     Test:
      - !include "{{pyside/pyside-setup}}/common_environment.yaml"
      - !include "{{pyside/pyside-setup}}/find_path_to_msvc_compiler.yaml"
      - !include "{{pyside/pyside-setup}}/relocate_pyside.yaml"
      - !include "{{pyside/pyside-setup}}/execute_test_instructions.yaml"
