Lacking "com.intellij.testFramework" package after migrating to IntelliJ Gradle Plugin 2.x

已回答

Description: After upgrading our IntelliJ plugin from Gradle IntellIj Plugin 1.x to IntelliJ Platform Gradle Plugin version 2.0.1, we have noticed that the classes that are relevant for us (e.g. IdeaProjectTestFixture, LightProjectDescriptor) that were coming from com.intellij.testFramework package are missing. For the context, I've noticed that the library com.jetbrains.ideaIC:2024.2 was replaced in favor of idea:ideaIC:aarch64:2024.2 after platform migration and in there, the com.intellij.testFramework package contains less classes. I would like to ask if that's expected change and if so, is there any recommended approach?

0

Hi,

Please share you Gradle build script configuration.

0

Hi,

This set up successfully resolves the com.jetbrains.ideaIC and the testFramework that we need:

plugins {
   id("java")
   id("org.jetbrains.kotlin.jvm") version "2.0.20"
   id("org.jetbrains.intellij") version "1.17.3"
}
repositories {
   mavenCentral()
   maven {
       url = uri("https://packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier")
   }
}
dependencies {
   // external dependencies, not related to JetBrains libraries
}
intellij {
   pluginName.set("example-plugin")
   version.set("2024.2")
   type.set("IC")
   downloadSources.set(false)
   updateSinceUntilBuild.set(false)
   plugins.set("org.jetbrains.plugins.yaml".split(',').map(String::trim).filter(String::isNotEmpty))
}
tasks {
   withType<JavaCompile> {
       sourceCompatibility = "21"
       targetCompatibility = "21"
   }
   patchPluginXml {
       version.set("1.1.1")
       sinceBuild.set("242.*")
       untilBuild.set("242.*")
   }
}

while this one ends up resolving idea:ideaIC which lacks a lot of useful classes

import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease

plugins {
    id("java")
    id("org.jetbrains.kotlin.jvm") version "2.0.20"
    id("org.jetbrains.intellij.platform") version "2.0.1"
    id("org.jetbrains.intellij.platform.migration") version "2.0.1"
}
repositories {
    intellijPlatform {
        defaultRepositories()
    }

    mavenCentral()
    maven {
        url = uri("https://packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier")
    }
}
dependencies {
    // external dependencies, not related to JetBrains libraries

    intellijPlatform {
        instrumentationTools()
        plugins("".split(',').map(String::trim).filter(String::isNotEmpty))
        bundledPlugins("org.jetbrains.plugins.yaml".split(',').map(String::trim).filter(String::isNotEmpty))
        create("IC", "2024.2")
    }
}
intellijPlatform {
    pluginConfiguration {
        name = "example-plugin"
        ideaVersion {
            sinceBuild = "242.*"
            untilBuild = "242.*"
        }
    }

    pluginVerification {
        ides {
            ide(IntelliJPlatformType.IntellijIdeaCommunity, "2024.2")
            recommended()
            select {
                types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
                channels = listOf(ProductRelease.Channel.RELEASE)
                sinceBuild = "242.*"
                untilBuild = "242.*"
            }
        }
    }
}
tasks {
    withType<JavaCompile> {
        sourceCompatibility = "21"
        targetCompatibility = "21"
    }

    patchPluginXml {
        pluginVersion.set(version.toString())
        pluginName.set("example-plugin")
        sinceBuild.set("242.*")
        untilBuild.set("242.*")
    }
}
0

It works! Thank you very much for your support.

0

请先登录再写评论。