onnxruntime/tools/ci_build/github/azure-pipelines/templates/android-java-api-aar.yml
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

108 lines
3.3 KiB
YAML

parameters:
- name: buildConfig
displayName: Configuration to build
type: string
default: 'Release'
- name: buildSettings
displayName: Path to the build setting file
type: string
default: ''
- name: includedOpsConfig
displayName: Path to the included ops config file
type: string
default: ''
- name: artifactName
displayName: Artifact Name
type: string
default: ''
- name: job_name_suffix
displayName: Job name
type: string
default: ''
- name: publish_executables
# The executables will only be published if the publish_executables is set to "1"
displayName: Publish executables such as onnxruntime_perf_test, ...
type: string
default: '0'
- name: pool_name
displayName: Pool name
type: string
default: 'onnxruntime-Ubuntu2204-AMD-CPU'
- name: packageName
displayName: Package Name
type: string
default: 'onnxruntime-android'
jobs:
- job: Android_Java_API_AAR_Packaging_${{ parameters.job_name_suffix }}
timeoutInMinutes: 120
workspace:
clean: all
pool: ${{parameters.pool_name}}
variables:
artifacts_directory: $(Build.BinariesDirectory)/.artifacts
steps:
- checkout: self
clean: true
submodules: none
- task: CmdLine@2
displayName: Create artifacts directory
inputs:
script: |
# Create a folder for artifacts
mkdir -p $(artifacts_directory)
workingDirectory: $(Build.BinariesDirectory)
#TODO: use a different docker file since this job doesn't need to rely on manylinux
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cpu
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--build-arg BUILD_UID=$( id -u )"
Repository: onnxruntimecpubuild
- template: set-version-number-variables-step.yml
- template: use-android-ndk.yml
- task: CmdLine@2
displayName: Build Android AAR Packages
inputs:
script: |
set -e -x
NDK_HOME=$(realpath $ANDROID_NDK_HOME)
mkdir $(Build.BinariesDirectory)/.build_settings
cp ${{parameters.buildSettings}} $(Build.BinariesDirectory)/.build_settings/build_settings.json
[ -f "${{parameters.includedOpsConfig}}" ] && \
cp ${{parameters.includedOpsConfig}} $(Build.BinariesDirectory)/.build_settings/include_ops_and_types.config
docker run --rm \
--volume $(Build.SourcesDirectory):/onnxruntime_src \
--volume $(Build.BinariesDirectory):/build \
--volume $ANDROID_HOME:/android_home \
--volume $NDK_HOME:/ndk_home \
--volume $(artifacts_directory):/home/onnxruntimedev/.artifacts \
--volume $(Build.BinariesDirectory)/.build_settings:/home/onnxruntimedev/.build_settings \
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
-e BUILD_CONFIG=${{parameters.buildConfig}} \
-e ORT_VERSION=$(OnnxRuntimeVersion) \
-e PUBLISH_EXECUTABLES=${{parameters.publish_executables}} \
-e PACKAGE_NAME=${{parameters.packageName}} \
onnxruntimecpubuild \
/bin/bash /onnxruntime_src/tools/ci_build/github/android/build_aar_and_copy_artifacts.sh
workingDirectory: $(Build.SourcesDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(artifacts_directory)'
artifactName: '${{parameters.artifactName}}'