Skip to content

Commit

Permalink
Upgrade to AGP 4.0 (firebase#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtstern authored May 29, 2020
1 parent 86fcb00 commit 26ca17a
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.uidemo.database.firestore;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -39,6 +40,7 @@
* For a general intro to the RecyclerView, see <a href="https://developer.android.com/training/material/lists-cards.html">Creating
* Lists</a>.
*/
@SuppressLint("RestrictedApi")
public class FirestoreChatActivity extends AppCompatActivity
implements FirebaseAuth.AuthStateListener {
private static final String TAG = "FirestoreChatActivity";
Expand Down Expand Up @@ -104,7 +106,9 @@ public void onDonePressed() {
@Override
public void onStart() {
super.onStart();
if (isSignedIn()) { attachRecyclerViewAdapter(); }
if (isSignedIn()) {
attachRecyclerViewAdapter();
}
FirebaseAuth.getInstance().addAuthStateListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

public class FirebaseDbPagingActivity extends AppCompatActivity {

private final String TAG = "PagingActivity";
private static final String TAG = "PagingActivity";

@BindView(R.id.paging_recycler)
RecyclerView mRecycler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.uidemo.database.realtime;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -39,6 +40,7 @@
* For a general intro to the RecyclerView, see <a href="https://developer.android.com/training/material/lists-cards.html">Creating
* Lists</a>.
*/
@SuppressLint("RestrictedApi")
public class RealtimeDbChatActivity extends AppCompatActivity
implements FirebaseAuth.AuthStateListener {
private static final String TAG = "RealtimeDatabaseDemo";
Expand All @@ -47,7 +49,7 @@ public class RealtimeDbChatActivity extends AppCompatActivity
* Get the last 50 chat messages.
*/
@NonNull
protected static final Query sChatQuery =
protected final Query sChatQuery =
FirebaseDatabase.getInstance().getReference().child("chats").limitToLast(50);

@BindView(R.id.messagesList)
Expand Down Expand Up @@ -82,7 +84,9 @@ public void onDonePressed() {
@Override
public void onStart() {
super.onStart();
if (isSignedIn()) { attachRecyclerViewAdapter(); }
if (isSignedIn()) {
attachRecyclerViewAdapter();
}
FirebaseAuth.getInstance().addAuthStateListener(this);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.uidemo.util;

import android.annotation.SuppressLint;
import android.content.Context;

import com.firebase.ui.auth.AuthUI;
Expand All @@ -12,6 +13,7 @@

import androidx.annotation.NonNull;

@SuppressLint("RestrictedApi")
public final class ConfigurationUtils {

private ConfigurationUtils() {
Expand Down
1 change: 1 addition & 0 deletions auth/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=28
13 changes: 6 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("UnstableApiUsage")

import com.android.build.gradle.BaseExtension
import com.android.build.gradle.LibraryExtension
import com.jfrog.bintray.gradle.BintrayExtension
Expand All @@ -24,15 +26,9 @@ buildscript {
}

plugins {
`build-scan` version "2.0.2"
id("com.github.ben-manes.versions") version "0.20.0"
}

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}

// See https://github.com/gradle/kotlin-dsl/issues/607#issuecomment-375687119
subprojects { parent!!.path.takeIf { it != rootProject.path }?.let { evaluationDependsOn(it) } }

Expand All @@ -45,7 +41,10 @@ allprojects {

if ((group as String).isNotEmpty() && name != "lint" && name != "internal") {
configureAndroid()
configureQuality()

if (name != "lintchecks") {
configureQuality()
}

if (Config.submodules.contains(name) || isLibrary) {
setupPublishing()
Expand Down
21 changes: 8 additions & 13 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ object Config {
const val version = "6.3.0-SNAPSHOT"
val submodules = listOf("auth", "common", "firestore", "database", "storage")

private const val kotlinVersion = "1.3.10"
private const val kotlinVersion = "1.3.72"

object SdkVersions {
const val compile = 28
const val target = 28
const val compile = 29
const val target = 29
const val min = 16
}

object Plugins {
const val android = "com.android.tools.build:gradle:3.5.0"
const val android = "com.android.tools.build:gradle:4.0.0"
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
const val google = "com.google.gms:google-services:4.3.1"
const val google = "com.google.gms:google-services:4.3.3"

const val bintray = "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
const val buildInfo = "org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5"
const val bintray = "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
const val buildInfo = "org.jfrog.buildinfo:build-info-extractor-gradle:4.15.2"
}

object Libs {
Expand All @@ -25,7 +25,6 @@ object Config {
}

object Androidx {
const val appCompat = "androidx.appcompat:appcompat:1.1.0"
const val annotations = "androidx.annotation:annotation:1.1.0"
const val customTabs = "androidx.browser:browser:1.0.0"
const val cardView = "androidx.cardview:cardview:1.0.0"
Expand Down Expand Up @@ -59,14 +58,10 @@ object Config {
}

object Misc {
private const val retrofitVersion = "2.4.0"
private const val leakCanaryVersion = "1.6.1"
private const val glideVersion = "4.8.0"
private const val butterVersion = "10.1.0"

const val retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion"
const val retrofitGson = "com.squareup.retrofit2:converter-gson:$retrofitVersion"

const val leakCanary = "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
const val leakCanaryFragments =
"com.squareup.leakcanary:leakcanary-support-fragment:$leakCanaryVersion"
Expand All @@ -88,7 +83,7 @@ object Config {
const val junitExt = "androidx.test.ext:junit:1.1.1"
const val truth = "com.google.truth:truth:0.42"
const val mockito = "org.mockito:mockito-android:2.21.0"
const val robolectric = "org.robolectric:robolectric:4.0.2"
const val robolectric = "org.robolectric:robolectric:4.3.1"

const val core = "androidx.test:core:1.2.0"
const val archCoreTesting = "androidx.arch.core:core-testing:2.0.0"
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
org.gradle.jvmargs=-Xmx4g -Xms4g -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.caching=true

android.useAndroidX=true
android.enableJetifier=true
android.enableUnitTestBinaryResources=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion proguard-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {

variantFilter {
if (inCiBuild && name == "debug") {
setIgnore(true)
ignore = true
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
// https://docs.gradle.com/enterprise/gradle-plugin/#gradle_6_x_and_later
plugins {
id "com.gradle.enterprise" version "3.3.3"
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

rootProject.buildFileName = 'build.gradle.kts'

include(
Expand All @@ -11,4 +23,4 @@ include(
":lint",

":proguard-tests", ":internal:lint", ":internal:lintchecks"
)
)

0 comments on commit 26ca17a

Please sign in to comment.