#
# Copyright (C) 2019-Present A-Team Digital Solutions
#

#
# BUILD COMMAND & VARIABLE EXPORTS
#
def build_command(project,
                  android_version,
                  build_jobs,
                  use_ccache):
    return (
        f"export DEVICE_NAME='{project.device_name}'; "
        f"export ROM_PATH='{project.rom_path}'; "
        f"export ANDROID_VERSION='{android_version}'; "
        f"export BUILD_JOBS='{build_jobs}'; "
        f"export BUILD_VARIANT='{project.build_variant}'; "
        f"export GAPPS_VARIANT='{project.gapps_variant}'; "
        f"export CLEAN_VARIANT='{project.clean_variant}'; "
        f"export USE_CCACHE='{str(use_ccache).capitalize()}'; "
        f"bash scripts/build.sh"
    )


#
# SYNC COMMAND & EXPORTS
#
def sync_command(project):
    return (
        f"export DEVICE_NAME='{project.device_name}'; "
        f"export ROM_PATH='{project.rom_path}'; "
        f"bash scripts/sync.sh"
    )
#
# CLEAN COMMAND
#
def clean_command(project):
    return (
        f"export DEVICE_NAME='{project.device_name}'; "
        f"export ROM_PATH='{project.rom_path}'; "
        f"export BUILD_VARIANT='{project.build_variant}'; "
        f"export CLEAN_VARIANT='{project.clean_variant}'; "
        f"bash scripts/clean.sh"
    )
