Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Spawn (test) dependency #7

Open
matsev opened this issue Nov 27, 2015 · 1 comment
Open

Feature Request: Spawn (test) dependency #7

matsev opened this issue Nov 27, 2015 · 1 comment

Comments

@matsev
Copy link

matsev commented Nov 27, 2015

It would be good to be able to declare a third party dependency (either as compile or testCompile dependency) and be able to spawn it. The third party dependency may in turn have several dependencies on its own, so the gradle-spawn-plugin needs to traverse all transitive dependencies recursively and add them to the classpath.

Below is example of how it would be used (the syntax and naming are just suggestions):

import com.wiredforcode.gradle.spawn.*

buildscript {
    repositories {
        ...
        maven { url 'http://dl.bintray.com/vermeulen-mp/gradle-plugins' }
    }
    dependencies {
        classpath 'com.wiredforcode:gradle-spawn-plugin:0.6.0'
    }
}

dependencies {
    testCompile("com.example.dependency:third-party-jar:1.0.0")
}

apply plugin: 'com.wiredforcode.spawn'

task startServer(type: SpawnProcessTask, dependsOn: 'assemble') {
    artifactId 'third-party-jar' // name act as a predicate to select which artifact to be executed
    commandLineArgs '[optional string of command line args]'
    ready 'Started Application'
}

task stopServer(type: KillProcessTask)

test.dependsOn startServer

test.finalizedBy stopServer
@gorky
Copy link

gorky commented Oct 19, 2017

Currently available.
I am using the syntax:
task startMyProcess(type: SpawnProcessTask, dependsOn: [stopMyProcess, classes],...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants