Skip to content
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

Bw/build cleanup #828

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ executors:
- image: circleci/android:api-29
working_directory: ~/plaid
environment:
JAVA_TOOL_OPTIONS: "-Xmx2048m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
JAVA_TOOL_OPTIONS: "-Xmx4096m"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=4"
TERM: dumb

plaid-gcloud-executor:
Expand Down
6 changes: 3 additions & 3 deletions about/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

dataBinding {
enabled true
buildFeatures {
dataBinding true
}

compileOptions {
Expand All @@ -51,7 +51,7 @@ dependencies {
implementation project(':bypass')

implementation "androidx.viewpager2:viewpager2:${versions.viewPager2}"
implementation "com.android.support:customtabs:${versions.supportLibrary}"
implementation "androidx.browser:browser:${versions.browser}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"

kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ android {
]
}

dataBinding {
enabled true
buildFeatures {
dataBinding true
}

buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/plaidapp/ui/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class HomeViewModel(
positions.add(i)
}

val scrollToPosition = positions.max()
val scrollToPosition = positions.maxOrNull()
return if (scrollToPosition == null) {
null
} else {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/io/plaidapp/ui/PlaidApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package io.plaidapp.ui
import android.app.Activity
import android.app.Application
import android.content.Context
import android.os.Build
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
import androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode
import androidx.core.os.BuildCompat
import io.plaidapp.core.dagger.CoreComponent
import io.plaidapp.core.dagger.DaggerCoreComponent

Expand All @@ -33,7 +33,7 @@ class PlaidApplication : Application() {

override fun onCreate() {
super.onCreate()
val nightMode = if (BuildCompat.isAtLeastQ()) {
val nightMode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
MODE_NIGHT_FOLLOW_SYSTEM
} else {
MODE_NIGHT_AUTO_BATTERY
Expand Down
36 changes: 19 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,48 @@ buildscript { scriptHandler ->
'compileSdk' : 29,
'minSdk' : 23,
'targetSdk' : 29,
'appcompat' : '1.1.0-rc01',
'androidx' : '1.0.0',
'appcompat' : '1.1.0',
'androidx' : '1.1.0',
'androidxCollection' : '1.0.0',
'androidxArch' : '2.0.0',
'constraintLayout' : '2.0.0-alpha2',
'coreKtx' : '1.2.0-alpha03',
'browser' : '1.2.0',
'constraintLayout' : '2.0.1',
'coreKtx' : '1.3.1',
'coroutines' : '1.3.0',
'crashlytics' : '2.10.1',
'dagger' : '2.23.2',
'espresso' : '3.1.0-beta02',
'dynamicanimation' : '1.0.0',
'espresso' : '3.1.0',
'extJunit' : '1.1.0',
'fabric' : '1.28.0',
'firebase' : '17.0.0',
'glide' : '4.9.0',
'firebase' : '17.5.0',
'glide' : '4.11.0',
'googleServices' : '4.3.0',
'gson' : '2.8.5',
'jsoup' : '1.11.3',
'junit' : '4.12',
'kotlin' : '1.3.50',
'kotlin' : '1.4.0',
'ktlint' : '0.36.0',
'legacyCoreUtils' : '1.0.0',
'lifecycle' : '2.2.0-alpha03',
'material' : '1.1.0-alpha05',
'lifecycle' : '2.2.0',
'material' : '1.1.0',
'mockito' : '2.23.0',
'mockito_kotlin' : '2.0.0-RC3',
'mockito_kotlin' : '2.0.0',
'okhttp' : '4.0.0',
'palette' : '1.0.0',
'retrofit' : '2.6.0',
'room' : '2.2.1',
'supportLibrary' : '28.0.0',
'test_rules' : '1.1.0-beta02',
'test_runner' : '1.1.0-beta02',
'ui_automator' : '2.2.0-beta02',
'room' : '2.2.5',
'test_rules' : '1.1.0',
'test_runner' : '1.1.0',
'ui_automator' : '2.2.0',
'viewPager2' : '1.0.0'
]
ext.names = [
'applicationId': 'io.plaidapp'
]

dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:4.2.0-alpha08'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.google.gms:google-services:${versions.googleServices}"
classpath "io.fabric.tools:gradle:${versions.fabric}"
Expand Down
13 changes: 7 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ android {
}
}

dataBinding {
enabled true
buildFeatures {
dataBinding true
}

buildTypes {
Expand All @@ -65,18 +65,19 @@ android {
}

packagingOptions {
exclude 'META-INF/core_debug.kotlin_module'
merge 'META-INF/core_debug.kotlin_module'
merge 'META-INF/AL2.0'
}
}

dependencies {
implementation project(':bypass')
implementation "com.google.code.gson:gson:${versions.gson}"
implementation "androidx.browser:browser:${versions.androidx}"
implementation "androidx.browser:browser:${versions.browser}"
implementation "androidx.room:room-runtime:${versions.room}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
implementation "com.android.support:palette-v7:${versions.supportLibrary}"
implementation "com.android.support:support-dynamic-animation:${versions.supportLibrary}"
implementation "androidx.palette:palette:${versions.palette}"
implementation "androidx.dynamicanimation:dynamicanimation:${versions.dynamicanimation}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}"
implementation "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class BadgedFourThreeImageView(
init {
badge = GifBadge(context)
val a = context.obtainStyledAttributes(attrs, R.styleable.BadgedImageView, 0, 0)
badgeGravity = a.getInt(R.styleable.BadgedImageView_badgeGravity, Gravity.END or Gravity
.BOTTOM)
badgeGravity = a.getInt(R.styleable.BadgedImageView_badgeImageGravity,
Gravity.END or Gravity.BOTTOM)
badgePadding = a.getDimensionPixelSize(R.styleable.BadgedImageView_badgePadding, 0)
a.recycle()
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/res/layout/dribbble_shot_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
android:elevation="@dimen/z_card"
android:stateListAnimator="@animator/raise"
android:foreground="@drawable/mid_grey_ripple"
app:badgeGravity="end|bottom"
app:badgeImageGravity="end|bottom"
app:badgePadding="@dimen/padding_normal" />
2 changes: 1 addition & 1 deletion core/src/main/res/values/attrs_badged_image_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<resources>
<declare-styleable name="BadgedImageView">
<attr name="badgeGravity">
<attr name="badgeImageGravity">
<!-- Push object to the top of its container, not changing its size. -->
<flag name="top" value="0x30" />
<!-- Push object to the bottom of its container, not changing its size. -->
Expand Down
6 changes: 3 additions & 3 deletions designernews/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
}
}

dataBinding {
enabled true
buildFeatures {
dataBinding true
}

compileOptions {
Expand All @@ -59,7 +59,7 @@ dependencies {
implementation project(':bypass')

implementation "androidx.room:room-ktx:${versions.room}"
implementation "com.android.support:customtabs:${versions.supportLibrary}"
implementation "androidx.browser:browser:${versions.browser}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"

kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class LoggedInUserDaoTest {
}

@After fun tearDown() {
database.close()
if (::database.isInitialized) {
database.close()
}
}

@Test fun insertAndGetLoggedInUser() = runBlocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
package io.plaidapp.ui.drawable

import android.content.res.ColorStateList
import android.graphics.BlendMode
import android.graphics.BlendModeColorFilter
import android.graphics.Canvas
import android.graphics.ColorFilter
import android.graphics.Paint
import android.graphics.PixelFormat
import android.graphics.PorterDuff.Mode.SRC_IN
import android.graphics.drawable.Drawable
import android.os.Build
import androidx.annotation.ColorInt
import androidx.annotation.Px

Expand Down Expand Up @@ -76,14 +79,19 @@ class ThreadedCommentDrawable(

override fun setTintList(tint: ColorStateList?) {
if (tint != null) {
setColorFilter(tint.defaultColor, SRC_IN)
setTint(tint.defaultColor)
} else {
clearColorFilter()
}
}

override fun setTint(tintColor: Int) {
setColorFilter(tintColor, SRC_IN)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
colorFilter = BlendModeColorFilter(tintColor, BlendMode.SRC_IN)
} else {
@Suppress("DEPRECATION")
setColorFilter(tintColor, SRC_IN)
}
}

override fun getOpacity(): Int {
Expand Down
8 changes: 4 additions & 4 deletions dribbble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
manifestPlaceholders = [filesAuthority: filesAuthorityValue]
}

dataBinding {
enabled true
buildFeatures {
dataBinding true
}

compileOptions {
Expand All @@ -50,8 +50,8 @@ dependencies {
implementation project(':app')
implementation project(':core')

implementation "com.android.support:customtabs:${versions.supportLibrary}"
implementation "com.android.support:palette-v7:${versions.supportLibrary}"
implementation "androidx.browser:browser:${versions.browser}"
implementation "androidx.palette:palette:${versions.palette}"
implementation "com.github.bumptech.glide:recyclerview-integration:${versions.glide}"

kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Sep 07 21:18:25 BST 2020
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-6-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
6 changes: 5 additions & 1 deletion repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ repositories {
includeGroupByRegex "androidx.*"
includeGroup "android.arch.lifecycle"
includeGroup "android.arch.core"
includeGroup "com.google.firebase"
includeGroup "com.google.android.gms"
includeGroup "com.google.android.material"
includeGroup "com.google.firebase"
includeGroup "com.google.gms"
includeGroup "com.google.testing.platform"
includeGroup "zipflinger"
}
}
Expand All @@ -34,10 +35,13 @@ repositories {
includeGroup "commons-codec"
includeGroup "commons-logging"
includeGroup "it.unimi.dsi"
includeGroup "jakarta.activation"
includeGroup "jakarta.xml.bind"
includeGroup "junit"
includeGroup "me.eugeniomarletti.kotlin.metadata"
includeGroup "net.bytebuddy"
includeGroup "net.java"
includeGroup "net.java.dev.jna"
includeGroup "org.abego.treelayout"
includeGroup "org.antlr"
includeGroup "org.bouncycastle"
Expand Down
9 changes: 6 additions & 3 deletions search/src/main/java/io/plaidapp/search/ui/SearchActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ class SearchActivity : AppCompatActivity() {
super.onNewIntent(intent)
if (intent.hasExtra(SearchManager.QUERY)) {
val query = intent.getStringExtra(SearchManager.QUERY)
if (!TextUtils.isEmpty(query)) {
searchView.setQuery(query, false)
searchFor(query)
query?.apply {
if (TextUtils.isEmpty(this)) {
return@apply
}
searchView.setQuery(this, false)
searchFor(this)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-runtime:${versions.lifecycle}"

// Workaround for dependency conflict during assembleAndroidTest
androidTestImplementation("androidx.arch.core:core-runtime:2.0.1-alpha01")
androidTestImplementation("androidx.arch.core:core-runtime:2.0.1")

// Work around issue with runtime classpath version conflict
androidTestImplementation "androidx.arch.core:core-testing:${versions.androidxArch}"
Expand All @@ -50,5 +50,5 @@ dependencies {
androidTestImplementation "org.mockito:mockito-core:${versions.mockito}"
// Adding this to bring "google_play_services_version" into the test project
// without this, it fails on AGP 3.6.x.
androidTestImplementation "com.google.android.gms:play-services-gcm:16.0.0"
androidTestImplementation "com.google.android.gms:play-services-gcm:17.0.0"
}
4 changes: 4 additions & 0 deletions third_party/bypass/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ android {
minifyEnabled false
}
}

packagingOptions {
merge 'META-INF/AL2.0'
}
}

dependencies {
Expand Down