apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 29 buildToolsVersion "29.0.3" ndkVersion "21.0.6113669" def cmake_args = '' def specific_abis = '' def main_apk_tag = '' def test_apk_tag = '' // FIPS only works with arm64 for Android. if (project.hasProperty('FIPS')) { cmake_args += '-DFIPS=1,-DCMAKE_BUILD_TYPE=Release' // Shared build. If not set, the build is static. if(project.hasProperty('Shared')) { cmake_args += ',-DBUILD_SHARED_LIBS=1' } specific_abis = 'arm64-v8a' main_apk_tag += '_fips' test_apk_tag += '_fips' } // non-FIPS else { // Shared build. If not set, the build is static. if(project.hasProperty('Shared')) { cmake_args += '-DBUILD_SHARED_LIBS=1,' main_apk_tag += '_shared' test_apk_tag += '_shared' } else { main_apk_tag += '_static' test_apk_tag += '_static' } // Release build. If not set, the build is in debug mode. if(project.hasProperty('Release')) { cmake_args += '-DCMAKE_BUILD_TYPE=Release' main_apk_tag += '_rel' test_apk_tag += '_rel' } else { main_apk_tag += '_dbg' test_apk_tag += '_dbg' } specific_abis = 'x86_64,armeabi-v7a,arm64-v8a' } defaultConfig { applicationId "software.amazon.aws.crypto.awslcandroidtestrunner" minSdkVersion 21 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { arguments cmake_args.split(',') abiFilters specific_abis.split(',') } } } externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" version "3.10.2" } } applicationVariants.all { variant -> variant.outputs.all { output -> outputFileName = "awslc${main_apk_tag}.apk" } } testVariants.all { testVariant -> testVariant.outputs.all { output -> outputFileName = "awslc${test_apk_tag}-androidTest.apk" } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.2.0' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:monitor:1.2.0@aar' }