Skip to content

Commit e4eb1a8

Browse files
Remove need for OPENSSL_ANDROID_LIB_ROOT environment variable in build
1 parent ce7026a commit e4eb1a8

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ clean:
77
$(GRADLE) clean
88

99
distclean:
10-
$(GRADLE) distclean
10+
$(GRADLE) distclean \
11+
-PsqlcipherRoot="$(SQLCIPHER_ROOT)"
1112

1213
build-openssl:
1314
$(GRADLE) buildOpenSSL
@@ -18,16 +19,19 @@ check:
1819
format:
1920
$(GRADLE) editorconfigFormat
2021

21-
build-debug: check
22+
build-debug:
2223
$(GRADLE) android-database-sqlcipher:bundleDebugAar \
23-
-PdebugBuild=true
24+
-PdebugBuild=true \
25+
-PsqlcipherRoot="$(SQLCIPHER_ROOT)" \
26+
-PopensslRoot="$(OPENSSL_ROOT)" \
27+
-PsqlcipherCFlags="$(SQLCIPHER_CFLAGS)" \
28+
-PsqlcipherAndroidClientVersion="$(SQLCIPHER_ANDROID_VERSION)"
2429

2530
build-release:
2631
$(GRADLE) android-database-sqlcipher:bundleReleaseAar \
2732
-PdebugBuild=false \
2833
-PsqlcipherRoot="$(SQLCIPHER_ROOT)" \
2934
-PopensslRoot="$(OPENSSL_ROOT)" \
30-
-PopensslAndroidLibRoot="$(OPENSSL_ANDROID_LIB_ROOT)" \
3135
-PsqlcipherCFlags="$(SQLCIPHER_CFLAGS)" \
3236
-PsqlcipherAndroidClientVersion="$(SQLCIPHER_ANDROID_VERSION)"
3337

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ SQLCIPHER_ROOT=/some/path/to/sqlcipher-folder \
144144
OPENSSL_ROOT=/some/path/to/openssl-folder \
145145
SQLCIPHER_ANDROID_VERSION="4.4.3" \
146146
SQLCIPHER_CFLAGS="-DSQLITE_HAS_CODEC" \
147-
OPENSSL_ANDROID_LIB_ROOT=/some/path/for/android/native/lib/creation \
148147
make build-release
149148
```
150149

android-database-sqlcipher/native.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ task buildOpenSSL() {
1111
return !armNativeFile.exists()
1212
}
1313
doLast {
14+
def nativeRootDirectory = new File("${androidNativeRootDir}")
15+
if(!nativeRootDirectory.exists()){
16+
nativeRootDirectory.mkdirs()
17+
}
1418
exec {
1519
workingDir "${projectDir}"
1620
commandLine "./build-openssl-libraries.sh",
@@ -79,13 +83,13 @@ task buildNative() {
7983
}
8084

8185
task cleanOpenSSL() {
82-
description "Clean the OpenSSL source"
86+
description "Clean the OpenSSL native libraries"
8387
doLast {
84-
logger.info "Cleaning OpenSSL source"
88+
logger.info "Cleaning OpenSSL native libraries"
8589
exec {
86-
workingDir "${opensslDir}"
90+
workingDir "${androidNativeRootDir}"
8791
ignoreExitValue true
88-
commandLine "make", "clean"
92+
commandLine "rm", "-rf"
8993
}
9094
}
9195
}

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ ext {
6767
if(project.hasProperty('sqlcipherRoot')) {
6868
sqlcipherDir = "${sqlcipherRoot}"
6969
}
70-
if(project.hasProperty('opensslAndroidLibRoot')) {
71-
androidNativeRootDir = "${opensslAndroidLibRoot}"
72-
} else {
73-
androidNativeRootDir = "${nativeRootOutputDir}/external/android-libs"
74-
}
70+
androidNativeRootDir = "${nativeRootOutputDir}/external/android-libs"
7571
if(project.hasProperty('opensslRoot')) {
7672
opensslDir = "${opensslRoot}"
7773
}

0 commit comments

Comments
 (0)