Skip to content

Critical path#

Critical path is a set of tasks that define the build duration. The plugin gives a report with raw data.

It is very similar to what you can find in a build scan in Timeline tab: build scan - critical path

Getting started#

Apply the plugin in the root buildscript:

plugins {
    id("com.avito.android.critical-path")
}

criticalPath {
    enabled.set(true)
}
Setup plugins

In the settings.gradle:

pluginManagement {
    repositories {
        mavenCentral()
    }
    resolutionStrategy {
        eachPlugin {
            String pluginId = requested.id.id
            if (pluginId.startsWith("com.avito.android")) {
                def artifact = pluginId.replace("com.avito.android.", "")
                useModule("com.avito.android:$artifact:$avitoToolsVersion")
            }
        }
    }
}

avitoToolsVersion could be exact version, or property in project's gradle.properties. The latest version could be found on project's release page.

Run a build. You will get a report in build/reports/critical-path/ directory.

Warning

This report is auxiliary and is a subject of change.

[
    {
        "path": ":lib:compileKotlin",
        "type": "KotlinCompile",
        "start": 1620217409525,
        "finish": 1620217409525
    }
]

See also build trace for visualization.