Plugin auto reload failing

Answered

OS: Windows 11

IntelliJ version: 2022.3 Ultimate

IntelliJ gradle plugin version: 1.12

Targeting: PyCharm 2022.3.2

Running buildPlugin after modifying a file causes execution to fail  during :prepareSandobox

Execution failed for task ':prepareSandbox'.
> Could not copy file 'D:\IdeaProjects\PapyrusIDE\build\libs\PapyrusIDE-1.0-SNAPSHOT.jar' to 'D:\IdeaProjects\PapyrusIDE\build\idea-sandbox\plugins\PapyrusIDE\lib\PapyrusIDE-1.0-SNAPSHOT.jar'.
 > D:\IdeaProjects\PapyrusIDE\build\idea-sandbox\plugins\PapyrusIDE\lib\PapyrusIDE-1.0-SNAPSHOT.jar (The requested operation cannot be performed on a file with a user-mapped section open)

Here's my gradle build file:

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

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

repositories {
mavenCentral()
}

// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2022.3.2")
type.set("PC") // Target IDE Platform
plugins.set(listOf("PythonCore"))
}

tasks {
// Set the JVM compatibility versions
withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}

runIde {
autoReloadPlugins.set(true)
}

patchPluginXml {
sinceBuild.set("221")
untilBuild.set("231.*")
}

signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}

publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}

Running buildPlugin works fine without any modifications to the plugin files. As soon as I change something and run it again, I get the error.

I've tried manually setting autoReload to true and disabling buildSearchableOptions, neither worked.

Full steps are:

1: Start the run using the default "Run Plugin" configuration.

2: Edit the plugin.

3: run buildPlugin.

4: Get the failed execution error.

 

I haven't changed any directories or configuration besides the gradle build file

0
3 comments

Yesterday, the Gradle IntelliJ Plugin 1.13.0 was released — could you please try it out?

0

Tried it again today (2/13/2023), and it works. Granted, a lot of variables have changed, i.e. I'm using a different target version of PyCharm. Regardless, the issue seems to be fixed

0

plugins {
    id("java")
    id("org.jetbrains.kotlin.jvm") version "1.9.21"
    id("org.jetbrains.intellij") version "1.16.1"
}

 

The problem seems to have arisen again.

 

0

Please sign in to leave a comment.