whisper_flutter_new/android/build.gradle

71 lines
2.0 KiB
Groovy
Raw Normal View History

/*
* Copyright (c) [] 2021-2024.
* All Rights Reserved.
* All codes are protected by China's regulations on the protection of computer software, and infringement must be investigated.
* (c) [] 2021-2024.
* .
*/
// The Android Gradle Plugin builds the native code with the Android NDK.
group 'com.devac.whisper_flutter'
version '1.0'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// The Android Gradle Plugin knows how to build native code with the NDK.
classpath 'com.android.tools.build:gradle:8.4.2'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
android {
if (project.android.hasProperty("namespace")) {
namespace "com.devac.whisper_flutter_new"
}
ndkVersion "27.0.11902837"
compileSdk 34
// Invoke the shared CMake build with the Android Gradle Plugin.
externalNativeBuild {
cmake {
path "../src/CMakeLists.txt"
version "3.22.1"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
defaultConfig {
minSdkVersion 21
ndk {
// Flutter does not currently support building for x86 Android (See Issue 9253).
abiFilters("armeabi-v7a", "x86_64", "arm64-v8a", "x86")
}
externalNativeBuild {
cmake {
cFlags "-O3 -s -flto=thin -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden"
cppFlags "-O3 -s -flto=thin -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden"
arguments "-Wl,--gc-sections,--exclude-libs,ALL", "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=Release"
}
}
}
}