codemp-intellij/build.gradle

74 lines
1.4 KiB
Groovy

plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.16.0'
}
group = "com.codemp"
version = "0.1.0"
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.slf4j:slf4j-api:2.0.9'
implementation 'ch.qos.logback:logback-classic:1.4.6'
}
intellij {
version.set("2022.2.5")
type.set("IC")
}
tasks {
patchPluginXml {
sinceBuild.set("222")
untilBuild.set("232.*")
}
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"))
}
}
//run cargo build
tasks.register('cargoBuild', Exec) {
workingDir '.'
commandLine 'cargo', 'build'
}
compileJava.dependsOn cargoBuild
//copy the generated binary into the resources folder
tasks.register('copyBinary', Copy) {
from "target/debug"
into "src/main/resources"
include "*.so", "*.dll"
dependsOn cargoBuild
}
patchPluginXml.dependsOn copyBinary
//delete old jni generated files
tasks.register('deleteGeneratedNativeInterface', Delete) {
delete 'src/main/java/com/codemp/intellij/jni'
}
//delete cargo build files
tasks.register('cargoClean', Exec) {
workingDir '.'
commandLine 'cargo', 'clean'
dependsOn deleteGeneratedNativeInterface
}
clean.dependsOn cargoClean