intellij-platform-gradle-plugin icon indicating copy to clipboard operation
intellij-platform-gradle-plugin copied to clipboard

`InstrumentCode` always resolves java-compiler-ant-tasks

Open pbreault opened this issue 2 years ago • 0 comments

What happened?

If the compiler version is not specified, the plugin tries to resolve it every time we run ./gradlew instrumentCode.

Resolving the ant task version forces a few network calls even if the task is up-to-date:

> Task :instrumentCode UP-TO-DATE
[gradle-intellij-plugin :instrumentCode] Resolved non-EAP java-compiler-ant-tasks version: 231.9225.16

Relevant log output or stack trace

No response

Steps to reproduce

Using the build.gradle.kts below:

import org.jetbrains.intellij.tasks.InstrumentCodeTask

plugins {
    id("org.jetbrains.intellij") version "1.15.0"
}

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

repositories {
    mavenCentral()
}

intellij {
    type.set("AI")
    version.set("2023.1.1.16")
}

tasks.withType<InstrumentCodeTask> {
    // Uncomment this to enable caching
    // compilerVersion.set("231.9225.16")
}
  1. Run ./gradlew buildPlugin
  2. Run ./gradlew buildPlugin a second time. You should see that instrumentCode doesn't return instantly even though it's up to date.
  3. Uncomment this line: // compilerVersion.set("231.9225.16")
  4. Run ./gradlew buildPlugin
  5. Run ./gradlew buildPlugin again. Should return almost instantly ( no network call )

Gradle IntelliJ Plugin version

1.15

Gradle version

8.1.1

Operating System

macOS

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

No response

pbreault avatar Aug 21 '23 19:08 pbreault