/**
 * The first line in the build configuration applies the Android plugin for
 * Gradle to this build and makes the android block available to specify
 * Android-specific build options.
 */
apply plugin: 'base'
apply plugin: 'com.android.application'

/**
 * The android block is where you configure all your Android-specific
 * build options.
 */

android {
    /**
     * compileSdkVersion specifies the Android API level Gradle should use to
     * compile your app. This means your app can use the API features included in
     * this API level and lower.
     */
    compileSdkVersion 30
    /**
     * buildToolsVersion specifies the version of the SDK build tools, command-line
     * utilities, and compiler that Gradle should use to build your app. You need to
     * download the build tools using the SDK Manager.
     *
     * This property is optional because the plugin uses a recommended version of
     * the build tools by default.
     */
    /**
     * The defaultConfig block encapsulates default settings and entries for all
     * build variants, and can override some attributes in main/AndroidManifest.xml
     * dynamically from the build system. You can configure product flavors to override
     * these values for different versions of your app.
     */

    defaultConfig {
        applicationId "com.att.arocollector"
        def jenkinsBuildNumber = System.getenv("BUILD_NUMBER") as Integer ?: 1
        def releaseBuildId = jenkinsBuildNumber - 1
        versionName "4.6." + releaseBuildId
        minSdkVersion 23
        targetSdkVersion 29
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"

    }

    signingConfigs {
        release {
        }
    }

    /**
     * The buildTypes block is where you can configure multiple build types.
     * By default, the build system defines two build types: debug and release. The
     * debug build type is not explicitly shown in the default build configuration,
     * but it includes debugging tools and is signed with the debug key. The release
     * build type applies Proguard settings and is not signed by default.
     */

    buildTypes {
        android.applicationVariants.all { variant ->
            variant.outputs.all { output ->
                def builtType = variant.buildType.name
                def versionName = variant.versionName
                def versionCode = variant.versionCode
                def flavor = variant.flavorName
                outputFileName = "VPNCollector-${versionName}.apk"
            }
        }

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.release
        }
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

}
'com.example.android:app-magic:12.3'


dependencies {
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.core:core:1.6.0'
    implementation 'com.android.support:support-annotations:+'

    implementation 'org.bouncycastle:bcpkix-jdk15on:1.56'
    implementation 'org.bouncycastle:bcprov-jdk15on:1.56'
    implementation 'com.google.android.material:material:1.3.0'

}
