diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/lint/BUCK_FILE b/buildSrc/src/main/resources/com/uber/okbuck/core/util/lint/BUCK_FILE index e9953834b..fb9796d01 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/lint/BUCK_FILE +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/lint/BUCK_FILE @@ -31,8 +31,9 @@ java_binary( name='okbuck_lint', deps=map(lambda x: ":" + x, jars), blacklist=[ - 'META-INF', - 'org.jetbrains.annotations', + 'META-INF/.*\.SF', + 'META-INF/.*\.DSA', + 'META-INF/.*\.RSA', ], visibility = ['PUBLIC'], ) diff --git a/config/lint/lint.xml b/config/lint/lint.xml index a200707ea..0bcd62630 100644 --- a/config/lint/lint.xml +++ b/config/lint/lint.xml @@ -1,5 +1,4 @@ - \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index 99ae9bb24..323973b71 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,11 +1,11 @@ def versions = [ - androidPlugin : "3.1.1", - androidTools : "26.0.1", + androidPlugin : "3.1.2", + androidTools : "26.1.2", butterKnife : "9.0.0-20180416.155017-37", butterKnifeCompiler: "9.0.0-20180416.155025-37", butterKnifePlugin : "9.0.0-20180416.155029-37", dagger : "2.15", - kotlin : "1.2.31", + kotlin : "1.2.40", leakCanary : "1.5.4", rocker : "0.23.0", support : "27.1.0", diff --git a/libraries/customLintLibrary/src/main/java/com/uber/lint/SystemCurrentTimeMillisDetector.java b/libraries/customLintLibrary/src/main/java/com/uber/lint/SystemCurrentTimeMillisDetector.java index cf6f782bd..816032545 100644 --- a/libraries/customLintLibrary/src/main/java/com/uber/lint/SystemCurrentTimeMillisDetector.java +++ b/libraries/customLintLibrary/src/main/java/com/uber/lint/SystemCurrentTimeMillisDetector.java @@ -1,6 +1,5 @@ package com.uber.lint; -import com.android.annotations.NonNull; import com.android.annotations.Nullable; import com.android.tools.lint.detector.api.Category; import com.android.tools.lint.detector.api.Detector; @@ -9,17 +8,16 @@ import com.android.tools.lint.detector.api.JavaContext; import com.android.tools.lint.detector.api.Scope; import com.android.tools.lint.detector.api.Severity; +import com.intellij.psi.PsiMethod; +import org.jetbrains.uast.UCallExpression; import java.util.Collections; import java.util.List; -import lombok.ast.AstVisitor; -import lombok.ast.MethodInvocation; - /** * Custom Lint Check to prevent useage of System.currentTimeMillis. */ -public class SystemCurrentTimeMillisDetector extends Detector implements Detector.JavaScanner { +public class SystemCurrentTimeMillisDetector extends Detector implements Detector.UastScanner { public static final String CHECK_METHOD_TO_EXCLUDE = "currentTimeMillis"; public static final String CHECK_PACKAGE_TO_EXCLUDE = "java.lang.System"; @@ -50,13 +48,12 @@ public List getApplicableMethodNames() { * Check that the currentTimeMillis() came from the System package, if so raise an error. * * @param context - * @param visitor * @param node + * @param method */ @Override - public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor, - @NonNull MethodInvocation node) { + public void visitMethod(JavaContext context, UCallExpression node, PsiMethod method) { String message = "System.currentTimeMillis() should not be used as this can't be easily mocked and tested."; - context.report(ISSUE, node, context.getLocation(node.astName()), message); + context.report(ISSUE, node, context.getLocation(node), message); } } diff --git a/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/KotlinParcelable.kt b/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/KotlinParcelable.kt index 470bd4c91..2c88a8b7c 100644 --- a/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/KotlinParcelable.kt +++ b/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/KotlinParcelable.kt @@ -1,7 +1,9 @@ package com.uber.okbuck.kotlin +import android.annotation.SuppressLint import android.os.Parcelable import kotlinx.android.parcel.Parcelize +@SuppressLint("ParcelCreator") // https://youtrack.jetbrains.com/issue/KT-19300 @Parcelize class KotlinParcelable(val name: String) : Parcelable