forked from cossacklabs/themis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (102 loc) · 3.7 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
apply plugin: 'com.android.library'
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// Two necessary plugins for uploading .aar to bintray
// from: https://android.jlelse.eu/how-to-distribute-android-library-in-a-convenient-way-d43fb68304a7
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}
repositories {
google()
jcenter()
}
dependencies {
implementation project(":boringssl")
// Instrumentation tests
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
// BoringSSL requires at least API 21. Google Play as of August 2019 requires
// to target at least API 28 (but we can still support lower versions).
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
// Our tests are written in JUnit, set default runner appropriately
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
java.srcDirs = ['src/wrappers/themis/java']
manifest.srcFile 'src/wrappers/themis/android/AndroidManifest.xml'
jniLibs.srcDirs = ['libs']
}
androidTest.setRoot('tests/themis/wrappers/android')
androidTest.java.srcDirs = ['tests/themis/wrappers/android']
androidTest.manifest.srcFile 'tests/themis/wrappers/android/AndroidManifest.xml'
}
// Dependencies for instrumentation tests
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
// ensure we execute boringssl tasks first
// tasks.whenTaskAdded({Task task -> task.dependsOn('boringssl:' + task.name)})
// publishing and bitray upload tasks should not run for ':boringssl' project
tasks.whenTaskAdded { task ->
println "executing $task ..."
if (task.name != 'bintrayUpload' && task.name != 'publishProductionPublicationToMavenLocal' && task.name != 'generatePomFileForProductionPublication') {
task.dependsOn('boringssl:' + task.name)
}
}
externalNativeBuild {
ndkBuild {
path "jni/Android.mk"
}
}
}
// distribution
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/projects-release.aar")
groupId 'com.cossacklabs.com'
artifactId 'themis'
version '0.12.0'
}
}
}
bintray {
// Get Bintray credential from environment variable
user = System.getenv('BINTRAY_USER') // Get bintray User
key = System.getenv('BINTRAY_KEY') // Get bintray API Key from https://bintray.com/profile/edit -> APIKey
configurations = ['archives']
pkg {
repo = 'maven'
name = 'themis'
userOrg = 'cossacklabs'
licenses = ['Apache-2.0']
desc = 'Themis is a convenient cryptographic library for data protection. It provides secure messaging with forward secrecy and secure data storage. Themis has a unified API across 12 platforms, including Python, JavaScript, iOS/macOS, and Java/Android.'
websiteUrl = "https://cossacklabs.com/themis/"
vcsUrl = 'https://github.com/cossacklabs/themis.git'
publish = true
version {
name = '0.12.0'
released = new Date()
gpg {
sign = true
passphrase = System.getenv('BINTRAY_GPG_PASSPHRASE')
}
}
}
publications = ['Production']
}