How can i execute command from a task excluding so...
# gradle
j
How can i execute command from a task excluding some module from run? I want to exclude subproject “analytics” for example
Copy code
task updateLint(type: Delete) {
    fileTree(rootDir).each {
        if (it.name == "lint-baseline.xml") {
            delete it
        }
    }
    dependsOn("lint --parallel -Dlint.baselines.continue=true")
}
v
I don't understand your example. I would expect from that just getting a "Task with name 'lint --parallel -Dlint.baselines.continue=true' not found"
j
Could not determine the dependencies of task ‘:updateLint’.
Task with path ‘check-in:lint --parallel -Dlint.baselines.continue=true’ not found in root project ‘GHQ_ABI_Android_OnTapApp’.
Thats an error im gettinh
v
Yes, just what I said. 🙂
You try to depend on a task named
lint --parallel -Dlint.baselines.continue=true
j
yes, i have no idea how to make it workt… 😞
v
You can only depend on other tasks, you cannot "call" other tasks and give them arbitrary arguments. Not without executing a whole new build e. g. using the tooling api
j
Theres no way i can run this command after my task ?
v
As I said, not without executing a whole new build e.g. using the tooling api.
But maybe you should just let the user give the needed arguments
j
got it. i will let it separate, thank you