forked from SpongePowered/Configurate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
88 lines (76 loc) · 2.3 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
import org.spongepowered.configurate.build.applyCommonAttributes
plugins {
kotlin("jvm") version "1.4.20" apply false
id("org.jetbrains.dokka") version "1.4.20" apply false
id("io.gitlab.arturbosch.detekt") version "1.15.0" apply false
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
id("io.freefair.aggregate-javadoc-jar") version "5.3.0"
id("org.ajoberstar.grgit")
id("org.ajoberstar.git-publish") version "3.0.0"
id("com.github.ben-manes.versions") version "0.36.0"
id("io.codearte.nexus-staging")
`java-base`
}
buildscript {
configurations.classpath {
resolutionStrategy {
activateDependencyLocking()
}
}
}
group = "org.spongepowered"
version = "4.1.0-SNAPSHOT"
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
}
allprojects {
repositories {
jcenter()
}
ktlint {
version.set("0.40.0")
}
}
nexusStaging {
val sonatypeUsername: String? by project
val sonatypePassword: String? by project
username = sonatypeUsername
password = sonatypePassword
}
tasks.aggregateJavadoc.configure {
applyCommonAttributes()
title = "Configurate $version (all modules)"
val excludedProjects = listOf("examples").map {
project(":configurate-$it").tasks.named("javadoc", Javadoc::class).get().classpath
}
classpath = classpath.minus(files(excludedProjects))
(options as? StandardJavadocDocletOptions)?.apply {
addBooleanOption("Xdoclint:-missing", true)
links("https://docs.oracle.com/javase/8/docs/api/")
}
}
gitPublish {
branch.set("gh-pages")
contents {
from("src/site") {
val versions = {
(listOf(project.version as String) + grgit.tag.list().map { it.name }.reversed())
.distinct()
.filter { repoDir.get().dir(it).getAsFile().exists() || it == project.version }
}
expand("project" to project, "versions" to versions)
}
from(tasks.aggregateJavadoc) {
into("$version/apidocs")
}
}
preserve {
include(".gitattributes")
include("**/") // include everything in directories
exclude("/*.html")
}
}
tasks.dependencyUpdates {
gradleReleaseChannel = "current"
revision = "release"
}