Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
174 lines (152 loc) · 5.71 KB
/
Copy pathbuild.gradle
File metadata and controls
174 lines (152 loc) · 5.71 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
167
168
169
170
171
172
173
174
apply plugin: 'com.android.library'
apply plugin: "maven-publish"
apply plugin: "signing"
android {
compileSdkVersion 34
namespace "net.zetetic.database"
defaultConfig {
minSdkVersion "${rootProject.ext.minSdkVersion}"
targetSdkVersion 34
versionCode 1
versionName "${rootProject.ext.libraryVersion}"
project.archivesBaseName = "sqlcipher-android-${versionName}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
consumerProguardFile 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
releaseNoX86 {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
debug {
minifyEnabled false
debuggable true
jniDebuggable true
ndk {
// Building with NDK_DEBUG=1 for mips crashes the compiler in ndk 14.
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
//sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
ndkVersion "${rootProject.ext.androidNdkVersion}"
useLibrary 'android.test.base' // for android.test.AndroidTestCase
useLibrary 'android.test.runner' // for android.test.MoreAsserts
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Needed for the Support API interfaces
implementation "androidx.sqlite:sqlite:${rootProject.ext.androidXSQLiteVersion}"
// Needed for the Support API in tests
androidTestImplementation "androidx.room:room-common:${rootProject.ext.roomVersion}"
androidTestImplementation "androidx.room:room-runtime:${rootProject.ext.roomVersion}"
androidTestAnnotationProcessor "androidx.room:room-compiler:${rootProject.ext.roomVersion}"
// Needed for supporting tests
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test:core:1.4.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'junit:junit:4.13.2'
}
allprojects {
repositories {
// The order in which you list these repositories matter.
google()
}
}
def isReleaseBuild() {
return mavenVersionName.contains("SNAPSHOT") == false
}
static def getReleaseRepositoryUrl() {
return "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
}
def getRepositoryUsername() {
return hasProperty('nexusUsername') ? nexusUsername : ""
}
def getRepositoryPassword() {
return hasProperty('nexusPassword') ? nexusPassword : ""
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects { ext."signing.keyId" = "${signingKeyId}" }
allprojects { ext."signing.secretKeyRingFile" = "${signingKeyRingFile}" }
allprojects { ext."signing.password" = "${signingKeyPassword}" }
}
}
afterEvaluate {
publishing {
publications {
mavenJava(MavenPublication) {
groupId = "net.zetetic"
artifactId = "sqlcipher-android"
version = "${rootProject.ext.mavenVersionName}"
from components.release
pom {
name = "sqlcipher-android"
packaging = "aar"
description = "SQLCipher for Android a library that provides full database encryption."
url = "https://www.zetetic.net/sqlcipher"
scm {
url = "https://github.com/sqlcipher/sqlcipher-android.git"
connection = "scm:git:https://github.com/sqlcipher/sqlcipher-android.git"
developerConnection = "scm:git:https://github.com/sqlcipher/sqlcipher-android.git"
}
licenses {
license {
url = "https://www.zetetic.net/sqlcipher/license/"
}
}
developers {
developer {
name = "Zetetic Support"
email = "support@zetetic.net"
organization = "Zetetic LLC"
organizationUrl = "https://www.zetetic.net"
}
}
}
}
}
repositories {
maven {
def repoUrl = getReleaseRepositoryUrl()
url = repoUrl
credentials {
username = getRepositoryUsername()
password = getRepositoryPassword()
}
}
}
}
signing {
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications.mavenJava
}
}