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.42k stars 271 forks source link

2.0 - verifyPlugin fails after deleting downloaded IDEs #1594

Closed jhonnen closed 2 months ago

jhonnen commented 5 months ago

What happened?

Given the repo project attached below, the verifyPlugin task is broken after manually deleting the downloaded IDEs:

> Task :verifyPlugin FAILED
Starting the IntelliJ Plugin Verifier 1.365
Verification reports directory: <projectdir>\build\reports\pluginVerifier
2024-04-15T09:45:54 [main] INFO  verification - Reading IDE <projectdir>\build\ides\IC-2024.1
Exception in thread "main" java.lang.IllegalArgumentException: IDE must reside in a directory: <projectdir>\build\ides\IC-2024.1

I think the issue is that PluginVerifierIdeExtractorTransformer only writes a text file containing the extracted path to the TransformOutputs and not the IDE itself like in the Gradle Example.

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

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    intellijPlatform {
        defaultRepositories()
    }
}

dependencies {
    intellijPlatform {
        intellijIdeaCommunity("2024.1")
        pluginVerifier()
        instrumentationTools()
    }
}

intellijPlatform {
    verifyPlugin {
        ides {
            ide("2024.1")
        }
        downloadDirectory = layout.buildDirectory.dir("ides")
    }
    buildSearchableOptions = false
}

Relevant log output or stack trace

> Task :verifyPlugin FAILED
Starting the IntelliJ Plugin Verifier 1.365
Verification reports directory: <projectdir>\build\reports\pluginVerifier
2024-04-15T09:46:59 [main] INFO  verification - Reading IDE <projectdir>\build\ides\IC-2024.1
8 actionable tasks: 1 executed, 7 up-to-date
Exception in thread "main" java.lang.IllegalArgumentException: IDE must reside in a directory: <projectdir>\build\ides\IC-2024.1
    at com.jetbrains.pluginverifier.options.OptionsParser.createIdeDescriptor(OptionsParser.kt:103)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.DefaultIdeDescriptorParser.parseIdeDescriptors(CheckPluginParamsBuilder.kt:126)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.CheckPluginParamsBuilder.build(CheckPluginParamsBuilder.kt:41)
    at com.jetbrains.pluginverifier.tasks.checkPlugin.CheckPluginParamsBuilder.build(CheckPluginParamsBuilder.kt:27)
    at com.jetbrains.pluginverifier.PluginVerifierMain$main$3$1.invoke(PluginVerifierMain.kt:130)
    at com.jetbrains.pluginverifier.PluginVerifierMain$main$3$1.invoke(PluginVerifierMain.kt:123)
    at com.jetbrains.pluginverifier.tasks.profiling.PluginVerificationProfilingsKt.measurePluginVerification(PluginVerificationProfilings.kt:11)
    at com.jetbrains.pluginverifier.PluginVerifierMain.main(PluginVerifierMain.kt:123)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':verifyPlugin'.
> Process 'command 'C:\Uti\PesJdk\jdk21\jdk\bin\java.exe'' finished with non-zero exit value 1

Steps to reproduce

  1. execute verifyPlugin
  2. delete build/ides/IC-2024.1 directory
  3. execute verifyPlugin again

Gradle IntelliJ Plugin version

2.0.0-beta-1

Gradle version

8.7

Operating System

Windows

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

No response

nickfromXXII commented 5 months ago

I have a similar issue with GitHub Actions: https://github.com/JetBrains/tinygo-plugin/actions/runs/8707621157/job/23883341240. It started occurring after one successful run using the 2.0.0-beta1 plugin version.

hsz commented 2 months ago

This was redesigned a bit since 2.0.0-beta1. Could you please verify if this is still the issue in 2.0.0-beta9?

hsz commented 2 months ago

The issue is obsolete now as we started relaying on Gradle cache for storing IDEs resolved from JetBrains CDN for plugin verification.

If you expect to have a fixed list of IDEs stored in another place, you can point to them with:

intellijPlatform {
    verifyPlugin {
        ides {
            local(path)
        }
    }
}