Apply Gradle plugin from source using `plugins` block

I’m trying to apply a Gradle plugin from source.

I figured out how to do it using the legacy apply method:

// build.gradle

buildscript {
    dependencies {
        classpath("com.verificationgentleman.gradle:gradle-hdvl") {
            version {
                branch = "master"

apply plugin: 'com.verificationgentleman.gradle.hdvl.systemverilog'
// settings.gradle

sourceControl {
    gitRepository("") {

Is it possible to do the same, but use the plugins block instead?

Hi @tudortimi,

No that is not possible at the moment. The reason is that source dependencies are resolved lazy at the moment. That is, only once the dependency is resolved the repository is cloned/updated.

For the plugins block, Gradle would need to do this upfront to know which plugins are provided by a source dependency. For that we would need a special mechanism that allows you to declare such a source dependency for this “early resolution”.

We are working on improving the mechanism for local included builds (see In the future it might be possible to build on top of that for source dependencies.

1 Like

Thanks for the info! As long as the apply(...) mechanism sticks around until source dependencies are available for “early resolution” it should be fine.