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
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 */
24import androidx.build.SoftwareType
25
26apply plugin: 'AndroidXPlugin'
27apply plugin: 'com.android.library'
28
29ext {
30    yuvSourceDir = "${project.rootDir.absolutePath}/../../external/libyuv"
31}
32
33android {
34    defaultConfig {
35        externalNativeBuild {
36            cmake {
37                arguments "-DCMAKE_POLICY_DEFAULT_CMP0064=NEW",
38                                "-DCMAKE_VERBOSE_MAKEFILE=ON"
39                // Build only the static library target
40                targets "yuv"
41            }
42        }
43    }
44
45    externalNativeBuild {
46        cmake {
47            version = libs.versions.cmake.get()
48            path "${yuvSourceDir}/CMakeLists.txt"
49        }
50    }
51
52    // Enable generation of Prefab packages and include them in the library's AAR.
53    buildFeatures {
54        prefabPublishing = true
55    }
56
57    // Include the "libyuv" module from the native build system in the AAR,
58    // and export the headers in include to its consumers
59    prefab {
60        libyuv {
61            headers = "${yuvSourceDir}/include"
62            name = "yuv"
63        }
64    }
65    namespace = "com.google.libyuv"
66}
67
68androidx {
69    name = "libyuv"
70    // Only intended to be used as snapshots, do not change to PUBLISHED.
71    type = SoftwareType.SNAPSHOT_ONLY_LIBRARY
72    inceptionYear = "2021"
73    description = "libyuv is an open source project that includes YUV scaling and conversion functionality."
74}
75