Files
Hippy/framework/voltron/android/build.gradle
lvfen 0d4b2558ef feat(voltron): publish voltron 0.0.31 (#3375)
* feat(voltron): publish voltron 0.0.31

* feat(voltron): publish voltron 0.0.31

* feat(voltron): publish voltron 0.0.31

* feat(voltron): voltron build gradle fix

* feat(voltron): voltron 0.32 publish
2023-07-20 06:20:45 +00:00

134 lines
2.9 KiB
Groovy

group 'com.tencent.flutter_render'
version '1.0-SNAPSHOT'
buildscript {
ext {
kotlin_version = '1.6.20'
THIRD_PARTY_LIBRARY_PATH = "$projectDir.absolutePath/src/main/jni/third_party"
JNI_LIBRARY_PATH = "$projectDir.absolutePath/libs"
// 默认不编译C++代码,可以加快编译速度和调试速度(默认关闭LLVM调试器)
// 系统环境里面没有从local.properties里面取
def file = rootProject.file('local.properties')
Properties properties = new Properties()
if (file.exists()) {
properties.load(file.newDataInputStream())
enableLocalCmake = Boolean.valueOf(properties.getProperty('enableLocalCmake', "false"))
}
if (!enableLocalCmake) {
def enable = System.getenv("ENABLE_LOCAL_CMAKE")
println("system env enable local cmake:$enable")
if (enable == "true") {
println("system env enable local cmake inner:$enable")
enableLocalCmake = true
} else {
enableLocalCmake = false
}
}
println("enable local cmake:$enableLocalCmake")
}
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.novoda:bintray-release:0.9.2'
}
}
rootProject.allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 32
publishNonDefault true
ndkVersion = NDK_VERSION
defaultConfig {
minSdkVersion 21
consumerProguardFiles "proguard-rules.pro"
if (enableLocalCmake) {
externalNativeBuild {
cmake {
cppFlags "-std=c++17"
arguments "-DJS_ENGINE=V8",
"-DANDROID_CPP_FEATURES=no-rtti no-exceptions",
"-DANDROID_PLATFORM=android-21",
"-DANDROID_STL=$ANDROID_STL",
"-DV8_COMPONENT=$V8_COMPONENT",
"-DENABLE_INSPECTOR=$ENABLE_INSPECTOR",
"-DHIDDEN_LIBRARY_SYMBOL=$HIDDEN_LIBRARY_SYMBOL"
}
}
}
}
buildTypes {
profile {
minifyEnabled false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
jniDebuggable true
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
main {
if (!enableLocalCmake) {
jniLibs.srcDirs = ['libs']
}
}
}
if (enableLocalCmake) {
externalNativeBuild {
cmake {
version CMAKE_VERSION
path "../core/CMakeLists.txt"
}
}
}
lintOptions {
disable 'InvalidPackage'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}