sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

def commonScriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/'
def migrationsScriptsUrl = 'https://raw.githubusercontent.com/reportportal/migrations/'

project.ext {
    releaseMode = project.hasProperty("releaseMode")
    scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'develop')
    migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop')
    testScriptsSrc = [
            (migrationsUrl + '/migrations/0_extensions.up.sql')                        : 'V001__extensions.sql',
            (migrationsUrl + '/migrations/1_initialize_schema.up.sql')                 : 'V002__initialize_schema.sql',
            (migrationsUrl + '/migrations/3_default_data.up.sql')                      : 'V003__default_data.sql',
            (migrationsUrl + '/migrations/4_size_limitations.up.sql')                  : 'V004__size_limitations.sql',
            (migrationsUrl + '/migrations/5_test_case_id_type.up.sql')                 : 'V005__test_case_id_type.sql',
            (migrationsUrl + '/migrations/6_retries_handling.up.sql')                  : 'V006__retries_handling.sql',
            (migrationsUrl + '/migrations/7_auth_integration.up.sql')                  : 'V007__auth_integration.sql',
            (migrationsUrl + '/migrations/8_sender_case_enabled_field.up.sql')         : 'V008__sender_case_enabled_field.sql',
            (migrationsUrl + '/migrations/9_analyzer_params.up.sql')                   : 'V009__analyzer_params.sql',
            (migrationsUrl + '/migrations/10_attachment_size.up.sql')                  : 'V010__attachment_size.sql',
            (migrationsUrl + '/migrations/11_password_encoding.up.sql')                : 'V011__password_encoding.sql',
            (migrationsUrl + '/migrations/12_remove_ticket_duplicates.up.sql')         : 'V012__remove_ticket_duplicates.sql',
            (migrationsUrl + '/migrations/13_add_allocated_storage_per_project.up.sql'): 'V013__add_allocated_storage_per_project.sql',
            (migrationsUrl + '/migrations/14_test_case_id_size_increase.up.sql')       : 'V014__test_case_id_size_increase.sql',

    ]
    excludeTests = [
            'com/epam/ta/reportportal/jooq/**',
            'com/epam/ta/reportportal/config/**',
            'com/epam/ta/reportportal/commons/accessible',
            'com/epam/ta/reportportal/commons/querygen/constant',
            'com/epam/ta/reportportal/exception',
            'com/epam/ta/reportportal/entity/oauth',
            'com/epam/ta/reportportal/entity/bts',
            'com/epam/ta/reportportal/entity/ldap',
            'com/epam/ta/reportportal/entity/widget/content/**'
    ]
    limits = [
            'instruction': 70,
            'branch'     : 36,
            'line'       : 60,
            'complexity' : 49,
            'method'     : 55,
            'class'      : 87
    ]
}

wrapper {
    gradleVersion = '6.0'
}
