-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
45 lines (38 loc) 路 1.4 KB
/
build.gradle.kts
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
/*
* Developed by Ji Sungbin 2024.
*
* Licensed under the MIT.
* Please see full license: https://github.com/jisungbin/ComposeInvestigator/blob/main/LICENSE
*/
@file:Suppress("UnstableApiUsage")
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
java
id(libs.plugins.gradle.publish.maven.get().pluginId)
alias(libs.plugins.gradle.shadow)
}
dependencies {
compileOnly(projects.compilerHosted)
}
// https://github.com/johnrengelman/shadow/issues/448#issuecomment-562939439
project.configurations.implementation.get().isCanBeResolved = true
val shadowJar = tasks.register<ShadowJar>("embeddedPlugin") {
configurations = listOf(
project.configurations.implementation.get(),
project.configurations.compileClasspath.get(),
)
relocate(
/* pattern = */ "com.intellij",
/* destination = */ "org.jetbrains.kotlin.com.intellij",
)
archiveBaseName.set("embedded")
archiveVersion.set("")
destinationDirectory.set(File(layout.buildDirectory.asFile.get(), "repackaged"))
}
// replace the standard jar with the one built by 'shadowJar' in both api and runtime variants
configurations {
apiElements.get().outgoing.artifacts.clear()
apiElements.get().outgoing.artifact(shadowJar.flatMap(AbstractArchiveTask::getArchiveFile))
runtimeElements.get().outgoing.artifacts.clear()
runtimeElements.get().outgoing.artifact(shadowJar.flatMap(AbstractArchiveTask::getArchiveFile))
}