My ‘release’ task applied on a root project from a common/shared ‘.gradle’ file has to depend on all existing ‘bintrayUpload’ tasks in subprojects. I tried:
Btw, there is one issue with your solution. Gradle requires to have a buildscript dependency definition in every ‘.gradle’ file imported into the main ‘.gradle’ file to be able to use classes from those plugins directly (also to import them). It duplicates places where the current dependency version number has to be kept.
Btw2, I wonder if there is a feature request to remove that limitation?
I mean “import com.jfrog.bintray.gradle.BintrayUploadTask” to be able to use it in the script. It fails when done in other file even if it is applied from the ‘.gradle’ which has Bintray plugin as a buildscript dependency.
If you add the buildscript dependency to your root project it should be available to all subprojects. What file are you defining the dependency in and what file is throwing the error?
build.gradle in my project with BintrayPlugin as a dependency. I apply releasing configuration from another file ‘apply from: ‘release.gradle’’. And in ‘release.gradle’ I cannot reference Bintrayplugin class directly unless I add there (to ‘release.gradle’ file) the whole ‘buildscript { repositories {}, dependencies {} }’ with dependency to Bintray plugin.
I doesn’t work. Having ‘buildscript {}’ with Bintray plugin dependency in ‘release.gradle’ and ‘apply plugin: ‘com.jfrog.bintray’’ in the same file I have got:
‘’’ > Failed to apply plugin [id ‘com.jfrog.bintray’]
I believe this is due to the fact that the ‘buildscript’ block is being evaluated before the plugin is being applied. Therefore there is no way to avoid defining the classpath dependency in both files. If you want to avoid hard-coding the dependency version in both places you can always define it as a project property in a ‘gradle.properties’ file.