Skip to content

Join the cool kids club (aka migrate to Gradle Kotlin DSL) #1321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 30, 2018
10 changes: 0 additions & 10 deletions AUTHORS

This file was deleted.

16 changes: 0 additions & 16 deletions CONTRIBUTORS

This file was deleted.

72 changes: 0 additions & 72 deletions app/build.gradle

This file was deleted.

62 changes: 62 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// NOTE: this project uses Gradle Kotlin DSL. More common build.gradle instructions can be found in
// the main README.

android {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a big comment on this file saying something like "hey we R cool kidz so we use the Kotlin DSL. If you're writing an app that uses FirebaseUI check out README.md for better examples" or something like that (please not that verbatim)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I'm definitely going to quote you on that one! 😁 Side note: do you think we should rename :app to :sample?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead with that change though it's in one commit we can easily kill if you disagree.

defaultConfig {
multiDexEnabled = true
}

buildTypes {
getByName("release") {
// For the purposes of the sample, allow testing of a proguarded release build
// using the debug key
signingConfig = signingConfigs["debug"]

postprocessing {
isRemoveUnusedCode = true
isRemoveUnusedResources = true
isObfuscate = true
isOptimizeCode = true
}
}
}

lintOptions {
disable("ResourceName", "MissingTranslation")
}
}

dependencies {
implementation(Config.Libs.Firebase.core)
implementation(Config.Libs.Support.design)
implementation(Config.Libs.Support.multidex)

implementation(project(":auth"))
implementation(project(":firestore"))
implementation(project(":database"))
implementation(project(":storage"))

implementation(Config.Libs.Provider.facebook)
// Needed to override Facebook
implementation(Config.Libs.Support.cardView)
implementation(Config.Libs.Support.customTabs)
implementation(Config.Libs.Provider.twitter) { isTransitive = true }

implementation(Config.Libs.Misc.glide)
annotationProcessor(Config.Libs.Misc.glideCompiler)

// Used for FirestorePagingActivity
implementation(Config.Libs.Arch.paging)

// The following dependencies are not required to use the Firebase UI library.
// They are used to make some aspects of the demo app implementation simpler for
// demonstrative purposes, and you may find them useful in your own apps; YMMV.
implementation(Config.Libs.Misc.permissions)
implementation(Config.Libs.Misc.butterKnife)
annotationProcessor(Config.Libs.Misc.butterKnifeCompiler)
debugImplementation(Config.Libs.Misc.leakCanary)
releaseImplementation(Config.Libs.Misc.leakCanaryNoop)
testImplementation(Config.Libs.Misc.leakCanaryNoop)
}

apply(plugin = "com.google.gms.google-services")
4 changes: 3 additions & 1 deletion app/src/main/res/layout/activity_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
android:layout_weight="1"
android:hint="@string/hint_message"
android:imeOptions="actionDone"
android:inputType="text" />
android:importantForAutofill="no"
android:inputType="text"
tools:ignore="UnusedAttribute" />

<Button
android:id="@+id/sendButton"
Expand Down
68 changes: 0 additions & 68 deletions auth/build.gradle

This file was deleted.

48 changes: 48 additions & 0 deletions auth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import com.android.build.gradle.internal.dsl.TestOptions

android {
buildTypes {
getByName("release") {
postprocessing {
consumerProguardFiles("auth-proguard.pro")
}
}
}

lintOptions {
disable("UnusedQuantity")
}

testOptions {
unitTests(closureOf<TestOptions.UnitTestOptions> {
isIncludeAndroidResources = true
})
}
}

dependencies {
implementation(Config.Libs.Support.design)
implementation(Config.Libs.Support.customTabs)
implementation(Config.Libs.Support.constraint)
implementation(Config.Libs.Misc.materialProgress)

implementation(Config.Libs.Arch.extensions)
annotationProcessor(Config.Libs.Arch.compiler)

api(Config.Libs.Firebase.auth)
api(Config.Libs.PlayServices.auth)

compileOnly(Config.Libs.Provider.facebook)
// Needed to override Facebook
implementation(Config.Libs.Support.cardView)
implementation(Config.Libs.Support.customTabs)
compileOnly(Config.Libs.Provider.twitter) { isTransitive = true }

testImplementation(Config.Libs.Test.junit)
testImplementation(Config.Libs.Test.mockito)
testImplementation(Config.Libs.Test.robolectric)
testImplementation(Config.Libs.Provider.facebook)
testImplementation(Config.Libs.Provider.twitter) { isTransitive = true }

debugImplementation(project(":internal:lintchecks"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
android:textColor="?android:attr/textColorTertiary"
android:textIsSelectable="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/container"
app:layout_constraintRight_toLeftOf="@+id/container"
app:layout_constraintBottom_toBottomOf="parent" />

</android.support.constraint.ConstraintLayout>
2 changes: 1 addition & 1 deletion auth/src/main/res/layout/fui_auth_method_picker_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/main_tos_and_pp"
app:layout_constraintBottom_toTopOf="@+id/main_tos_and_pp"
app:layout_constraintVertical_bias="0.7">

<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand Down Expand Up @@ -58,22 +59,22 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/fui_field_padding_vert"
android:text="@string/fui_trouble_signing_in"
app:layout_constraintEnd_toStartOf="@+id/button_done"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/button_done"
app:layout_constraintTop_toBottomOf="@+id/password_layout" />

<Button
android:id="@+id/button_done"
style="@style/FirebaseUI.Button"
android:text="@string/fui_sign_in_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/trouble_signing_in"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/trouble_signing_in" />

<TextView
android:id="@+id/email_footer_tos_and_pp_text"
style="@style/FirebaseUI.PrivacyFooter"
app:layout_constraintTop_toBottomOf="@id/button_done" />
app:layout_constraintTop_toBottomOf="@+id/button_done" />

</android.support.constraint.ConstraintLayout>

Expand Down
Loading