import proguard.gradle.ProGuardTask buildscript { dependencies { classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:$gradle_intellij_plugin_version" classpath "net.sf.proguard:proguard-gradle:5.3.3" } } apply plugin: 'org.jetbrains.intellij' { -> intellij { version = ideaVersion instrumentCode = false configureDefaultDependencies = false } ["patchPluginXml", "prepareSandbox", "prepareTestingSandbox", "verifyPlugin", "runIde", "buildPlugin", "publishPlugin"].each { tasks.remove(tasks.findByName(it)) } }() configurations { proguardInput proguardOut } afterEvaluate { dependencies { proguardInput intellij { include("idea.jar") } } } task strip(type: ProGuardTask) { configuration file('ideaJar.pro') afterEvaluate { injars configurations.proguardInput.files, filter: "**.class" outjars file("$buildDir/idea-stripped.jar") } } afterEvaluate { artifacts { proguardOut(strip.outputs.files.singleFile) { builtBy strip } } }