-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
121 lines (101 loc) · 3.18 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@file:Suppress("VulnerableLibrariesLocal")
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
alias(libs.plugins.shadow) apply(false)
alias(libs.plugins.lombok) apply(false)
alias(libs.plugins.reproducible.builds) apply(false)
}
group = "org.polyfrost.oneconfig"
version = "1.1.0-alpha.38"
allprojects {
apply(plugin = "maven-publish")
apply(plugin = "org.gradlex.reproducible-builds")
group = rootProject.group
version = rootProject.version
configure<PublishingExtension> {
repositories {
mavenLocal()
mapOf(
"releases" to "basic",
"snapshots" to "basic",
"private" to "private"
).forEach { (channel, authMethod) ->
maven {
name = channel
setUrl("https://repo.polyfrost.org/$channel")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>(authMethod)
}
}
}
}
}
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "idea")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "io.freefair.lombok")
val compileOnly by configurations
val include by configurations.registering {
compileOnly.extendsFrom(this)
}
val sourceSets = extensions.getByName<SourceSetContainer>("sourceSets")
configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
dependencies {
compileOnly(rootProject.libs.bundles.subproject)
}
if (project.name !== "common") {
val main by sourceSets
val mock by sourceSets.creating {
compileClasspath += main.compileClasspath
}
main.compileClasspath += mock.output
}
configure<PublishingExtension> {
publications {
register<MavenPublication>("mavenJava") {
artifactId = project.name
group = project.group
version = project.version.toString()
artifact(tasks.named("shadowJar"))
artifact(tasks.named("sourcesJar"))
}
}
}
tasks {
withType<Javadoc> {
options {
this as StandardJavadocDocletOptions
addStringOption("Xdoclint:none", "-quiet")
}
}
named<Jar>("jar") {
manifest.attributes += mapOf(
"Specification-Title" to "OneConfig Loader",
"Specification-Vendor" to "Polyfrost",
"Specification-Version" to "2.0.0",
"Implementation-Title" to "loader-${project.name}",
"Implementation-Vendor" to project.group,
"Implementation-Version" to project.version,
"Implementation-License" to "GPL-3.0",
"Implementation-Source" to "https://github.com/Polyfrost/OneConfigLoader",
"Implementation-Website" to "https://polyfrost.org",
)
}
named<ShadowJar>("shadowJar") {
configurations = listOf(include.get())
}
val assemble by this
withType(ShadowJar::class) {
assemble.dependsOn(this)
}
}
}