mirror of
https://github.com/laurent22/joplin.git
synced 2026-05-07 20:02:45 +00:00
125 lines
2.9 KiB
Groovy
125 lines
2.9 KiB
Groovy
// Note: Based on part of the [react-native-builder-bob](https://github.com/callstack/react-native-builder-bob)
|
|
// Nitro module template.
|
|
|
|
buildscript {
|
|
ext.WhisperVoiceTyping = [
|
|
kotlinVersion: "2.0.21",
|
|
minSdkVersion: 24,
|
|
compileSdkVersion: 36,
|
|
targetSdkVersion: 36
|
|
]
|
|
|
|
ext.getExtOrDefault = { prop ->
|
|
if (rootProject.ext.has(prop)) {
|
|
return rootProject.ext.get(prop)
|
|
}
|
|
|
|
return WhisperVoiceTyping[prop]
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "com.android.tools.build:gradle:8.7.2"
|
|
// noinspection DifferentKotlinGradleVersion
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
}
|
|
}
|
|
|
|
def reactNativeArchitectures() {
|
|
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
}
|
|
|
|
apply plugin: "com.android.library"
|
|
apply plugin: "kotlin-android"
|
|
apply from: '../nitrogen/generated/android/WhisperVoiceTyping+autolinking.gradle'
|
|
|
|
// Disabled: Including the "com.facebook.react" plugin seems to cause "ActivityIndicatorViewManagerDelegate is defined multiple times"
|
|
// errors:
|
|
// apply plugin: "com.facebook.react"
|
|
|
|
android {
|
|
namespace "com.margelo.nitro.whispervoicetyping"
|
|
|
|
compileSdkVersion getExtOrDefault("compileSdkVersion")
|
|
|
|
defaultConfig {
|
|
minSdkVersion getExtOrDefault("minSdkVersion")
|
|
targetSdkVersion getExtOrDefault("targetSdkVersion")
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-frtti -fexceptions -Wall -fstack-protector-all"
|
|
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
abiFilters (*reactNativeArchitectures())
|
|
|
|
buildTypes {
|
|
debug {
|
|
cppFlags "-O1 -g"
|
|
}
|
|
release {
|
|
cppFlags "-O2"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path "CMakeLists.txt"
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
excludes = [
|
|
"META-INF",
|
|
"META-INF/**",
|
|
"**/libc++_shared.so",
|
|
"**/libNitroModules.so",
|
|
"**/libfbjni.so",
|
|
"**/libjsi.so",
|
|
"**/libfolly_json.so",
|
|
"**/libfolly_runtime.so",
|
|
"**/libglog.so",
|
|
"**/libhermes.so",
|
|
"**/libhermes-executor-debug.so",
|
|
"**/libhermes_executor.so",
|
|
"**/libreactnative.so",
|
|
"**/libreactnativejni.so",
|
|
"**/libturbomodulejsijni.so",
|
|
"**/libreact_nativemodule_core.so",
|
|
"**/libjscexecutor.so"
|
|
]
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig true
|
|
prefab true
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
}
|
|
}
|
|
|
|
lint {
|
|
disable "GradleCompatible"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "com.facebook.react:react-android"
|
|
implementation project(":react-native-nitro-modules")
|
|
}
|