diff --git a/android-database-sqlcipher/build-openssl-libraries.sh b/android-database-sqlcipher/build-openssl-libraries.sh index 1a2d7811..1a4a2a17 100755 --- a/android-database-sqlcipher/build-openssl-libraries.sh +++ b/android-database-sqlcipher/build-openssl-libraries.sh @@ -10,17 +10,17 @@ OPENSSL=openssl-$3 (cd src/main/external/${OPENSSL}; - if [ ! ${MINIMUM_ANDROID_SDK_VERSION} ]; then + if [[ ! ${MINIMUM_ANDROID_SDK_VERSION} ]]; then echo "MINIMUM_ANDROID_SDK_VERSION was not provided, include and rerun" exit 1 fi - if [ ! ${MINIMUM_ANDROID_64_BIT_SDK_VERSION} ]; then + if [[ ! ${MINIMUM_ANDROID_64_BIT_SDK_VERSION} ]]; then echo "MINIMUM_ANDROID_64_BIT_SDK_VERSION was not provided, include and rerun" exit 1 fi - if [ ! ${ANDROID_NDK_ROOT} ]; then + if [[ ! ${ANDROID_NDK_ROOT} ]]; then echo "ANDROID_NDK_ROOT environment variable not set, set and rerun" exit 1 fi diff --git a/android-database-sqlcipher/native.gradle b/android-database-sqlcipher/native.gradle index ba2eaa81..1a863b97 100644 --- a/android-database-sqlcipher/native.gradle +++ b/android-database-sqlcipher/native.gradle @@ -1,4 +1,4 @@ -task buildOpenSSL () { +task buildOpenSSL() { onlyIf { def armNativeFile = new File("${androidNativeRootDir}/armeabi/libcrypto.a") return !armNativeFile.exists() @@ -7,14 +7,14 @@ task buildOpenSSL () { exec { workingDir "${projectDir}" commandLine "./build-openssl-libraries.sh", - "${minimumAndroidSdkVersion}", - "${minimumAndroid64BitSdkVersion}", - "${opensslVersion}" + "${minimumAndroidSdkVersion}", + "${minimumAndroid64BitSdkVersion}", + "${opensslVersion}" } } } -task buildAmalgamation () { +task buildAmalgamation() { onlyIf { def amalgamation = new File("${projectDir}/src/main/external/sqlcipher/sqlite3.c") return !amalgamation.exists() @@ -28,7 +28,7 @@ task buildAmalgamation () { exec { workingDir "${projectDir}/src/main/external/sqlcipher" environment("CFLAGS", "${sqlcipherCFlags}") - commandLine "make", "sqlite3.c" + commandLine "make", "sqlite3.c" } } } @@ -40,14 +40,14 @@ task buildNative() { "${nativeRootOutputDir}/libs32", file("src/main/cpp").absolutePath, file("src/main/cpp/Application32.mk").absolutePath, - "${sqlcipherCFlags}", "${otherSqlcipherCFlags}", - "${minimumAndroidSdkVersion}") + "${sqlcipherCFlags}", "${otherSqlcipherCFlags}", + "${minimumAndroidSdkVersion}") executeNdkBuild( "${nativeRootOutputDir}/libs64", file("src/main/cpp").absolutePath, file("src/main/cpp/Application64.mk").absolutePath, - "${sqlcipherCFlags}", "${otherSqlcipherCFlags}", - "${minimumAndroid64BitSdkVersion}") + "${sqlcipherCFlags}", "${otherSqlcipherCFlags}", + "${minimumAndroid64BitSdkVersion}") exec { workingDir "${nativeRootOutputDir}" commandLine "mkdir", "-p", "libs" @@ -66,7 +66,7 @@ task cleanOpenSSL() { doLast { logger.info "Cleaning OpenSSL source" File file = new File("${opensslDir}") - if(file.exists()){ + if (file.exists()) { file.deleteDir() } } @@ -79,8 +79,8 @@ task cleanSQLCipher() { gitClean("${sqlcipherDir}") File amalgamationSource = new File("${sqlcipherDir}/sqlite3.c") File amalgamationHeader = new File("${sqlcipherDir}/sqlite3.h") - if(amalgamationSource.exists()) amalgamationSource.delete() - if(amalgamationHeader.exists()) amalgamationHeader.delete() + if (amalgamationSource.exists()) amalgamationSource.delete() + if (amalgamationHeader.exists()) amalgamationHeader.delete() } } @@ -90,7 +90,7 @@ task cleanNative() { logger.info "Cleaning native build artifacts" ["libs", "libs32", "libs64", "obj"].each { File file = new File("${projectDir}/src/main/${it}") - if(file.exists()){ + if (file.exists()) { file.deleteDir() } } @@ -122,15 +122,15 @@ def executeNdkBuild(outputDir, androidMkDirectory, applicationMkFile, exec { def outputDirectory = "NDK_LIBS_OUT=${outputDir}" def applicationFile = "NDK_APPLICATION_MK=${applicationMkFile}" - def environmentVariables = ["SQLCIPHER_CFLAGS": "${cflags}", - "OPENSSL_DIR": "${opensslDir}", - "SQLCIPHER_DIR": "${sqlcipherDir}", + def environmentVariables = ["SQLCIPHER_CFLAGS" : "${cflags}", + "OPENSSL_DIR" : "${opensslDir}", + "SQLCIPHER_DIR" : "${sqlcipherDir}", "SQLCIPHER_OTHER_CFLAGS" : "${otherSqlcipherCFlags}", "ANDROID_NATIVE_ROOT_DIR": "${androidNativeRootDir}", - "NDK_APP_PLATFORM": "${androidVersion}"] + "NDK_APP_PLATFORM" : "${androidVersion}"] environment(environmentVariables) commandLine "ndk-build", "${ndkBuildType}", - "--environment-overrides", outputDirectory, - "-C", androidMkDirectory, applicationFile + "--environment-overrides", outputDirectory, + "-C", androidMkDirectory, applicationFile } }