Gradle pluginBundle, gradlePlugin, and website

I am using Gradle 6.8.2, and upgrading it further is not a possibility right now. I am trying to upgrade the JWebAssembly-Gradle for use. The old code had:

plugins {
  id "com.gradle.plugin-publish" version "0.20.0"
}

pluginBundle {
    website = 'https://github.com/i-net-software/JWebAssembly-Gradle'
    vcsUrl = 'https://github.com/i-net-software/JWebAssembly-Gradle'
    description = 'A Gradle plugin for the JWebAssembly compiler. A Java bytecode to WebAssembly converter. It produce the WASM and JavaScript file from your *.java, *.class and/or *.jar files.'
    tags = ['jwebassembly', 'webassembly', 'wasm', 'java', 'bytecode', 'compile', 'converter', 'transpiler' ]

    plugins {
        jwebassemblerPlugin {
            id = 'de.inetsoftware.jwebassembly'
            displayName = 'Gradle JWebAssembly plugin'
            tags = ['jwebassembly', 'webassembly', 'wasm', 'java', 'bytecode', 'compile', 'converter', 'transpiler' ]
        }
    }
    mavenCoordinates {
        artifactId = archivesBaseName
    }
}

I tried to replace that with the following:

plugins {
//  id "com.gradle.plugin-publish" version "0.21.0"
    id 'com.gradle.plugin-publish' version '1.0.0'
}

gradlePlugin {
    website = 'https://github.com/i-net-software/JWebAssembly-Gradle'
    vcsUrl = 'https://github.com/i-net-software/JWebAssembly-Gradle'
    description = 'A Gradle plugin for the JWebAssembly compiler. A Java bytecode to WebAssembly converter. It produce the WASM and JavaScript file from your *.java, *.class and/or *.jar files.'
//    tags = ['jwebassembly', 'webassembly', 'wasm', 'java', 'bytecode', 'compile', 'converter', 'transpiler' ]

    plugins {
        jwebassemblerPlugin {
            id = 'de.inetsoftware.jwebassembly'
            displayName = 'Gradle JWebAssembly plugin'
            tags = ['jwebassembly', 'webassembly', 'wasm', 'java', 'bytecode', 'compile', 'converter', 'transpiler' ]
        }
    }
    mavenCoordinates {
        artifactId = archivesBaseName
    }
}

I am now getting the error:

A problem occurred evaluating root project ‘JWebAssembly-Gradle’.

Could not set unknown property ‘website’ for extension ‘gradlePlugin’ of type org.gradle.plugin.devel.GradlePluginDevelopmentExtension.

I have search the code, but I can’t find where it is implemented. I also can’t find anything on the pluginBundle.website property, or how it applies to the gradlePlugin and a possible website property. I don’t plan on publishing this for general use.

How can I fix this issue?

1 Like

gradlePlugin { ... } is not part of the com.gradle.plugin-publish plugin, but part of the java-gradle-plugin which is built-in into Gradle and thus depends on the version of Gradle not of the plugin publish plugin. In Gradle 6.8.2 there is no website property in the extension of the java-gradle-plugin, that was only added in 7.6.

That’s btw. also what the docs at Gradle - How do I publish my plugin? say in the Examples section:

Plugin Publish plugin v1.0.0 simplifies the configuration of plugin publishing by merging the pluginBundle block into the gradlePlugin one.
These simplifications however require backing support in the Gradle API, so are only available when using the Plugin Publish Plugin with Gradle v7.6 or later.

So I guess with 6.8.2 you just continue configuring the website and maybe other things in the pluginBundle block.

1 Like

You only need to upgrade gradle/wrapper/gradle-wrapper.properties to Gradle v7.6 or later. e.g. distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip

Well, his first sentence was, that upgrading beyond 6.8.2 is not an option for him right now. :wink: