Fix lint checks configuration.
Change-Id: I30f4e66df166fc636543301373251e467cc78715
diff --git a/flatfoot-common/init.gradle b/flatfoot-common/init.gradle
index 61f160b..2b67527 100644
--- a/flatfoot-common/init.gradle
+++ b/flatfoot-common/init.gradle
@@ -82,7 +82,12 @@
def createAndroidCheckstyle(Project project) {
def androidCheckstyle = project.tasks.create(name : 'checkstyleAndroid', type: Checkstyle) {
configFile rootProject.file('../../../development/tools/checkstyle/android-style.xml')
- source project.sourceSets.main.allJava
+ if (project.hasProperty('android')) {
+ source project.android.sourceSets.main.java.getSrcDirs()
+ }
+ if (project.sourceSets.hasProperty('main')) {
+ source project.sourceSets.main.allJava
+ }
ignoreFailures false
showViolations true
include '**/*.java'
diff --git a/lifecycle/compiler/src/main/kotlin/com/android/support/lifecycle/LifecycleProcessor.kt b/lifecycle/compiler/src/main/kotlin/com/android/support/lifecycle/LifecycleProcessor.kt
index 38915bf..adfd614 100644
--- a/lifecycle/compiler/src/main/kotlin/com/android/support/lifecycle/LifecycleProcessor.kt
+++ b/lifecycle/compiler/src/main/kotlin/com/android/support/lifecycle/LifecycleProcessor.kt
@@ -152,7 +152,8 @@
currentMethod.method.simpleName == m.method.simpleName
&& currentMethod.method.parameters.size == m.method.parameters.size
}
- if (baseMethod != null && baseMethod.onLifecycleEvent != currentMethod.onLifecycleEvent) {
+ if (baseMethod != null
+ && baseMethod.onLifecycleEvent != currentMethod.onLifecycleEvent) {
printErrorMessage(INVALID_STATE_OVERRIDE_METHOD, currentMethod.method)
}
baseMethod == null
diff --git a/lifecycle/compiler/src/tests/kotlin/com/android/support/lifecycle/InvalidCasesTest.kt b/lifecycle/compiler/src/tests/kotlin/com/android/support/lifecycle/InvalidCasesTest.kt
index bcdb115..72b48be 100644
--- a/lifecycle/compiler/src/tests/kotlin/com/android/support/lifecycle/InvalidCasesTest.kt
+++ b/lifecycle/compiler/src/tests/kotlin/com/android/support/lifecycle/InvalidCasesTest.kt
@@ -32,8 +32,10 @@
arrayOf<Any>("TooManyArgs", LifecycleProcessor.TOO_MANY_ARGS_ERROR_MSG),
arrayOf<Any>("InvalidMethodModifier", LifecycleProcessor.INVALID_METHOD_MODIFIER),
arrayOf<Any>("InvalidClassModifier", LifecycleProcessor.INVALID_CLASS_MODIFIER),
- arrayOf<Any>("InvalidInheritance1", LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD),
- arrayOf<Any>("InvalidInheritance2", LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD)
+ arrayOf<Any>("InvalidInheritance1",
+ LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD),
+ arrayOf<Any>("InvalidInheritance2",
+ LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD)
)
}