-
-
Notifications
You must be signed in to change notification settings - Fork 938
Expand file tree
/
Copy pathbuild.gradle
More file actions
166 lines (155 loc) · 6.57 KB
/
Copy pathbuild.gradle
File metadata and controls
166 lines (155 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
* Copyright 2016 Luca Martino.
*
* 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 copyFile 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.
*/
apply plugin: 'com.android.application'
ext {
supportLibraryVersion = '1.0.0'
grpcVersion = '1.11.0'
}
android {
namespace 'nie.translator.rtranslator'
//compileSdkVersion 33 //33
ndkVersion "28.0.12674087"
defaultConfig {
applicationId "nie.translator.rtranslator"
targetSdkVersion 36 //32
compileSdk 36
versionCode 24
versionName '2.1.4'
minSdkVersion 28
externalNativeBuild {
cmake {
arguments '-DSPM_ENABLE_SHARED=OFF', //sentencepiece flags
'-DSPM_BUILD_TEST=OFF',
'-DSPM_ENABLE_TCMALLOC=OFF',
//bergamot flags
'-DANDROID_ABI=arm64-v8a',
'-DANDROID_PLATFORM=android-28',
'-DANDROID_STL=c++_shared',
"-DANDROID_PIE=ON",
"-DANDROID_CPP_FEATURES=exceptions",
'-DCMAKE_BUILD_TYPE=Release',
'-DBUILD_SHARED_LIBS=OFF',
'-DUSE_STATIC_LIBS=ON',
'-DCOMPILE_CUDA=OFF',
'-DUSE_WASM_COMPATIBLE_SOURCE=OFF',
'-DTHREADS_PREFER_PTHREAD_FLAG=ON',
'-DUSE_TCMALLOC=OFF',
'-DSSPLIT_USE_INTERNAL_PCRE2:BOOL=ON',
'-DUSE_PATHIECPP=ON',
'-DBUILD_ARCH=armv8-a',
'-GNinja',
//'-DCMAKE_C_FLAGS="-O3 -fPIC -march=armv8-a -mtune=generic -ffast-math -funroll-loops -fdata-sections -ffunction-sections"',
//'-DCMAKE_CXX_FLAGS="-O3 -fPIC -march=armv8-a -mtune=generic -ffast-math -funroll-loops -fdata-sections -ffunction-sections"',
'-DCMAKE_CXX_FLAGS="-Wno-enum-constexpr-conversion"'
cppFlags '-std=c++17'
abiFilters 'arm64-v8a'
}
}
}
buildFeatures {
prefab true
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
debuggable true
}
release {
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled false
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources false
// Includes the default ProGuard rules files that are packaged with
// the Android Gradle plugin. To learn more, go to the section about
// R8 configuration files.
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
resolutionStrategy.force "com.android.support:support-annotations:$supportLibraryVersion"
}
productFlavors {
}
externalNativeBuild {
cmake {
path file('src/main/cpp/src/CMakeLists.txt')
version '3.22.1'
}
}
}
dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
// Support libraries
implementation "com.google.android.material:material:1.9.0" //1.9.0
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.preference:preference:1.1.0-alpha02" //prima era 1.1.0-alpha02
implementation "androidx.core:core-splashscreen:1.0.1"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
//Download library
implementation 'com.github.amitshekhariitbhu:PRDownloader:1.0.2'
// DJL HuggingFace tokenizers wrapper
implementation "ai.djl.android:core:0.33.0"
implementation "ai.djl.huggingface:tokenizers:0.33.0"
implementation "ai.djl.android:tokenizer-native:0.33.0"
//protobuf
implementation "com.google.protobuf:protobuf-javalite:4.33.5"
// bouncycastle crypto lib
implementation "org.bouncycastle:bcprov-jdk15to18:1.83"
//implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'androidx.exifinterface:exifinterface:1.3.7'
//bluetooth communicator
//implementation 'com.github.niedev:BluetoothCommunicator:1.0.6'
//gallery image selector
//implementation 'com.github.niedev:GalleryImageSelector:1.0.7'
//ONNX Runtime
implementation 'com.microsoft.onnxruntime:onnxruntime-android:1.23.2' //latest.release
implementation 'com.microsoft.onnxruntime:onnxruntime-extensions-android:0.13.0' //latest.release
//Ml-Kit
implementation 'com.google.mlkit:language-id:17.0.5'
//JWS parser
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '5.1'
implementation files('libs/sqlite4java-android-release.aar')
//Room library (database)
def room_version = '2.1.0'
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version" // use kapt for Kotlin
// optional - RxJava support for Room
implementation "androidx.room:room-rxjava2:$room_version"
// optional - Guava support for Room, including Optional and ListenableFuture
implementation "androidx.room:room-guava:$room_version"
// Test helpers
testImplementation "androidx.room:room-testing:$room_version"
// Tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}