mac_dummy.py (1477B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 """ 5 Add dependencies to dummy macosx64 tasks. 6 """ 7 8 from taskgraph.transforms.base import TransformSequence 9 10 transforms = TransformSequence() 11 12 13 @transforms.add 14 def add_dependencies(config, jobs): 15 for job in jobs: 16 dependencies = {} 17 18 platform = job.get("attributes", {}).get("build_platform") 19 if not platform: 20 continue 21 arm = platform.replace("macosx64", "macosx64-aarch64") 22 intel = platform.replace("macosx64", "macosx64-x64") 23 for dep_task in config.kind_dependencies_tasks.values(): 24 # Weed out unwanted tasks. 25 if dep_task.attributes.get("build_platform"): 26 if dep_task.attributes["build_platform"] not in (platform, arm, intel): 27 continue 28 # Add matching tasks to deps 29 dependencies[dep_task.label] = dep_task.label 30 # Pick one task to copy run-on-projects from 31 if ( 32 dep_task.kind == "build" 33 and dep_task.attributes["build_platform"] == platform 34 ): 35 job["run-on-projects"] = dep_task.attributes.get("run_on_projects") 36 37 job.setdefault("dependencies", {}).update(dependencies) 38 job["if-dependencies"] = list(dependencies) 39 40 yield job