onnxruntime/tools/android_custom_build/scripts/build.sh
Edward Chen 981893c318
Remove deprecated "mobile" packages (#20941)
# Description

This PR removes the building of the ORT "mobile" packages and much of the associated infrastructure which is no longer needed.

Not removed yet - tools/ci_build/github/android/mobile_package.required_operators.config and the helper scripts that depend on it.

# Motivation and Context

The mobile packages were deprecated in 1.18. Users should use the full packages (Android - onnxruntime-android, iOS - onnxruntime-c/onnxruntime-objc) instead or do a custom build.
2024-06-07 16:20:32 -05:00

34 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Note: This script is intended to be run by ../build_custom_android_package.py in a Docker container.
set -e -x
USAGE_TEXT="Usage: ${0} <build config> <output directory> <build settings file> [<ops config file>]"
BUILD_CONFIG=${1:?${USAGE_TEXT}}
OUTPUT_DIR=${2:?${USAGE_TEXT}}
BUILD_SETTINGS_FILE=${3:?${USAGE_TEXT}}
OPS_CONFIG_FILE=${4} # optional input
# build in directory that is not shared with the host to avoid permissions issues and speed up file access
BUILD_DIR=/workspace/build
# build ORT AAR
if [[ -n "${OPS_CONFIG_FILE}" ]]; then
python3 /workspace/onnxruntime/tools/ci_build/github/android/build_aar_package.py \
--build_dir="${BUILD_DIR}" \
--config="${BUILD_CONFIG}" \
--include_ops_by_config="${OPS_CONFIG_FILE}" \
"${BUILD_SETTINGS_FILE}"
else
python3 /workspace/onnxruntime/tools/ci_build/github/android/build_aar_package.py \
--build_dir="${BUILD_DIR}" \
--config="${BUILD_CONFIG}" \
"${BUILD_SETTINGS_FILE}"
fi
# copy AAR to output directory
cp -r "${BUILD_DIR}/aar_out" "${OUTPUT_DIR}"