codemp-intellij/build.gradle

88 lines
1.8 KiB
Groovy
Raw Normal View History

plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.16.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'com.codemp'
version = '0.1.0'
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
2023-11-16 03:02:19 +01:00
}
dependencies {
implementation 'com.github.adamheinrich:native-utils:master-SNAPSHOT'
2023-11-17 00:03:26 +01:00
implementation 'org.slf4j:slf4j-api:2.0.9'
2024-01-31 22:56:45 +01:00
implementation 'ch.qos.logback:logback-classic:1.4.12'
}
intellij {
2024-01-31 22:56:45 +01:00
version.set('2023.3')
type.set('IC')
}
shadowJar {
archiveClassifier.set('')
dependencies {
include(dependency('com.github.adamheinrich:native-utils:master-SNAPSHOT'))
}
}
def cargoDir = projectDir.toPath().resolve('target').resolve('release').toFile()
2023-11-18 20:21:50 +01:00
processResources {
from(cargoDir) {
include('*.dll')
include('*.so')
into('natives/')
2023-11-18 20:21:50 +01:00
}
}
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 '.'
2023-11-18 20:21:50 +01:00
commandLine 'cargo', 'build', '--release'
}
//must act before all other tasks who mess with resources to reliably get the binary in
patchPluginXml.dependsOn cargoBuild
//delete old jni generated files
tasks.register('deleteGeneratedNativeInterface', Delete) {
delete 'src/main/java/com/codemp/intellij/jni'
2023-08-28 12:22:37 +02:00
}
//delete cargo build files
tasks.register('cargoClean', Exec) {
workingDir '.'
commandLine 'cargo', 'clean'
dependsOn deleteGeneratedNativeInterface
}
2023-11-17 00:03:26 +01:00
clean.dependsOn cargoClean
instrumentedJar.dependsOn shadowJar //TODO: instrumentedJar should use fatjar as input