-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
148 lines (138 loc) · 3.97 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jreleaser.model.Active
import org.jreleaser.model.api.deploy.maven.MavenCentralMavenDeployer.Stage
plugins {
kotlin("jvm") version "2.0.0"
id("maven-publish")
id("com.ncorti.ktfmt.gradle") version "0.17.0"
id("org.jreleaser") version "1.16.0"
id("com.gradleup.shadow") version "9.0.0-beta7"
id("org.jetbrains.dokka") version "2.0.0"
id("org.jetbrains.dokka-javadoc") version "2.0.0"
}
dokka {
moduleName.set("Fray")
dokkaSourceSets.main {
includes.from("README.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://github.com/cmu-pasta/fray")
remoteLineSuffix.set("#L")
}
}
pluginsConfiguration.html {
footerMessage.set("(c) PASTA Lab, Carnegie Mellon University")
}
}
repositories {
mavenCentral()
}
tasks {
wrapper {
gradleVersion = "8.10.2"
}
}
allprojects {
plugins.apply("com.ncorti.ktfmt.gradle")
plugins.apply("base")
base.archivesName = "${rootProject.name}-" + project.path.replaceFirst("^:".toRegex(), "").replace(':', '-')
plugins.withId("org.jetbrains.kotlin.jvm") {
kotlin {
jvmToolchain(11)
}
}
plugins.withType<JavaPlugin> {
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}
}
jreleaser {
signing {
active.set(Active.ALWAYS)
armored.set(true)
}
deploy {
maven {
mavenCentral {
active.set(Active.ALWAYS)
create("sonatype") {
snapshotSupported = true
stage = Stage.FULL
active = Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
}
}
}
}
}
configure(allprojects - rootProject -
project(":instrumentation") -
project(":plugins") -
project(":plugins:gradle") -
project(":plugins:idea") -
project(":integration-test")) {
plugins.apply("maven-publish")
plugins.apply("org.jetbrains.dokka")
plugins.apply("org.jetbrains.dokka-javadoc")
afterEvaluate {
val dokkaJavadocJar by tasks.registering(Jar::class) {
description = "A Javadoc JAR containing Dokka Javadoc"
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}
java {
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
val os = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName()
val arch = DefaultNativePlatform.getCurrentArchitecture().name
pom {
name = "Fray Testing Framework"
description = "Fray testing framework for concurrency programs."
url = "github.com/cmu-pasta/fray"
licenses {
license {
name = "Apache-2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "aoli-al"
name = "Ao Li"
email = "aoli.al@hotmail.com"
}
}
scm {
connection = "scm:git:https://github.com/cmu-pasta/fray.git"
developerConnection = "scm:git:ssh://github.com/cmu-pasta/fray.git"
url = "https://github.com/cmu-pasta/fray"
}
}
if (components.findByName("shadow") == null) from(components["java"])
else {
from(components["shadow"])
artifact(tasks["sourceJar"])
}
if (project.name != "jvmti") {
artifact(dokkaJavadocJar)
artifactId = project.base.archivesName.get()
} else {
artifactId = project.base.archivesName.get() + "-$os-$arch"
}
}
}
repositories {
maven {
url = rootProject.layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
}
}
}