Thread
#detekt
    brent

    brent

    1 year ago
    Any examples of using CLI version of detekt on an Android project with type resolution enabled? I'm able to run without type resolution but once I add the
    --classpath
    param to enable type resolution my execution time goes from a few minutes to ∞ and eventually an OOM crash.
    gammax

    gammax

    1 year ago
    I’m not aware of sample projects. Generally on Android you would use the Gradle plugin. Is there a reason why you can’t use it?
    brent

    brent

    1 year ago
    We're currently using the gradle plugin. Trying the CLI version is a bit of an experiment.
    gammax

    gammax

    1 year ago
    Are
    detektMain
    and other type-resolution enabled tasks running fine on your codebase?
    brent

    brent

    1 year ago
    Yes.
    Tasks with
    @RequiresTypeResolution
    are being report correctly (and added to baseline correctly) with our current gradle setup. Just can't figure out or find an example of a CLI execution that uses the
    --classpath
    param.
    Just got back to playing with this a bit more -- I've found that using a classpath that only references to
    android-stubs-src.jar
    works if you give the process enough memory (
    -Xmx16g
    ) but it still took 2hrs to execute vs ~8 minutes without type resolution enabled. Is this expected?
    gammax

    gammax

    1 year ago
    Is this expected?
    Nope is not imho. Have you compared with your Gradle execution time?
    brent

    brent

    1 year ago
    Gradle execution time is about 60minutes (with no cache).
    FWIW; It's a large project - just under 1M lines of kotlin.
    Last update, just as an FYI; testing on a CircleCI large instance (
    2xlarge+
    ), giving the detekt java process 36g of RAML, execution without type resolution is <1min. And WITH type resolution is ~46minutes. So we're going to stick with the gradle plugin.