"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-4434/android/app/build.gradle" (25 Sep 2020, 5488 Bytes) of package /linux/misc/jitsi-meet-4434.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Java source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 apply plugin: 'com.android.application'
    2 
    3 // Crashlytics integration is done as part of Firebase now, so it gets
    4 // automagically activated with google-services.json
    5 if (googleServicesEnabled) {
    6     apply plugin: 'com.google.firebase.crashlytics'
    7 }
    8 
    9 // Use the number of seconds/10 since Jan 1 2019 as the versionCode.
   10 // This lets us upload a new build at most every 10 seconds for the
   11 // next ~680 years.
   12 // https://stackoverflow.com/a/38643838
   13 def vcode = (int) (((new Date().getTime() / 1000) - 1546297200) / 10)
   14 
   15 android {
   16     compileSdkVersion rootProject.ext.compileSdkVersion
   17     buildToolsVersion rootProject.ext.buildToolsVersion
   18 
   19     defaultConfig {
   20         applicationId 'org.jitsi.meet'
   21         versionCode vcode
   22         versionName project.appVersion
   23 
   24         minSdkVersion rootProject.ext.minSdkVersion
   25         targetSdkVersion rootProject.ext.targetSdkVersion
   26 
   27         ndk {
   28             abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
   29         }
   30     }
   31 
   32     signingConfigs {
   33         debug {
   34             storeFile file('debug.keystore')
   35             storePassword 'android'
   36             keyAlias 'androiddebugkey'
   37             keyPassword 'android'
   38         }
   39     }
   40 
   41     buildTypes {
   42         debug {
   43             buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
   44             buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
   45         }
   46         release {
   47             // Uncomment the following line for singing a test release build.
   48             //signingConfig signingConfigs.debug
   49             minifyEnabled true
   50             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
   51             buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
   52             buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
   53         }
   54     }
   55 
   56     sourceSets {
   57         main {
   58             java {
   59                 if (rootProject.ext.libreBuild) {
   60                     srcDir "src"
   61                     exclude "**/GoogleServicesHelper.java"
   62                 }
   63             }
   64         }
   65     }
   66 
   67     compileOptions {
   68         sourceCompatibility JavaVersion.VERSION_1_8
   69         targetCompatibility JavaVersion.VERSION_1_8
   70     }
   71 }
   72 
   73 dependencies {
   74     implementation fileTree(dir: 'libs', include: ['*.jar'])
   75     implementation 'androidx.appcompat:appcompat:1.2.0'
   76 
   77     debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-5'
   78 
   79     if (!rootProject.ext.libreBuild) {
   80         implementation 'com.google.android.gms:play-services-auth:16.0.1'
   81 
   82         // Firebase
   83         //  - Crashlytics
   84         //  - Dynamic Links
   85         implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
   86         implementation 'com.google.firebase:firebase-dynamic-links:19.1.0'
   87     }
   88 
   89     implementation project(':sdk')
   90 }
   91 
   92 gradle.projectsEvaluated {
   93     // Dropbox integration
   94     //
   95 
   96     def dropboxAppKey
   97     if (project.file('dropbox.key').exists()) {
   98         dropboxAppKey = project.file('dropbox.key').text.trim() - 'db-'
   99     }
  100 
  101     if (dropboxAppKey) {
  102         android.defaultConfig.resValue('string', 'dropbox_app_key', "${dropboxAppKey}")
  103 
  104         def dropboxActivity = """
  105           <activity
  106               android:configChanges="keyboard|orientation"
  107               android:launchMode="singleTask"
  108               android:name="com.dropbox.core.android.AuthActivity">
  109             <intent-filter>
  110               <action android:name="android.intent.action.VIEW" />
  111               <category android:name="android.intent.category.BROWSABLE" />
  112               <category android:name="android.intent.category.DEFAULT" />
  113               <data android:scheme="db-${dropboxAppKey}" />
  114             </intent-filter>
  115           </activity>"""
  116 
  117         android.applicationVariants.all { variant ->
  118             variant.outputs.each { output ->
  119                 output.getProcessManifestProvider().get().doLast {
  120                     def outputDir = manifestOutputDirectory.get().asFile
  121                     def manifestPath = new File(outputDir, 'AndroidManifest.xml')
  122                     def charset = 'UTF-8'
  123                     def text
  124                     text = manifestPath.getText(charset)
  125                     text = text.replace('</application>', "${dropboxActivity}</application>")
  126                     manifestPath.write(text, charset)
  127                 }
  128             }
  129         }
  130     }
  131 
  132     // Run React packager
  133     android.applicationVariants.all { variant ->
  134         def targetName = variant.name.capitalize()
  135 
  136         def currentRunPackagerTask = tasks.create(
  137             name: "run${targetName}ReactPackager",
  138             type: Exec) {
  139             group = "react"
  140             description = "Run the React packager."
  141 
  142             doFirst {
  143                 println "Starting the React packager..."
  144 
  145                 def androidRoot = file("${projectDir}/../")
  146 
  147                 // Set up the call to the script
  148                 workingDir androidRoot
  149 
  150                 // Run the packager
  151                 commandLine("scripts/run-packager.sh")
  152             }
  153 
  154             // Set up dev mode
  155             def devEnabled = !targetName.toLowerCase().contains("release")
  156 
  157             // Only enable for dev builds
  158             enabled devEnabled
  159         }
  160 
  161         def packageTask = variant.packageApplicationProvider.get()
  162 
  163         packageTask.dependsOn(currentRunPackagerTask)
  164     }
  165 
  166 }
  167 
  168 if (googleServicesEnabled) {
  169     apply plugin: 'com.google.gms.google-services'
  170 }