buildscript {
    repositories {

    }

    dependencies {

    }
}
apply plugin: 'com.android.application'
//TODO Add back firebase crashlytics for internal use
//apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.firebase.crashlytics'

repositories {

}


android {
    compileSdkVersion 30
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.dji.wsbridge"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.2.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        buildConfigField "String", "BASE_URL", getBaseUrl()
    }
    buildTypes {
        // Only used internally by DJI
        internal {
            initWith buildTypes.debug
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        all {
            buildConfigField "String", "REMOTE_LOGGER_URL", "\"your_url_goes_here.com\""
        }
    }

}

dependencies {

    implementation 'com.amitshekhar.android:android-networking:0.3.0'
    implementation 'org.java-websocket:java-websocket:1.3.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.squareup:otto:1.3.8'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    // Because RxAndroid releases are few and far between, it is recommended you also
    // explicitly depend on RxJava's latest version for bug fixes and new features.
    implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.core:core:1.3.2'

    implementation 'com.github.markzhai:blockcanary-android:1.5.0'

    // Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
    implementation platform('com.google.firebase:firebase-bom:26.1.1')

    // Firebase Crashlytics (Java) //TODO Add back Firebase for internal use
    //implementation 'com.google.firebase:firebase-crashlytics'


}

/**
 * e.g, ./gradlew -PbaseUrl=yoururl.com assembleDebug
 * @return return the entered value if there is any, if not empty string
 */
def getBaseUrl() {
    def value = project.getProperties().get("baseUrl")
    return value != null ? "\"" + value + "\"" : "\"\""
}
