1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60plugins {
id("org.jetbrains.kotlin.jvm")
id("com.gradle.plugin-publish")
`maven-publish`
signing
`java-gradle-plugin`
}
group = project(":").group
version = project(":").version
repositories {
mavenCentral()
}
dependencies {
implementation(gradleApi())
implementation(localGroovy())
implementation(project(":"))
}
gradlePlugin {
plugins {
create("decompileCrasher") {
id = "com.anatawa12.tools.decompileCrasher"
implementationClass = "com.anatawa12.tools.decompileCrasher.gradle.PluginMain"
}
}
}
pluginBundle {
website = "https://github.com/anatawa12/DecompileCrasher"
vcsUrl = "https://github.com/anatawa12/DecompileCrasher"
description = ("A tool to make a Jar Hard to decompile. " +
"Decompiler will make invalid source code or " +
"internal error will be thrown")
tags = mutableListOf("obfuscation", "obfuscator")
plugins {
get("decompileCrasher").apply {
displayName = "DecompileCrasher"
}
}
}
val maven by publishing.publications.creatingDecompileCrasher(project)
publishing.repositories.addOSSRH(project)
signing.sign(maven)
tasks.withType<PublishToMavenRepository>().configureEach {
onlyIf {
if (repository.name == "mavenCentral") {
publication.name != "decompileCrasherPluginMarker"
&& publication.name != "pluginMaven"
} else {
true
}
}
}