66 lines
2.1 KiB
Groovy
66 lines
2.1 KiB
Groovy
plugins {
|
|
id 'com.android.library'
|
|
id 'org.jetbrains.kotlin.android'
|
|
}
|
|
def ext = rootProject.ext
|
|
android {
|
|
namespace 'com.engineer.ai'
|
|
compileSdk ext.compileSdk
|
|
|
|
defaultConfig {
|
|
minSdk ext.minSdk
|
|
targetSdk ext.targetSdk
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
// Sanity check if you have trained and downloaded TF Lite model.
|
|
preBuild.doFirst {
|
|
assert file("./src/main/assets/mnist.tflite").exists(): "mnist.tflite not found. Make sure you have trained and " + "downloaded your TensorFlow Lite model to assets/ folder"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_21
|
|
targetCompatibility JavaVersion.VERSION_21
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '21'
|
|
}
|
|
androidResources {
|
|
noCompress = 'tflite'
|
|
}
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
implementation "androidx.core:core-ktx:${ext.core_ktx}"
|
|
implementation "androidx.appcompat:appcompat:$ext.androidx_appcompat"
|
|
implementation "com.google.android.material:material:${ext.androidx_material}"
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
|
|
// AndroidDraw Library
|
|
implementation 'com.github.divyanshub024:AndroidDraw:v0.1'
|
|
implementation 'com.google.android.gms:play-services-tasks:18.2.0'
|
|
|
|
// implementation 'org.pytorch:pytorch_android:1.10.0'
|
|
// implementation 'org.pytorch:pytorch_android_torchvision:1.10.0'
|
|
|
|
// LiteRT dependencies for Google Play services
|
|
implementation 'com.google.android.gms:play-services-tflite-java:16.4.0'
|
|
// Optional: include LiteRT Support Library
|
|
implementation 'com.google.android.gms:play-services-tflite-support:16.4.0'
|
|
} |