Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build.gradle 8.82 KiB
/******************************************************************************
 * Corona-Warn-App                                                            *
 *                                                                            *
 * SAP SE and all other contributors /                                        *
 * copyright owners license this file to you under the Apache                 *
 * License, Version 2.0 (the "License"); you may not use this                 *
 * file except in compliance with the License.                                *
 * You may obtain a copy of the License at                                    *
 *                                                                            *
 * http://www.apache.org/licenses/LICENSE-2.0                                 *
 *                                                                            *
 * Unless required by applicable law or agreed to in writing,                 *
 * software distributed under the License is distributed on an                *
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY                     *
 * KIND, either express or implied.  See the License for the                  *
 * specific language governing permissions and limitations                    *
 * under the License.                                                         *
 ******************************************************************************/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"

android {
    ndkVersion "21.2.6472646"
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId 'de.rki.coronawarnapp'
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 16
        versionName "0.8.9"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField "String", "DOWNLOAD_CDN_URL", "\"$DOWNLOAD_CDN_URL\""
        buildConfigField "String", "SUBMISSION_CDN_URL", "\"$SUBMISSION_CDN_URL\""
        buildConfigField "String", "VERIFICATION_CDN_URL", "\"$VERIFICATION_CDN_URL\""
        buildConfigField "String", "EXPORT_SIGNATURE_ID", "\"de.rki.coronawarnapp-dev\""

        //override URLs with local variables
        Properties properties = new Properties()
        def propertiesFile = project.rootProject.file('local.properties')
        if (propertiesFile.exists()) {
            properties.load(propertiesFile.newDataInputStream())
            def secretFile = project.rootProject.file('secrets.properties')
            if (secretFile.exists())
                properties.load(secretFile.newDataInputStream())

            def DOWNLOAD_CDN_URL = properties.getProperty('DOWNLOAD_CDN_URL')
            if (DOWNLOAD_CDN_URL)
                buildConfigField "String", "DOWNLOAD_CDN_URL", "\"$DOWNLOAD_CDN_URL\""

            def SUBMISSION_CDN_URL = properties.getProperty('SUBMISSION_CDN_URL')
            if (SUBMISSION_CDN_URL)
                buildConfigField "String", "SUBMISSION_CDN_URL", "\"$SUBMISSION_CDN_URL\""

            def VERIFICATION_CDN_URL = properties.getProperty('VERIFICATION_CDN_URL')
            if (VERIFICATION_CDN_URL)
                buildConfigField "String", "VERIFICATION_CDN_URL", "\"$VERIFICATION_CDN_URL\""
        }

        javaCompileOptions {
            annotationProcessorOptions {
                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }