Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Tiem Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 17 | /** |
| 18 | * This file was created using the `create_project.py` script located in the |
| 19 | * `<AndroidX root>/development/project-creator` directory. |
| 20 | * |
| 21 | * Please use that script when creating a new project, rather than copying an existing project and |
| 22 | * modifying its settings. |
| 23 | */ |
Dustin Lam | 0a035d9 | 2021-11-29 11:54:36 -0800 | [diff] [blame] | 24 | import androidx.build.LibraryType |
Dustin Lam | 0a035d9 | 2021-11-29 11:54:36 -0800 | [diff] [blame] | 25 | |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 26 | apply plugin: 'AndroidXPlugin' |
| 27 | apply plugin: 'com.android.library' |
| 28 | |
| 29 | ext { |
| 30 | yuvSourceDir = "${project.rootDir.absolutePath}/../../external/libyuv" |
| 31 | } |
| 32 | |
| 33 | android { |
| 34 | defaultConfig { |
| 35 | externalNativeBuild { |
| 36 | cmake { |
Will McVicker | 0c79faa | 2024-01-18 15:05:27 -0800 | [diff] [blame] | 37 | arguments "-DCMAKE_POLICY_DEFAULT_CMP0064=NEW", |
| 38 | "-DCMAKE_VERBOSE_MAKEFILE=ON" |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 39 | // Build only the static library target |
| 40 | targets "yuv" |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | externalNativeBuild { |
| 46 | cmake { |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 47 | version = libs.versions.cmake.get() |
Alan Viverette | bee83bf | 2023-08-28 12:45:31 -0400 | [diff] [blame] | 48 | path "${yuvSourceDir}/CMakeLists.txt" |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 49 | } |
| 50 | } |
| 51 | |
| 52 | // Enable generation of Prefab packages and include them in the library's AAR. |
| 53 | buildFeatures { |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 54 | prefabPublishing = true |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | // Include the "libyuv" module from the native build system in the AAR, |
Alan Viverette | bee83bf | 2023-08-28 12:45:31 -0400 | [diff] [blame] | 58 | // and export the headers in include to its consumers |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 59 | prefab { |
| 60 | libyuv { |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 61 | headers = "${yuvSourceDir}/include" |
| 62 | name = "yuv" |
Trevor McGuire | b7854fb | 2021-07-23 16:42:47 -0700 | [diff] [blame] | 63 | } |
| 64 | } |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 65 | namespace = "com.google.libyuv" |
Jeff Gaston | a4baa26 | 2021-11-02 15:29:55 -0400 | [diff] [blame] | 66 | } |
| 67 | |
Dustin Lam | 0a035d9 | 2021-11-29 11:54:36 -0800 | [diff] [blame] | 68 | androidx { |
| 69 | name = "libyuv" |
| 70 | // Only intended to be used as snapshots, do not change to PUBLISHED. |
Omar Ismail | a293b97 | 2024-12-16 12:18:54 +0000 | [diff] [blame] | 71 | type = LibraryType.SNAPSHOT_ONLY_LIBRARY |
Dustin Lam | 0a035d9 | 2021-11-29 11:54:36 -0800 | [diff] [blame] | 72 | inceptionYear = "2021" |
| 73 | description = "libyuv is an open source project that includes YUV scaling and conversion functionality." |
| 74 | } |