The main build file for our project builds a war. Within that, we have various subprojects, one of which is for integration tests, and another is for performance tests. We don't want to run those every time because they're likely going to be slow. Instead we'd like them run from Hudson via some separate build target. There are also unit tests in the various subprojects, which we /would/ like run on every build.

So the default task is 'build', but I wanted to remove the test dependency from the integration and performance test modules.

I ended up doing this, which is hacky, but it works (and it lets you say 'gradle integrationTests' instead of 'gradle :integration-test:test'). So I don't know if I'll leave it or switch to your solution. But thanks for your help!

test.enabled = false

task enableIntegrationTests << {
  test.enabled = true
}

task integrationTests(dependsOn: ['enableIntegrationTests', 'test']) << {
}

On 08/09/2010 12:24 AM, Adam Murdoch wrote:

 On 8/08/10 6:30 AM, Michael Plump wrote:
Is there a way to remove a dependency? I would like to remove the dependency on "check" from the "build" task. The dependency is created by the Java plugin. Is there a way to yank it at some point after it has been created? (Or, I suppose, prevent it from being created at all?)

You can't remove a dependency as such, but you can overwrite the dependencies of a task. So, you can do something like this, after you've applied the jar plugin:

build.dependsOn = [assemble]

I'm curious why you can to get rid of check, if you don't mind me asking?




--
Michael "plumpy" Plump
Jelly Bean Consumption Specialist
Tripwire, LLC
503.880.4681 x187

Reply via email to