Browse Source

Use build flavor for implementation declaration

Instead of loading dependencies with an own snippet of code now the
provided functionality of configure flavor based implementation
declaration is used.

This change results in some more warning which will no be fixied in this
commit.

See: https://developer.android.com/studio/build/build-variants#dependencies

Signed-off-by: Tim Krüger <t@timkrueger.me>
Tim Krüger 3 years ago
parent
commit
90dd63d1f3
4 changed files with 5 additions and 36 deletions
  1. 2 10
      app/build.gradle
  2. 0 23
      app/gplay.gradle
  3. 1 1
      scripts/analysis/lint-results.txt
  4. 2 2
      scripts/analysis/lint-up.rb

+ 2 - 10
app/build.gradle

@@ -34,16 +34,6 @@ configurations {
     ktlint
 }
 
-for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()) {
-    for (String arg : tr.args) {
-        // any gplay, but only exact "build", as e.g. buildGeneric shall not apply gplay.grade
-        if (arg.contains("Gplay") || arg.contains("lint") || arg == "build") {
-            apply from: 'gplay.gradle'
-            System.console().println("Applying gplay.gradle")
-        }
-    }
-}
-
 android {
     compileSdkVersion 30
     buildToolsVersion '30.0.3'
@@ -305,6 +295,8 @@ dependencies {
     })
     spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
     spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
+
+    gplayImplementation "com.google.firebase:firebase-messaging:20.1.2"
 }
 
 task ktlint(type: JavaExec, group: "verification") {

+ 0 - 23
app/gplay.gradle

@@ -1,23 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-dependencies {
-  implementation "com.google.firebase:firebase-messaging:20.1.2"
-}

+ 1 - 1
scripts/analysis/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 1 errors and 266 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 1 errors and 270 warnings</span>

+ 2 - 2
scripts/analysis/lint-up.rb

@@ -56,12 +56,12 @@ end
 
 # run Lint
 puts "running Lint..."
-system './gradlew clean assembleGplay lint'
+system './gradlew clean lintGplayDebug'
 
 # confirm that Lint ran w/out error
 result = $?.to_i
 if result != 0
-    puts "FAIL: failed to run ./gradlew clean assembleGplay lint"
+    puts "FAIL: failed to run ./gradlew clean lintGplayDebug"
     exit 1
 end