Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #591 from squanchy-dev/update_dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
rock3r committed Oct 23, 2018
2 parents ccd4aa7 + f418543 commit fc4f151
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 56 deletions.
13 changes: 13 additions & 0 deletions app/build.gradle
Expand Up @@ -102,6 +102,19 @@ play {
// track = 'production'
}

detekt {
toolVersion detektVersion

input = files("$projectDir/src/")
config = files("$rootDir/team-props/static-analysis/detekt-config.yml")
filters = '.*/test/.*,.*/resources/.*,.*/tmp/.*,.*/build/.*,.*/debug/.*'
reports {
xml.enabled = true
html.enabled = true
}
parallel = true
}

dependencies {
implementation project(':renderthread')

Expand Down
@@ -1,5 +1,6 @@
package net.squanchy.notification

import android.annotation.SuppressLint
import android.app.AlarmManager
import android.app.IntentService
import android.app.PendingIntent
Expand Down Expand Up @@ -41,13 +42,15 @@ class NotificationsIntentService : IntentService(NotificationsIntentService::cla

val now = LocalDateTime()
if (shouldShowNotifications()) {
@SuppressLint("RxSubscribeOnError") // RxLint does not recognise RxKotlin (yet)
subscriptions += sortedFavourites
.map { events -> events.filter { it.startTime.isAfter(now) } }
.map { events -> events.filter { isBeforeOrEqualTo(it.startTime, notificationIntervalEnd) } }
.map(notificationCreator::createFrom)
.subscribeBy(onNext = notifier::showNotifications, onError = ::logError)
}

@SuppressLint("RxSubscribeOnError") // RxLint does not recognise RxKotlin (yet)
subscriptions += sortedFavourites
.map { events -> events.filter { it.startTime.isAfter(notificationIntervalEnd) } }
.subscribeBy(onNext = ::scheduleNextAlarm, onError = ::logError)
Expand Down
Expand Up @@ -51,7 +51,7 @@ class OtherEventItemView @JvmOverloads constructor(
}

@DrawableRes
private fun illustrationFor(type: Event.Type) = when (type) {
private fun illustrationFor(type: Event.Type): Int = when (type) {
Event.Type.COFFEE_BREAK -> R.drawable.coffee_break
Event.Type.LUNCH -> R.drawable.lunch
Event.Type.REGISTRATION -> R.drawable.registration
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/drawable/empty_schedule.xml
@@ -1,8 +1,11 @@
<!-- It's a static image and we had no issues with it being larger than 200dp -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="289dp"
android:height="118dp"
android:viewportWidth="289.0"
android:viewportHeight="118.0">
android:viewportHeight="118.0"
tools:ignore="VectorRaster">

<path
android:pathData="M170,46.21C175.05,44.49 177.65,41.94 177.79,38.54C178.01,33.44 179.56,27.54 185,27.11C190.43,26.67 199.34,27.36 199.53,23.67C199.73,19.98 192.2,18.19 185,18.19C177.79,18.19 171.35,15.73 172.02,10.74C172.69,5.75 179.78,5.48 183.92,5.75C188.07,6.02 191.29,3.91 190.73,2.24C190.35,1.12 189.79,0.57 189.03,0.57C191.61,0.63 192.97,1.4 193.11,2.88C193.32,5.09 192.55,7.95 189.88,9.34C187.21,10.74 186.71,12.28 190.73,12.59C194.75,12.9 203.87,11.99 214.39,18.19C224.91,24.38 227.88,31.58 224.91,35.06C221.93,38.54 215.02,36.37 214.39,41.29C213.96,44.57 215.74,46.21 219.7,46.21L170,46.21Z"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/drawable/ic_opensource.xml
@@ -1,9 +1,11 @@
<!-- It's a simple static image and we had no issues with it being larger than 200dp -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="588dp"
android:height="442dp"
android:viewportWidth="588"
android:viewportHeight="442">
android:viewportHeight="442"
tools:ignore="VectorRaster">

<!-- This is a slightly too long vector path but we're ok with it -->
<path
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/merge_no_favorites_view.xml
Expand Up @@ -20,6 +20,7 @@
app:layout_constraintBottom_toTopOf="@+id/text"
app:layout_constraintVertical_chainStyle="packed" />

<!-- On API 21-22 we do without the touch feedback for now -->
<TextView
android:id="@+id/text"
style="@style/Favorite.Empty.Blurb"
Expand All @@ -30,6 +31,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/favoriteFab"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toBottomOf="parent"
tools:targetApi="m" />

</net.squanchy.favorites.view.FavoritesSignedInEmptyLayout>
5 changes: 3 additions & 2 deletions build.gradle
Expand Up @@ -17,7 +17,7 @@ buildscript {

plugins {
id 'com.github.ben-manes.versions' version '0.20.0'
id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC8'
id 'io.gitlab.arturbosch.detekt' version '1.0.0.RC9.2'
id 'org.jlleitschuh.gradle.ktlint' version '5.0.0'
}

Expand All @@ -34,11 +34,12 @@ subprojects {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://dl.bintray.com/arturbosch/code-analysis' }
jcenter()
}
}

apply plugin: 'io.gitlab.arturbosch.detekt'

repositories {
google()
maven { url 'https://maven.fabric.io/public' }
Expand Down
48 changes: 24 additions & 24 deletions dependencies.gradle
@@ -1,16 +1,16 @@
ext {
daggerVersion = '2.17'
daggerVersion = '2.18'
glideVersion = '4.8.0'
androidxVersion = '1.0.0-rc01'
kotlinVersion = '1.2.61'
moshiVersion = '1.6.0'
androidxVersion = '1.0.0'
kotlinVersion = '1.2.71'
moshiVersion = '1.7.0'

detektVersion = '1.0.0.RC8'
ktlintVersion = '0.27.0'
detektVersion = '1.0.0.RC9.2'
ktlintVersion = '0.29.0'

gradlePlugins = [
buildProperties: 'com.novoda:gradle-build-properties-plugin:0.4.1',
fabric : 'io.fabric.tools:gradle:1.25.4',
fabric : 'io.fabric.tools:gradle:1.26.1',
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
]

Expand All @@ -26,29 +26,29 @@ ext {
crashlytics : 'com.crashlytics.sdk.android:crashlytics:2.9.5',
dagger : "com.google.dagger:dagger:${daggerVersion}",
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
firebaseAuth : 'com.google.firebase:firebase-auth:16.0.3',
firebaseConfig : 'com.google.firebase:firebase-config:16.0.0',
firebaseCore : 'com.google.firebase:firebase-core:16.0.3',
firebaseDb : 'com.google.firebase:firebase-database:16.0.1',
firebaseFirestore : 'com.google.firebase:firebase-firestore:17.1.0',
firebaseMessaging : 'com.google.firebase:firebase-messaging:17.3.0',
firebasePerf : 'com.google.firebase:firebase-perf:16.1.0',
firebaseStorage : 'com.google.firebase:firebase-storage:16.0.1',
firebaseUiStorage : 'com.firebaseui:firebase-ui-storage:4.1.0',
flexbox : 'com.google.android:flexbox:1.0.0',
firebaseAuth : 'com.google.firebase:firebase-auth:16.0.5',
firebaseConfig : 'com.google.firebase:firebase-config:16.1.0',
firebaseCore : 'com.google.firebase:firebase-core:16.0.4',
firebaseDb : 'com.google.firebase:firebase-database:16.0.3',
firebaseFirestore : 'com.google.firebase:firebase-firestore:17.1.1',
firebaseMessaging : 'com.google.firebase:firebase-messaging:17.3.4',
firebasePerf : 'com.google.firebase:firebase-perf:16.1.2',
firebaseStorage : 'com.google.firebase:firebase-storage:16.0.3',
firebaseUiStorage : 'com.firebaseui:firebase-ui-storage:4.2.0',
flexbox : 'com.google.android:flexbox:1.1.0',
glide : "com.github.bumptech.glide:glide:${glideVersion}",
glideCompiler : "com.github.bumptech.glide:compiler:${glideVersion}",
glideOkHttp3 : "com.github.bumptech.glide:okhttp3-integration:${glideVersion}",
jodaTimeAndroid : 'net.danlew:android.joda:2.9.9.4',
jodaTimeAndroid : 'net.danlew:android.joda:2.10.0',
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlinVersion}",
kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
moshi : "com.squareup.moshi:moshi:${moshiVersion}",
moshiKotlin : "com.squareup.moshi:moshi-kotlin:${moshiVersion}",
playServicesAuth : 'com.google.android.gms:play-services-auth:16.0.0',
playServicesAuth : 'com.google.android.gms:play-services-auth:16.0.1',
rxAndroid : 'io.reactivex.rxjava2:rxandroid:2.1.0',
rxJava : 'io.reactivex.rxjava2:rxjava:2.2.1',
rxKotlin : 'io.reactivex.rxjava2:rxkotlin:2.2.0',
rxLint : 'nl.littlerobots.rxlint:rxlint:1.6.1',
rxJava : 'io.reactivex.rxjava2:rxjava:2.2.2',
rxKotlin : 'io.reactivex.rxjava2:rxkotlin:2.3.0',
rxLint : 'nl.littlerobots.rxlint:rxlint:1.7.0',
timber : 'com.jakewharton.timber:timber:4.7.1',
viewPagerAdapter : 'com.novoda:view-pager-adapter:1.0.0'
],
Expand All @@ -57,12 +57,12 @@ ext {
truth : 'com.google.truth:truth:0.42',
jodaTime: 'joda-time:joda-time:2.10',
jUnit4 : 'junit:junit:4.12',
mockito : 'org.mockito:mockito-inline:2.21.0'
mockito : 'org.mockito:mockito-inline:2.23.0'
]
]

buildScript = [
android : 'com.android.tools.build:gradle:3.2.0-rc02',
android : 'com.android.tools.build:gradle:3.3.0-beta01',
firebase : 'com.google.firebase:firebase-plugins:1.1.5',
googleServices : 'com.google.gms:google-services:3.2.0',
gradleStaticAnalysisPlugin: 'com.novoda:gradle-static-analysis-plugin:0.6',
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 0 additions & 13 deletions team-props/static-analysis.gradle
@@ -1,5 +1,4 @@
apply plugin: 'com.novoda.static-analysis'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'org.jlleitschuh.gradle.ktlint'

staticAnalysis {
Expand All @@ -18,16 +17,4 @@ staticAnalysis {
reporters = ["PLAIN_GROUP_BY_FILE", "CHECKSTYLE"]
includeVariants { variant -> variant.name == 'release' }
}

detekt {
version detektVersion

defaultProfile {
input = "$projectDir/src/"
config = teamPropsFile('static-analysis/detekt-config.yml')
filters = '.*/test/.*,.*/resources/.*,.*/tmp/.*,.*/build/.*,.*/debug/.*'
output = "$projectDir/build/reports/detekt"
parallel = true
}
}
}
47 changes: 35 additions & 12 deletions team-props/static-analysis/detekt-config.yml
Expand Up @@ -47,13 +47,6 @@ console-reports:
# - 'FindingsReport' If you exclude this, issues won't show on the console otherwise
# - 'BuildFailureReport' This NEEDS to be commented out, the build won't fail if we exclude it

output-reports:
active: true
exclude:
# - 'HtmlOutputReport'
# - 'PlainOutputReport'
# - 'XmlOutputReport'

comments:
active: true
CommentOverPrivateFunction:
Expand Down Expand Up @@ -85,6 +78,7 @@ complexity:
active: true
threshold: 10
ignoreSingleWhenExpression: true
ignoreSimpleWhenEntries: true
LabeledExpression:
active: false
LargeClass:
Expand Down Expand Up @@ -188,6 +182,7 @@ exceptions:
- IndexOutOfBoundsException
- RuntimeException
- Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
TooGenericExceptionThrown:
active: true
exceptionNames:
Expand Down Expand Up @@ -260,6 +255,9 @@ formatting:
NoWildcardImports:
active: true
autoCorrect: true
PackageName:
active: true
autoCorrect: true
ParameterListWrapping:
active: true
autoCorrect: true
Expand All @@ -279,6 +277,9 @@ formatting:
SpacingAroundOperators:
active: true
autoCorrect: true
SpacingAroundParens:
active: true
autoCorrect: true
SpacingAroundRangeOperator:
active: true
autoCorrect: true
Expand All @@ -291,6 +292,11 @@ naming:
ClassNaming:
active: true
classPattern: '[A-Z$][a-zA-Z0-9$]*'
ConstructorParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
EnumNaming:
active: true
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
Expand All @@ -307,15 +313,22 @@ naming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverriddenFunctions: true
MatchingDeclarationName:
active: false
MemberNameEqualsClassName:
active: false
ignoreOverriddenFunction: true
ObjectPropertyNaming:
active: true
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
constantPattern: '[A-Za-z][_A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
PackageNaming:
active: true
packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$'
Expand All @@ -335,6 +348,7 @@ naming:
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true

performance:
active: true
Expand Down Expand Up @@ -387,6 +401,8 @@ style:
conversionFunctionPrefix: 'to'
EqualsNullCall:
active: false
ExplicitItLambdaParameter:
active: false
ExpressionBodySyntax:
active: false
includeLineWrapping: false
Expand All @@ -396,6 +412,8 @@ style:
ForbiddenImport:
active: false
imports: ''
ForbiddenVoid:
active: false
FunctionOnlyReturningConstant:
active: false
ignoreOverridableFunction: true
Expand All @@ -406,7 +424,7 @@ style:
MagicNumber:
active: true
ignoreNumbers: '-1,0,1,2'
ignoreHashCodeFunction: false
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
Expand All @@ -418,8 +436,8 @@ style:
MaxLineLength:
active: true
maxLineLength: 150
excludePackageStatements: false
excludeImportStatements: false
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
MayBeConst:
active: false
Expand Down Expand Up @@ -460,8 +478,13 @@ style:
active: true
UnnecessaryAbstractClass:
active: false
excludeAnnotatedClasses: "dagger.Module"
UnnecessaryApply:
active: false
UnnecessaryInheritance:
active: false
UnnecessaryLet:
active: false
UnnecessaryParentheses:
active: false
UntilInsteadOfRangeTo:
Expand All @@ -470,7 +493,7 @@ style:
active: false
UnusedPrivateMember:
active: false
allowedNames: "(_|ignored|expected)"
allowedNames: "(_|ignored|expected|serialVersionUID)"
UseDataClass:
active: false
excludeAnnotatedClasses: ""
Expand Down

0 comments on commit fc4f151

Please sign in to comment.