int128 / gradle-ssh-plugin

Gradle SSH Plugin
https://gradle-ssh-plugin.github.io
Apache License 2.0
318 stars 60 forks source link

Gradle 3.2 deprecation of task myTask() << {...} #282

Closed leon closed 7 years ago

leon commented 7 years ago

In gradle 3.2 they have deprecated the left shift operator of the task interface. https://docs.gradle.org/current/release-notes#deprecations

// WRONG: Description assigned in execution phase
task helloWorld << {
    description = 'Prints out a message.'
    println 'Hello world!'
}

// CORRECT: Description assigned in configuration phase
task helloWorld {
    description = 'Prints out a message.'
    doLast {
        println 'Hello world!'
    }
}

Should I simply do the same and wrap ssh.run with doLast or is there a cleaner way?

NielsUll commented 7 years ago

Yes, please wrap in doLast instead. It will avoid warnings during build when using the plugin. By the way, note that the two code samples are NOT identical - the description will be set at different times!

rm-- commented 7 years ago

@leon The link points not to the correct page. Check this one: https://docs.gradle.org/3.2/release-notes#deprecations.