-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
143 lines (126 loc) · 3.49 KB
/
build.gradle
File metadata and controls
143 lines (126 loc) · 3.49 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
description = "Biometrics Tutorials Android"
apply plugin: 'com.android.application'
def productRootDir = "../../../.."
def productBinDir = new File(productRootDir, "Bin")
def productBinAndroidDir = new File(productBinDir, "Android")
def productLibAndroidDir = new File(productRootDir, "Lib/Android")
def archUsed = "arm64-v8a,armeabi-v7a,x86"
def usedNdfList = ["FacesDetect45.ndf",
"FacesDetect180.ndf",
"FacesDetectSegmentsAttributes.ndf",
"FacesDetectSegmentsOrientation.ndf",
"FacesDetectSegmentsFeaturePointsTrack.ndf",
"FacesDetectSegmentsLiveness.ndf",
"FacesCreateTemplateSmall.ndf",
"FacesCreateTemplateMedium.ndf",
"FacesDetect90.ndf",
"FacesDetectSegmentsFeaturePointsDetect.ndf",
"FacesDetectSegmentsOrientation90.ndf",
"FacesCreateTemplateQuality.ndf",
"Irises.ndf",
"Fingers.ndf",
"Voices.ndf"]
buildscript {
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 23
targetSdkVersion 26
ndk {
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
signingConfigs {
debug {
keyAlias 'CredenceIDPublicKey'
keyPassword 'CredenceID'
storeFile file('../../../../../CredencePublicKeys/PublicKey.jks')
storePassword 'CredenceID'
}
release {
keyAlias 'CredenceIDPublicKey'
keyPassword 'CredenceID'
storeFile file('../../../../../CredencePublicKeys/PublicKey.jks')
storePassword
}
}
buildTypes {
debug {
minifyEnabled false
//signingConfig signingConfigs.debug
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
task deleteTemporaryFiles(type: Delete) {
for (String file : usedNdfList) {
delete "${android.sourceSets.main.assets.srcDirs[0]}/data/${file}.jet"
}
delete "${android.sourceSets.main.jniLibs.srcDirs[0]}"
}
clean {
delete fileTree(dir: productBinAndroidDir , include: "${"biometrics-tutorials"}*.*")
}
task prepareNdfFiles(type: Copy) {
from "${productBinDir}/Data"
includes = usedNdfList
rename { String fileName ->
fileName.replace('.ndf', '.ndf.jet')
}
into "${android.sourceSets.main.assets.srcDirs[0]}/data"
}
int counter = 1
archUsed.split(',').each {
String srcDir = "${productLibAndroidDir}/${it}"
String dstDir = "${android.sourceSets.main.jniLibs.srcDirs[0]}/${it}"
task "prepareNativeLibs$counter"(type: Copy) {
from srcDir
into dstDir
dependsOn(prepareNdfFiles)
}
tasks.preBuild.dependsOn("prepareNativeLibs$counter")
counter++
}
task publishApk(type: Copy) {
from "${project.buildDir}/outputs/apk/debug"
include "${project.archivesBaseName}-debug.apk"
rename "${project.archivesBaseName}-debug.apk", "${project.archivesBaseName}.apk"
into productBinAndroidDir
}
clean.dependsOn(deleteTemporaryFiles)
prepareNdfFiles.dependsOn(clean)
build.finalizedBy(publishApk)
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
api "com.android.support:support-compat:27.1.1"
api ":jna"
}
repositories {
mavenLocal()
google()
jcenter()
mavenCentral()
flatDir {
dirs "${productBinAndroidDir}/"
}
}