-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
280 lines (244 loc) · 9.09 KB
/
build.gradle
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
* Copyright (c) 2015-2021, Virgil Security, Inc.
*
* Lead Maintainer: Virgil Security Inc. <[email protected]>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* (3) Neither the name of virgil nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
buildscript {
ext.kotlin_version = '1.3.61'
ext.versions = [
// Virgil
virgilSdk : '7.3.2',
virgilCrypto : '0.15.2',
pythia : '0.3.7',
ratchet : '0.1.4',
// Kotlin
kotlin : '1.3.61',
coroutines : '1.3.3',
// Gradle
gradle : '3.5.3',
// Maven
mavenPublish : '3.6.2',
// Android
android : '4.1.1.4',
appCompat : '1.1.0',
// Room
room : '2.2.3',
// Docs
dokka : '0.9.18',
// Tests
junit : '4.12',
testsRunner : '1.1.1',
espresso : '3.0.2',
virgilTestCommon: '0.1',
// Benchmark
androidBenchmark: '1.0.0',
]
ext.androidOptions = [
compileSdkVersion : 28,
minSdkVersionEnclave: 23,
minSdkVersionRegular: 21,
targetSdkVersion : 28,
buildToolsVersion : "28.0.3"
]
repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.gradle"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokka"
classpath "digital.wup:android-maven-publish:$versions.mavenPublish"
classpath "androidx.benchmark:benchmark-gradle-plugin:$versions.androidBenchmark"
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
}
/**
* Gets property from system properties.
*
* @param name Of System property to get.
*
* @return System property or null if not found.
*/
def static getSystemProperty(String name) {
def property
if (System.getProperty(name) != null) {
property = System.getProperty(name)
} else {
property = System.getenv(name)
}
return property
}
/**
* Gets property from both - gradle properties and system properties.
*
* @param name Of property to get.
*/
def getGradleOrSystemProperty(String name, Project project) {
def property
if (project.hasProperty(name)) {
property = project.getProperty(name)
} else {
property = getSystemProperty(name)
}
return property
}
// Artifacts packages
final String BASE_VIRGIL_PACKAGE = 'com.virgilsecurity'
// Packages versions
final String SDK_VERSION = '2.0.10'
subprojects {
group BASE_VIRGIL_PACKAGE
version SDK_VERSION
def isRegular = (it.name == 'ethree-common'
|| it.name == 'ethree-kotlin'
|| it.name == 'ethree-enclave')
def isTest = (it.name == 'tests' || it.name == 'testsenclave')
def isBenchmark = (it.name == 'ethree-benchmark')
if (isRegular) {
apply plugin: 'com.android.library'
apply plugin: 'digital.wup.android-maven-publish'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'signing'
apply plugin: 'maven-publish'
} else if (isTest) {
apply plugin: 'com.android.application'
apply from: '../tests-verbal-output.gradle'
} else if (isBenchmark) {
apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
if (it.name == 'ethree-common') {
apply from: '../tests-verbal-output.gradle'
apply plugin: 'kotlin-kapt'
}
android {
compileSdkVersion androidOptions.compileSdkVersion
buildToolsVersion androidOptions.buildToolsVersion
defaultConfig {
targetSdkVersion androidOptions.targetSdkVersion
}
buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
}
sourceCompatibility = "8"
targetCompatibility = "8"
if (isRegular) {
task sourcesJar(type: Jar) {
from(project.android.sourceSets.main.java.srcDirs)
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: 'dokka') {
from("$buildDir/javadoc")
classifier = 'javadoc'
}
def authentication_username = getGradleOrSystemProperty('authentication_username', project)
def authentication_password = getGradleOrSystemProperty('authentication_password', project)
publishing {
publications {
mavenJava(MavenPublication) {
artifact javadocJar
artifact sourcesJar
from components.android
pom {
description = 'Virgil Security provides an SDK which symplifies work with Virgil services and presents easy to use API for adding security to any application. In a few simple steps you can setup user encryption with multidevice support.'
url = 'https://www.virgilsecurity.com/'
licenses {
license {
name = 'Virgil Security, Inc. license'
url = 'https://github.com/VirgilSecurity/virgil-e3kit-kotlin/blob/master/LICENSE.txt'
}
}
developers {
developer {
id = 'BuddahLD'
name = 'Danylo Oliinyk'
email = '[email protected]'
organizationUrl = 'https://github.com/BuddahLD'
}
developer {
id = 'andrii-iakovenko'
name = 'Andrii Iakovenko'
email = '[email protected]'
organizationUrl = 'https://github.com/andrii-iakovenko'
}
}
scm {
connection = 'scm:git:https://github.com/VirgilSecurity/virgil-e3kit-kotlin.git'
developerConnection = 'scm:git:[email protected]:VirgilSecurity/virgil-e3kit-kotlin.git'
url = 'https://github.com/VirgilSecurity/virgil-e3kit-kotlin'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username "${authentication_username}"
password "${authentication_password}"
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
reportUndocumented = false
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}