Comments (8)
You shouldn't need that second block. We will create that lintByImpact
task for you and internally check if the module is affected. If you delete that this should work properly but feel free to reopen
from affectedmoduledetector.
You shouldn't need that second block. We will create that
lintByImpact
task for you and internally check if the module is affected. If you delete that this should work properly but feel free to reopen
allprojects {
tasks.register("lintByImpact") {
def lintReleaseTask = it.project.tasks.findByName("lintRelease")
if (lintReleaseTask != null) {
it.dependsOn(lintReleaseTask)
}
}
}
This block is added to have lintByImpact
act as a wrapper task around lintRelease
. This is done because not every module is configured for lint and may not have lintRelease
task. So if a module is affected/changed but does not have lint, then gradle will try to execute lintRelease for that module but fail due to no task available
from affectedmoduledetector.
This is fixed by #233 and will be part of the next release
from affectedmoduledetector.
@joshafeinberg when is the next release expected to be out?
from affectedmoduledetector.
Probably in the next week or two
from affectedmoduledetector.
Is there a way to achieve this before the new release is out? Right now I am getting an error because not all modules have lint and adding the second block causes task in all modules to be executed.
from affectedmoduledetector.
Okay, found a work around using a check AffectedModuleDetector.isProjectAffected(it.project)
. Will use this until the fix is released in the new version.
allprojects {
tasks.register("lintByImpact") {
def lintReleaseTask = it.project.tasks.findByName("lintRelease")
if (lintReleaseTask != null && AffectedModuleDetector.isProjectAffected(it.project)) {
it.dependsOn(lintReleaseTask)
}
}
}
from affectedmoduledetector.
@joshafeinberg The above approach works on a sample project. However, when trying the same in my actual project, I get the following error during sync
Caused by: org.gradle.api.UnknownDomainObjectException: Extension with name 'AffectedModuleDetectorPlugin' does not exist. Currently registered extension names: [..., affectedModuleDetector]
at org.gradle.internal.extensibility.ExtensionsStorage.unknownExtensionException(ExtensionsStorage.java:144)
at org.gradle.internal.extensibility.ExtensionsStorage.getByName(ExtensionsStorage.java:123)
at org.gradle.internal.extensibility.DefaultConvention.getByName(DefaultConvention.java:175)
at com.dropbox.affectedmoduledetector.AffectedModuleDetector$Companion.getInstance(AffectedModuleDetector.kt:196)
at com.dropbox.affectedmoduledetector.AffectedModuleDetector$Companion.getOrThrow(AffectedModuleDetector.kt:201)
at com.dropbox.affectedmoduledetector.AffectedModuleDetector$Companion.isProjectAffected(AffectedModuleDetector.kt:248)
at com.dropbox.affectedmoduledetector.AffectedModuleDetector.isProjectAffected(AffectedModuleDetector.kt)
at com.dropbox.affectedmoduledetector.AffectedModuleDetector$isProjectAffected.call(Unknown Source)
at build_7zf0s7eu8gxds3n6vju1hes3g$_run_closure7$_closure25.doCall
Any idea why I am seeing this error? If I remove the if check AffectedModuleDetector.isProjectAffected(it.project)
from the script, sync is successful.
I do have the 2 following imports at the top
import com.dropbox.affectedmoduledetector.AffectedModuleConfiguration
import com.dropbox.affectedmoduledetector.AffectedModuleDetector
from affectedmoduledetector.
Related Issues (20)
- excludedModules is not working with custom task. HOT 4
- CustomTask should use Gradle's NamedDomainObjectContainer or NamedDomainObjectSet HOT 1
- Support exotic non standard Gradle project structures
- DependencyTracker written in Groovy
- Add an option to exclude jvm test paths HOT 1
- Assemble only affected Apps in multimodle project HOT 1
- Mixing java libraries with android libraries HOT 1
- Getting a list of changed/dependent modules without running tests HOT 1
- Unable to get Log files to generate HOT 6
- When running with clean Task, all the tests are run HOT 1
- A version bump to a runtimeOnly dependency does not mark module as affected HOT 2
- Help debugging why unnecessary tasks are running HOT 4
- Depends on gradle tasks only if project is affected HOT 3
- Dry run of gradle cmd HOT 1
- Sample project fails to compile HOT 2
- Slashes in current branch name being replaced with backslashes on windows HOT 1
- running all tests everytime HOT 1
- Weird behavior on git commands HOT 4
- Non-java Modules don't get tested
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from affectedmoduledetector.