Skip to content

Commit 27ad1bf

Browse files
committed
fix: remove proguard
1 parent 93320d4 commit 27ad1bf

1 file changed

Lines changed: 1 addition & 96 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
1-
import org.jetbrains.changelog.Changelog
21
import org.jetbrains.changelog.markdownToHTML
32
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
4-
import org.jetbrains.intellij.platform.gradle.utils.asPath
5-
import java.nio.charset.Charset
6-
import java.util.Properties
7-
import kotlin.io.path.absolutePathString
83

94
fun prop(name: String) = providers.gradleProperty(name).get()
105

11-
buildscript {
12-
repositories {
13-
mavenLocal()
14-
mavenCentral()
15-
google()
16-
}
17-
dependencies {
18-
classpath("com.guardsquare:proguard-gradle:7.8.1")
19-
}
20-
}
21-
val envProperties = Properties()
22-
envProperties.load(file(".env").reader(Charset.forName("UTF-8")))
23-
246
plugins {
257
id("java") // Java support
268
alias(libs.plugins.kotlin) // Kotlin support
@@ -104,7 +86,7 @@ intellijPlatform {
10486
}
10587

10688
publishing {
107-
token = provider { envProperties["PUBLISH_TOKEN"] as String }
89+
token = providers.environmentVariable("PUBLISH_TOKEN")
10890
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
10991
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
11092
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
@@ -136,83 +118,6 @@ tasks {
136118

137119
publishPlugin {
138120
}
139-
140-
// https://plugins.jetbrains.com/docs/marketplace/obfuscate-the-plugin.html#proguard
141-
// see https://www.guardsquare.com/manual/setup/gradle
142-
register<proguard.gradle.ProGuardTask>("proguard") {
143-
dependsOn(buildPlugin)
144-
dependsOn(instrumentedJar)
145-
verbose()
146-
147-
val javaHome = System.getProperty("java.home")
148-
File("$javaHome/jmods/").listFiles().forEach { libraryjars(it.absolutePath) }
149-
150-
// Use the jar task output as a input jar. This will automatically add the necessary task dependency.
151-
val pluginName = rootProject.name + "-" + prop("pluginVersion")
152-
val inputDir = "build/libs/"
153-
val outputDir = "build/distributions/"
154-
155-
injars("$inputDir$pluginName-instrumented.jar")
156-
outjars("$outputDir$pluginName-obfuscated.jar")
157-
158-
libraryjars(configurations.compileClasspath.get())
159-
160-
dontshrink()
161-
dontoptimize()
162-
// dontpreverify()
163-
// dontskipnonpubliclibraryclassmembers()
164-
165-
adaptclassstrings("**.xml")
166-
adaptresourcefilecontents("**.xml")
167-
168-
// Allow methods with the same signature, except for the return type,
169-
// to get the same obfuscation name.
170-
overloadaggressively()
171-
172-
// Put all obfuscated classes into the nameless root package.
173-
repackageclasses("")
174-
dontwarn()
175-
176-
printmapping("$outputDir$pluginName-ProGuard-ChangeLog.txt")
177-
target(prop("pluginVersion"))
178-
179-
adaptresourcefilenames()
180-
optimizationpasses(9)
181-
allowaccessmodification()
182-
// mergeinterfacesaggressively()
183-
184-
keepattributes("Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod")
185-
186-
keep(
187-
"""
188-
class * implements com.intellij.openapi.components.PersistentStateComponent {*;}
189-
""".trimIndent()
190-
)
191-
192-
keepclassmembers(
193-
"""
194-
class * {public static ** INSTANCE;}
195-
""".trimIndent()
196-
)
197-
keepclassmembers(
198-
"""
199-
enum * {
200-
<fields>;
201-
}
202-
""".trimIndent()
203-
)
204-
keepclassmembers(
205-
"""
206-
enum * {
207-
public static **[] values();
208-
public static ** valueOf(java.lang.String);
209-
}
210-
""".trimIndent()
211-
)
212-
keep("class com.intellij.util.* {*;}")
213-
214-
println("Output directory: ${layout.projectDirectory.dir(outputDir).asPath.absolutePathString()}:1")
215-
}
216121
}
217122

218123
intellijPlatformTesting {

0 commit comments

Comments
 (0)