| /* |
| * Copyright (C) 2022 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| plugins { |
| id 'com.android.library' |
| } |
| |
| buildDir="../../out_memory_advice" |
| |
| android { |
| defaultConfig { |
| minSdkVersion 19 |
| compileSdkVersion 31 |
| targetSdkVersion 31 |
| versionCode 1 |
| versionName "1.1" |
| |
| consumerProguardFiles "consumer-rules.pro" |
| externalNativeBuild { |
| cmake { |
| if (project.hasProperty("stl")) { |
| arguments '-DANDROID_STL='+ project.stl |
| } else { |
| arguments '-DANDROID_STL=c++_shared' |
| } |
| } |
| } |
| } |
| |
| buildTypes { |
| debug { |
| } |
| release { |
| minifyEnabled false |
| proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| } |
| } |
| |
| externalNativeBuild { |
| cmake { |
| path "CMakeLists.txt" |
| } |
| } |
| |
| compileOptions { |
| sourceCompatibility JavaVersion.VERSION_1_8 |
| targetCompatibility JavaVersion.VERSION_1_8 |
| } |
| |
| externalNativeBuild { |
| cmake { |
| path "CMakeLists.txt" |
| version "3.18.0+" |
| } |
| } |
| |
| buildFeatures { |
| prefabPublishing true |
| } |
| prefab { |
| memory_advice { |
| headers "include" |
| } |
| |
| memory_advice_static { |
| headers "include" |
| } |
| } |
| |
| // If we don't include this line the created .aar contains the c++ std lib |
| // at <.aar_file>/jni/<abi>/libc++_shared.so. When we have multiple |
| // libraries containing libc++_shared.so the linker complains because it |
| // can't choose between them. Because we use prefab we don't need to |
| // contents of the <.aar_file>/jni/* folder so we can just exclude it here |
| // to prevent the jni folder from being created. |
| packagingOptions { |
| exclude("**.so") |
| } |
| } |
| |
| repositories { |
| mavenCentral() |
| } |