All Projects → ismaeldivita → change-tracker-plugin

ismaeldivita / change-tracker-plugin

Licence: MIT License
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to change-tracker-plugin

Gradle Testsets Plugin
A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
Stars: ✭ 182 (+76.7%)
Mutual labels:  gradle, test, gradle-plugin
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (+591.26%)
Mutual labels:  gradle, test, gradle-plugin
Gradle Test Logger Plugin
A Gradle plugin for printing beautiful logs on the console while running tests
Stars: ✭ 460 (+346.6%)
Mutual labels:  gradle, test, gradle-plugin
jooq-plugin
Plugin for generating jOOQ classes using dockerized databases
Stars: ✭ 55 (-46.6%)
Mutual labels:  gradle, gradle-plugin
scalatest-junit-runner
JUnit 5 runner for Scalatest
Stars: ✭ 30 (-70.87%)
Mutual labels:  test, gradle-plugin
kotlin-plugin-generated
A Kotlin compiler plugin that annotates Kotlin-generated methods for improved coverage reports
Stars: ✭ 33 (-67.96%)
Mutual labels:  test, gradle-plugin
plugin-yml
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project
Stars: ✭ 42 (-59.22%)
Mutual labels:  gradle, gradle-plugin
sphinx-gradle-plugin
Sphinx site generation plugin for Gradle
Stars: ✭ 19 (-81.55%)
Mutual labels:  gradle, gradle-plugin
kotest-gradle-plugin
A gradle plugin for Kotest
Stars: ✭ 18 (-82.52%)
Mutual labels:  test, gradle-plugin
gradle-helm-plugin
A Gradle plugin for building, publishing and managing Helm charts.
Stars: ✭ 42 (-59.22%)
Mutual labels:  gradle, gradle-plugin
gatling-gradle-plugin-demo
Showcase of the Gatling Plugin for Gradle
Stars: ✭ 17 (-83.5%)
Mutual labels:  gradle, gradle-plugin
SetupBuilder
Gradle plugin for building setups for different platforms.
Stars: ✭ 75 (-27.18%)
Mutual labels:  gradle, gradle-plugin
gradle-console-reporter
Gradle plugin to report various kinds of summaries to console.
Stars: ✭ 49 (-52.43%)
Mutual labels:  gradle, gradle-plugin
Android Clean Architecture
Showcasing a Clean Architecture approach from our Android applications framework!
Stars: ✭ 160 (+55.34%)
Mutual labels:  modules, gradle
gradle-cleaner-intellij-plugin
Force clear delaying & no longer needed Gradle tasks.
Stars: ✭ 26 (-74.76%)
Mutual labels:  gradle, gradle-plugin
Badass Jlink Plugin
Create a custom runtime image of your modular application
Stars: ✭ 216 (+109.71%)
Mutual labels:  gradle, gradle-plugin
gradle-localization-plugin
Gradle plugin for automating the download process of localization files.
Stars: ✭ 19 (-81.55%)
Mutual labels:  gradle, gradle-plugin
RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+296.12%)
Mutual labels:  gradle, gradle-plugin
Gradle Launch4j
A gradle-plugin to create windows executables with launch4j
Stars: ✭ 177 (+71.84%)
Mutual labels:  gradle, gradle-plugin
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (+72.82%)
Mutual labels:  gradle, gradle-plugin

Change Tracker Plugin

A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

The idea behind this plugin is to optimize running verification tasks on large modularized projects. There is no need to run these tasks on all modules every time we apply a change. Instead, we could run them only on modules affected by the changes and their dependents.


Take the following project structure as an example:



If you apply changes to the :profile-service module, you only need to run your verification tasks on :profile-service:profile-feature, and :app. It's safe to skip the tasks on all the other modules since they don't depend on :profile-service and can't be affected by these changes.

Setup

Apply the plugin and the configuration to your root project build.gradle

plugins {
    id 'com.ismaeldivita.changetracker' version '0.7.4'
}

// ...

changeTracker {
    tasks = ['lint','testDebugUnitTest']
    whitelist = [':app']
    blacklist = [':network',':featureA']
    reevaluate = [':sharedTest']
    branch = "master"
    remote = "origin"
}
  • tasks: List of the tasks the plugin will need to create.
  • branch: Name of the branch that should be used to extract the diff.
  • whitelist (optional): List of modules that should always run.
  • blacklist (optional): List of modules that should never run.
  • reevaluate (optional): List of modules that will trigger the task for all modules
  • remote (optional): Name of the remote repository.

Usage

The plugin will generate new tasks on the root project for each task provided on the configuration with the following name ${taskName}ChangedModules.

Taking as an example the configuration above the plugin will generate two new tasks lintChangedModules and testDebugUnitTestChangedModules.

To run your task:

./gradlew testDebugUnitTestChangedModules

You can override the default branch used for the comparison when running your command. This is useful when you're using the plugin on pull requests and each pull request may have different base branches.

./gradlew testDebugUnitTestChangedModules -Pbranch=dev

Notes

  • This plugin will assume you use GIT as your VCS.
  • Any changes to the root project or buildSrc will trigger the task for all modules.
  • Test configurations will not be tracked since dependency cycles could be created for test purposes and this is not supported by this plugin. If you have a shared test library project and want to trigger the tasks on their dependents check the reevaluate configuration.

License

MIT License

Copyright (c) 2019 Ismael Di Vita

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].