skia2/infra/bots/recipe_modules/build/api.py
Kevin Lubick c499ec8227 Remove chromecast jobs
If we need to support the Ultras, I vote we use taskdrivers instead of
these old recipes.

Bug: skia:9899
Change-Id: I9a3adedde5e7b28d90d3f836ccab0c7fe40abd38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270440
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-02-13 19:51:12 +00:00

62 lines
1.9 KiB
Python

# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Build Skia for various platforms."""
from recipe_engine import recipe_api
from . import android
from . import canvaskit
from . import chromebook
from . import cmake
from . import default
from . import docker
from . import flutter
from . import pathkit
from . import skqp
class BuildApi(recipe_api.RecipeApi):
def __init__(self, buildername, *args, **kwargs):
b = buildername
if 'SKQP' in b and not 'Test' in b:
self.compile_fn = skqp.compile_fn
self.copy_fn = skqp.copy_build_products
elif 'Android' in b and not 'Flutter' in b:
self.compile_fn = android.compile_fn
self.copy_fn = android.copy_build_products
elif 'Chromebook' in b:
self.compile_fn = chromebook.compile_fn
self.copy_fn = chromebook.copy_build_products
elif 'Flutter' in b:
self.compile_fn = flutter.compile_fn
self.copy_fn = flutter.copy_build_products
elif 'EMCC' in b:
if 'PathKit' in b:
self.compile_fn = pathkit.compile_fn
self.copy_fn = pathkit.copy_build_products
else:
self.compile_fn = canvaskit.compile_fn
self.copy_fn = canvaskit.copy_build_products
elif 'CMake' in b:
self.compile_fn = cmake.compile_fn
self.copy_fn = cmake.copy_build_products
elif 'Docker' in b:
self.compile_fn = docker.compile_fn
self.copy_fn = docker.copy_build_products
else:
self.compile_fn = default.compile_fn
self.copy_fn = default.copy_build_products
super(BuildApi, self).__init__(*args, **kwargs)
def __call__(self, checkout_root, out_dir):
"""Compile the code."""
self.compile_fn(self.m, checkout_root, out_dir)
def copy_build_products(self, out_dir, dst):
"""Copy selected build products to dst."""
self.copy_fn(self.m, out_dir, dst)