diff --git a/src/org/mbed/tls/jenkins/BranchInfo.groovy b/src/org/mbed/tls/jenkins/BranchInfo.groovy index 20fbc910b..4d5b502fb 100755 --- a/src/org/mbed/tls/jenkins/BranchInfo.groovy +++ b/src/org/mbed/tls/jenkins/BranchInfo.groovy @@ -51,6 +51,15 @@ class BranchInfo { * done. */ public String python_requirements_override_file + /** All of the Visual Studio versions supported by this branch */ + public List supported_vs_versions + + /** Whether this branch has shipped Makefiles */ + public boolean has_shipped_makefiles + + /** Whether this branch has shipped Visual Studio solution files */ + public boolean has_shipped_vs_solutions + /** Keep track of builds that fail */ final Set failed_builds final Set outcome_stashes @@ -66,6 +75,9 @@ class BranchInfo { this.has_min_requirements = false this.python_requirements_override_content = '' this.python_requirements_override_file = '' + this.supported_vs_versions = [] + this.has_shipped_makefiles = false + this.has_shipped_vs_solutions = false this.failed_builds = [] this.outcome_stashes = [] this.coverage_details = 'Code coverage job did not run' diff --git a/vars/common.groovy b/vars/common.groovy index c7d82b114..c0fd4516b 100644 --- a/vars/common.groovy +++ b/vars/common.groovy @@ -271,6 +271,14 @@ List get_branch_information(Collection tls_branches, Collect info.python_requirements_override_file = 'override.requirements.txt' } } + + /* At the time of writing, all supported branches (3.6, development) + * advertise support for Visual Studio 2017 (VS 15.0) and above. */ + info.supported_vs_versions = ['2017'] + + // Detect support for legacy build systems (< Mbed TLS 4.0) + info.has_shipped_makefiles = fileExists('Makefile') + info.has_shipped_vs_solutions = fileExists('visualc/VS2017') } String platform = linux_platforms[0] @@ -381,15 +389,6 @@ void check_every_all_sh_component_will_be_run(Collection infos) { } } -def get_supported_windows_builds() { - def vs_builds = [] - /* At the time of writing, all supported branches (3.6, development) - * advertise support for Visual Studio 2017 (VS 15.0) and above. */ - vs_builds = ['2017'] - echo "vs_builds = ${vs_builds}" - return ['mingw'] + vs_builds -} - /* In the PR job (recognized because we set the BRANCH_NAME environment * variable), report an additional context to GitHub. * Do nothing from a job that isn't triggered from GitHub. diff --git a/vars/gen_jobs.groovy b/vars/gen_jobs.groovy index e535195b7..9425c48a2 100644 --- a/vars/gen_jobs.groovy +++ b/vars/gen_jobs.groovy @@ -321,6 +321,10 @@ def gen_windows_testing_job(BranchInfo info, String toolchain) { def prefix = "${info.prefix}Windows-${toolchain}" def build_configs, arches, build_systems, retargeted if (toolchain == 'mingw') { + if (!info.has_shipped_makefiles) { + // The mingw toolchain uses the legacy shipped Makefiles + return [:] + } build_configs = ['mingw'] arches = ['x64'] build_systems = ['shipped'] @@ -328,7 +332,7 @@ def gen_windows_testing_job(BranchInfo info, String toolchain) { } else { build_configs = ['Release', 'Debug'] arches = ['Win32', 'x64'] - build_systems = ['shipped', 'cmake'] + build_systems = info.has_shipped_vs_solutions ? ['shipped', 'cmake'] : ['cmake'] retargeted = [false, true] } @@ -434,21 +438,22 @@ def gen_windows_jobs(BranchInfo info) { } def jobs = [:] - jobs = jobs + gen_simple_windows_jobs( + jobs << gen_simple_windows_jobs( info, info.prefix + 'win32-mingw', preamble + scripts.win32_mingw_test_bat ) - jobs = jobs + gen_simple_windows_jobs( + jobs << gen_simple_windows_jobs( info, info.prefix + 'win32_msvc15_32', preamble + scripts.win32_msvc15_32_test_bat ) - jobs = jobs + gen_simple_windows_jobs( + jobs << gen_simple_windows_jobs( info, info.prefix + 'win32-msvc15_64', preamble + scripts.win32_msvc15_64_test_bat ) - for (build in common.get_supported_windows_builds()) { - jobs = jobs + gen_windows_testing_job(info, build) + for (build in info.supported_vs_versions) { + jobs << gen_windows_testing_job(info, build) } + jobs << gen_windows_testing_job(info, 'mingw') return jobs } @@ -509,7 +514,7 @@ def gen_all_example_jobs(BranchInfo info = null) { for (compiler in example.value['compilers']) { for (platform in example.value['platforms']()) { if (examples.raas_for_platform[platform]) { - jobs = jobs + gen_mbed_os_example_job( + jobs << gen_mbed_os_example_job( info, example.value['repo'], example.value['branch'], @@ -659,34 +664,34 @@ def gen_release_jobs(BranchInfo info, boolean run_examples=true) { if (env.RUN_ALL_SH == "true") { info.all_sh_components.each({component, platform -> - jobs = jobs + gen_all_sh_jobs(info, platform, component) + jobs << gen_all_sh_jobs(info, platform, component) }) } if (info.repo == 'tls') { if (env.RUN_BASIC_BUILD_TEST == "true") { - jobs = jobs + gen_code_coverage_job(info, 'ubuntu-16.04-amd64'); + jobs << gen_code_coverage_job(info, 'ubuntu-16.04-amd64'); } /* FreeBSD all.sh jobs */ if (env.RUN_FREEBSD == "true") { for (platform in common.bsd_platforms) { for (component in common.freebsd_all_sh_components) { - jobs = jobs + gen_all_sh_jobs(info, platform, component) + jobs << gen_all_sh_jobs(info, platform, component) } } } if (env.RUN_WINDOWS_TEST == "true") { - jobs = jobs + gen_windows_jobs(info) + jobs << gen_windows_jobs(info) } if (run_examples) { - jobs = jobs + gen_all_example_jobs(info) + jobs << gen_all_example_jobs(info) } if (env.PUSH_COVERITY == "true") { - jobs = jobs + gen_coverity_push_jobs(info) + jobs << gen_coverity_push_jobs(info) } }