-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
82 lines (70 loc) · 2.31 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
plugins {
id("java")
id("com.dorongold.task-tree") version "2.1.1"
}
extra["plugin_version"] = "3.0.2-SNAPSHOT"
extra["processor_version"] = "3.0.2-SNAPSHOT"
subprojects {
apply(plugin = "java")
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
}
tasks.create("printProcessorVersion") {
doLast {
println(rootProject.extra["processor_version"])
}
}
tasks.create("printPluginVersion") {
doLast {
println(rootProject.extra["plugin_version"])
}
}
allprojects {
tasks.create("printTaskInputsAndOutputs") {
doLast {
project.tasks.forEach {
println("--------------------------------------------------------------------------------")
println(" Task '${project.name}:${it.name}'")
println("--------------------------------------------------------------------------------")
println("")
println("File inputs:")
it.inputs.files.forEach {
println(" - ${it}")
}
println("")
println("Property inputs:")
it.inputs.properties.forEach {
println(" - ${it}")
}
println("")
println("File outputs:")
it.outputs.files.forEach {
println(" - ${it}")
}
println("")
println("--------------------------------------------------------------------------------")
println("")
}
}
}
pluginManager.withPlugin("maven-publish") {
extensions.configure<PublishingExtension> {
publications {
all {
// Exclude the examples and its subprojects from being published
if (project.name == "cabe-plugin-test"
|| project.name == "examples"
|| project.parent?.name == "examples") {
tasks.withType<AbstractPublishToMaven>()?.configureEach {
onlyIf { false }
}
}
}
}
}
}
}