"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-6193/android/app/build.gradle" (20 May 2022, 5666 Bytes) of package /linux/misc/jitsi-meet-6193.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. See also the last Fossies "Diffs" side-by-side code changes report for "build.gradle": jitsi-meet_7210_vs_jitsi-meet_7287.

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