This plugin allows to collect build metrics (like build time, tasks, etc) and dispatch to different sources.
Also the plugin provides API to implement your own collectors and dispatchers.
buildscript {
repositories {
// ...
maven {
url = uri("https://maven.pkg.github.com/santaevpavel/gradle-metrics-plugin")
credentials {
username = "YOUR USERNAME"
password = "GITHUB TOKEN"
}
}
}
// ...
dependencies {
classpath "io.github.santaevpavel.gradle-metrics-plugin:gradle-metrics-plugin:1.0.0"
}
}
apply plugin: 'io.github.santaevpavel.gradle-metrics-plugin'
metrics {
collectors {
Build
TaskNames
TasksCount
ProjectProperties
}
dispatchers {
ConsoleDispatcher
}
}
- Build time
- Build result
- Task name
- Tasks count
- Project name
- Root project name
- File size
- Unit test results
- Console
- File
This extension allows to send build metrics to Amplitude.
- Add Github maven repository.
buildscript {
repositories {
// ...
maven {
url = uri("https://maven.pkg.github.com/santaevpavel/gradle-metrics-plugin")
credentials {
username = "YOUR USERNAME"
password = "GITHUB TOKEN"
}
}
}
// ...
}
Add Github properties to local.properties
- Add dependency
dependencies {
// ...
gradleMetricsPluginExtension "io.github.santaevpavel.gradle-metrics-plugin:amplitude-extension:1.0.0"
}
- Configure amplitude extension
metrics {
collectors {
// ...
}
dispatchers {
// ...
AmplitudeDispatcher {
apiKey = "AMPLITUDE API KEY"
}
}
}
There is sample
project that includes this plugin and core extensions.
Test project requires plugin and extensions dependency in build/repo
directory.
To publish dependencies to local repo (build/repo
) you need to run
./publishLocal.sh
.
Then run command sample:jar
to check plugin out.