JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.41k stars 270 forks source link

2.0 - intellijPlatform in dependencies block is not usable from Groovy #1592

Closed hfhbd closed 4 days ago

hfhbd commented 3 months ago

What happened?

In Groovy, the IntelliJPlatform block is not useable, it is in Kotlin.

Relevant log output or stack trace

UnsupportedNotationException: Cannot convert the provided notation to an object of type Dependency: build_3gi1eyii8kt0q7ejmxy5fdn8t$_run_closure2@8843b0f.
The following types/formats are supported:
  - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
  - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
  - FileCollections, for example files('some.jar', 'someOther.jar').
  - Projects, for example project(':some:project:path').
  - ClassPathNotation, for example gradleApi().

Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type

Steps to reproduce

plugins {
  id("org.jetbrains.intellij.platform") version "2.0.0-beta1"
}

dependencies {
  intellijPlatform {
    intellijIdeaCommunity(libs.versions.ideaVersion)
    pluginVerifier("latest")
    javaCompiler(libs.versions.ideaVersion)
  }
}

Gradle IntelliJ Plugin version

2.0.0-beta1

Gradle version

8.7

Operating System

macOS

Link to build, i.e. failing GitHub Action job

No response

YannCebron commented 1 month ago

see also #1591

FTR Kotlin is now the preferred language for Gradle build files

hsz commented 4 days ago

This issue was caused by the conflicting IntelliJ Platform configuration and extension names. Fixed by renaming the configuration from intellijPlatform to intellijPlatformDependency with https://github.com/JetBrains/intellij-platform-gradle-plugin/commit/438a71e60a628ad0aa6a373f982d8964b7452b0a

The fix along with initial Groovy support is now available in 2.0.0-SNAPSHOT release. To use the snapshot releases, please follow: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#snapshot-release