Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/ci_test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'dropbox/AffectedModuleDetector' && github.ref == 'refs/heads/main'
if: github.repository == 'flo-health/AffectedModuleDetector' && github.ref == 'refs/heads/main'

steps:
- name: Checkout
Expand All @@ -28,8 +28,8 @@ jobs:
- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

Expand Down Expand Up @@ -64,5 +64,3 @@ jobs:
script: ./gradlew assemble testCoverage
env:
API_LEVEL: ${{ matrix.api-level }}
- name: Upload code coverage
run: bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@

Copyright (c) 2019 Dropbox, Inc.

Copyright 2026 Flo Health, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
# Affected Module Detector

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.dropbox.affectedmoduledetector/affectedmoduledetector/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.dropbox.affectedmoduledetector/affectedmoduledetector/)

[![Build Status](https://travis-ci.org/dropbox/AffectedModuleDetector.svg?branch=main)](https://travis-ci.org/dropbox/AffectedModuleDetector)

[![codecov](https://codecov.io/gh/dropbox/AffectedModuleDetector/branch/main/graph/badge.svg)](https://codecov.io/gh/dropbox/AffectedModuleDetector)

A Gradle Plugin to determine which modules were affected by a set of files in a commit. One use case for this plugin is for developers who would like to only run tests in modules which have changed in a given commit.

This project is a fork of https://github.com/dropbox/AffectedModuleDetector, originally developed by **Dropbox**. We thank Dropbox for their work and contributions.

## Overview

The AffectedModuleDetector will look at the last commit and determine which files have changed, it will then build a dependency graph of all the modules in the project. The detector exposes a set of APIs which can be used to determine whether a module was considered affected.

### ⚠️ Maintenance Status

Affected Module Detector is in maintenance mode.

Only critical fixes may be merged. There are no plans for new features and no guaranteed support timeline. See [this issue](https://github.com/dropbox/AffectedModuleDetector/issues/335) for details and ownership discussion.

### Git

The module detector assumes that it is being applied to a project stored in git and a git client is present on the system. It will query the last commit on the current branch to determine the list of files changed.
Expand Down Expand Up @@ -56,7 +46,7 @@ pluginManagement {

// root build.gradle(.kts)
plugins {
id("com.dropbox.affectedmoduledetector") version "<latest-version>"
id("health.flo.affectedmoduledetector") version "<latest-version>"
}
```

Expand All @@ -71,16 +61,16 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.dropbox.affectedmoduledetector:affectedmoduledetector:<LATEST_VERSION>"
classpath "health.flo.affectedmoduledetector:affectedmoduledetector:<LATEST_VERSION>"
}
}
//rootproject
apply plugin: "com.dropbox.affectedmoduledetector"
apply plugin: "health.flo.affectedmoduledetector"
```

If you want to develop a plugin using the APIs, add this to your `buildSrc`'s `dependencies` list:
```
implementation("com.dropbox.affectedmoduledetector:affectedmoduledetector:<LATEST_VERSION>")
implementation("health.flo.affectedmoduledetector:affectedmoduledetector:<LATEST_VERSION>")
```

## Configuration
Expand Down Expand Up @@ -133,7 +123,7 @@ affectedModuleDetector {
- `excludedModules`: A list of modules that will be excluded from the build process, can be the name of a module, or a regex against the module gradle path
- `includeUncommitted`: If uncommitted files should be considered affected
- `top`: The top of the git log to use. Must be used in combination with configuration `includeUncommitted = false`
- `customTasks`: set of [CustomTask](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)
- `customTasks`: set of [CustomTask](https://github.com/flo-health/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)

By default, the Detector will look for `assembleAndroidDebugTest`, `connectedAndroidDebugTest`, and `testDebug`. Modules can specify a configuration block to specify which variant tests to run:
```groovy
Expand Down Expand Up @@ -226,8 +216,8 @@ You should see zero tests run. Make a change within one of the modules and commi
## Custom tasks

If you want to add a custom gradle command to execute with impact analysis
you must declare [AffectedModuleConfiguration.CustomTask](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)
which is implementing the [AffectedModuleTaskType](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleTaskType.kt) interface in the `build.gradle` configuration of your project:
you must declare [AffectedModuleConfiguration.CustomTask](https://github.com/flo-health/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleConfiguration.kt)
which is implementing the [AffectedModuleTaskType](https://github.com/flo-health/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleTaskType.kt) interface in the `build.gradle` configuration of your project:

```groovy
// ...
Expand All @@ -248,7 +238,7 @@ affectedModuleDetector {
**NOTE:** Please, test all your custom commands.
If your custom task doesn't work correctly after testing, it might be that your task is quite complex
and to work correctly it must use more gradle api's.
Hence, you must create `buildSrc` module and write a custom plugin manually like [AffectedModuleDetectorPlugin](https://github.com/dropbox/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt)
Hence, you must create `buildSrc` module and write a custom plugin manually like [AffectedModuleDetectorPlugin](https://github.com/flo-health/AffectedModuleDetector/blob/main/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt)

## Notes

Expand All @@ -258,6 +248,8 @@ Special thanks to the AndroidX team for originally developing this project at ht

Copyright (c) 2021 Dropbox, Inc.

Copyright 2026 Flo Health, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
12 changes: 6 additions & 6 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Releasing
4. `git push && git push --tags`
* This should be pushed to your fork.
5. Create a PR with this commit and merge it.
6. Confirm the new artifacts are present in https://s01.oss.sonatype.org/content/repositories/releases/com/dropbox/affectedmoduledetector/affectedmoduledetector/
* If the plugin fails to publish the release, you'll need to log into Sonatype and drop any repositories under 'Staging Repositories' and re-run the CI job to publish.
7. Go to https://github.com/dropbox/AffectedModuleDetector/releases and `Draft a new release` from the tag you just created
7. Update the top level `gradle.properties` to the next SNAPSHOT version.
8. `git commit -am "Prepare next development version."`
9. Create a PR with this commit and merge it.
6. Confirm the new artifacts are present in https://repo1.maven.org/maven2/health/flo/affectedmoduledetector/affectedmoduledetector/
* If the plugin fails to publish the release, you'll need to log into the Central Portal (central.sonatype.com) and discard the failed deployment, then re-run the CI job to publish.
7. Go to https://github.com/flo-health/AffectedModuleDetector/releases and `Draft a new release` from the tag you've just created
8. Update the top level `gradle.properties` to the next SNAPSHOT version.
9. `git commit -am "Prepare next development version."`
10. Create a PR with this commit and merge it.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AffectedModuleDetectorIntegrationTest {
)
tmpFolder.newFile("build.gradle").writeText(
"""plugins {
| id "com.dropbox.affectedmoduledetector"
| id "health.flo.affectedmoduledetector"
|}""".trimMargin()
)

Expand Down Expand Up @@ -64,7 +64,7 @@ class AffectedModuleDetectorIntegrationTest {
| }
|}
|plugins {
| id "com.dropbox.affectedmoduledetector"
| id "health.flo.affectedmoduledetector"
|}
|allprojects {
| repositories {
Expand Down Expand Up @@ -156,7 +156,7 @@ class AffectedModuleDetectorIntegrationTest {
| }
|}
|plugins {
| id "com.dropbox.affectedmoduledetector"
| id "health.flo.affectedmoduledetector"
|}
|affectedModuleDetector {
| excludedModules = [ "sample-core" ]
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ android.enableJetifier=true
kotlin.code.style=official

# POM
GROUP = com.dropbox.affectedmoduledetector
GROUP = health.flo.affectedmoduledetector
VERSION_NAME=0.6.3-SNAPSHOT

POM_ARTIFACT_ID = affectedmoduledetector
POM_NAME = Affected Module Detector
POM_DESCRIPTION = A Gradle Plugin and library to determine which modules were affected in a commit.

POM_URL = https://github.com/dropbox/AffectedModuleDetector/
POM_SCM_URL = https://github.com/dropbox/AffectedModuleDetector/
POM_SCM_CONNECTION = scm:git:https://github.com/dropbox/AffectedModuleDetector.git
POM_SCM_DEV_CONNECTION = scm:git:git@github.com:dropbox/AffectedModuleDetector.git
POM_URL = https://github.com/flo-health/AffectedModuleDetector/
POM_SCM_URL = https://github.com/flo-health/AffectedModuleDetector/
POM_SCM_CONNECTION = scm:git:https://github.com/flo-health/AffectedModuleDetector.git
POM_SCM_DEV_CONNECTION = scm:git:git@github.com:flo-health/AffectedModuleDetector.git

POM_LICENCE_NAME = The Apache License, Version 2.0
POM_LICENCE_URL = http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST = repo

POM_DEVELOPER_ID = mplat-dbx
POM_DEVELOPER_NAME = Dropbox
POM_DEVELOPER_URL = https://github.com/dropbox/
POM_DEVELOPER_EMAIL = api-support@dropbox.com
POM_DEVELOPER_ID = flo-health
POM_DEVELOPER_NAME = Flo Health
POM_DEVELOPER_URL = https://github.com/flo-health/
POM_DEVELOPER_EMAIL = android-opensource@flo.health

mavenCentralAutomaticPublishing=true
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {
}

apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: "com.dropbox.affectedmoduledetector"
apply plugin: "health.flo.affectedmoduledetector"

affectedModuleDetector {
baseDir = "${project.rootDir}"
Expand Down
2 changes: 1 addition & 1 deletion sample/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

dependencies {
implementation("com.dropbox.affectedmoduledetector:affectedmoduledetector:0.6.3-SNAPSHOT")
implementation("health.flo.affectedmoduledetector:affectedmoduledetector:0.6.3-SNAPSHOT")
testImplementation("junit:junit:4.13.1")
testImplementation("com.nhaarman:mockito-kotlin:1.5.0")
testImplementation("com.google.truth:truth:1.0.1")
Expand Down
Loading