Looking for a way to configure the gradle to add bin/my_binary.exe inside the plugin zip file

Answered

Hello,

I am looking for hours a way how to configure that when I start tasks "buildPlugin" or "runIde", it will also inject specific binary file inside the plugin.

 

Currently, it will create only this structure:

lib/plugin.jar

 

But I want that it will create this structure:

lib/plugin.jar
bin/windows/binary.exe

 

I saw that you even did it yourself with the built-in "Kotlin" plugin under

C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.1\plugins\Kotlin

The folder structure there:

 

I want to have it configured like this.
I will specify the binary I need to put and where, exactly as you did with this "Kotlin" plugin.

I don't want to add it manually after I built the zip file.

Please help

 

Thanks!

2 comments
Comment actions Permalink

I found part of the answer myself.
To make that "runIde" task will add these files to the plugin folder, I add

 

task addBinariesToSandbox {
doLast {
println 'Adding binaries'
copy {
from file("$projectDir\\..\\CPP\\x64\\Release")
into file("$buildDir\\idea-sandbox\\plugins\\$rootProject.name\\bin")
include "Binary.exe"
}
}
}prepareSandbox.finalizedBy(addBinariesToSandbox)
0
Comment actions Permalink

Seems that it also works for the build task (it adding it to the zip).
So I figure it out

0

Please sign in to leave a comment.