-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
66 lines (54 loc) · 2.06 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
66 lines (54 loc) · 2.06 KB
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
60
61
62
63
64
65
66
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("com.gradleup.shadow") version "9.4.1" apply false
}
// 统一项目配置
allprojects {
// 应用插件到子项目
apply(plugin = "java")
apply(plugin = "com.gradleup.shadow")
group = "com.coloryr"
version = "4.0.3"
// 设置项目JDK版本
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
val shadowImplementation = configurations.maybeCreate("shadowImplementation")
configurations.named("shadow").get().extendsFrom(shadowImplementation)
configurations.named("implementation").get().extendsFrom(shadowImplementation)
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.codemc.io/repository/maven-releases/")
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://jitpack.io/")
maven("https://maven.izzel.io/releases/")
maven("https://maven.maxhenkel.de/repository/public")
}
dependencies {
compileOnly("io.netty:netty-all:4.1.109.Final")
}
tasks.withType<ShadowJar> {
mutableListOf(
"org.apache.hc.core5",
"org.apache.hc.client5",
"org.slf4j",
).forEach { relocate(it, "com.coloryr.allmusic.libs.$it") }
}
tasks.named("jar") {
dependsOn("shadowJar")
}
afterEvaluate {
if (plugins.hasPlugin("com.gtnewhorizons.retrofuturagradle")) return@afterEvaluate
val rfgObfAttr = Attribute.of("com.gtnewhorizons.retrofuturagradle.obfuscation", String::class.java)
val rfgDeobfAttr = Attribute.of("rfgDeobfuscatorTransformed", Boolean::class.javaObjectType)
configurations.all {
if (!isCanBeConsumed) return@all
attributes {
attribute(rfgObfAttr, "mcp")
attribute(rfgDeobfAttr, true)
}
}
}
}