-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
124 lines (105 loc) · 3.17 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
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
plugins {
kotlin("jvm") version "2.0.10"
id("org.jetbrains.dokka") version "1.9.20"
java
`maven-publish`
}
group = "org.veupathdb.lib.s3"
version = "5.1.0"
allprojects {
repositories {
mavenLocal()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/veupathdb/packages")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
}
configure(listOf(project(":lib:workspaces-kt"), project(":lib:workspaces-java"))) {
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.dokka")
java {
withJavadocJar()
withSourcesJar()
}
tasks.dokkaHtml {
outputDirectory.set(file("docs/dokka"))
}
tasks.dokkaJavadoc {
outputDirectory.set(file("docs/javadoc"))
}
tasks.test {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "GitHub"
url = uri("https://maven.pkg.github.com/VEuPathDB/lib-s3-workspace")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("gpr") {
artifactId = project.name
groupId = rootProject.group.toString()
version = rootProject.version.toString()
from(components["java"])
pom {
name.set("S3 Workspaces")
description.set("Workspaces backed by an S3 object store.")
url.set("https://github.com/VEuPathDB/lib-s3-workspace")
developers {
developer {
id.set("epharper")
name.set("Elizabeth Paige Harper")
email.set("[email protected]")
url.set("https://github.com/foxcapades")
organization.set("VEuPathDB")
}
}
scm {
connection.set("scm:git:git://github.com/VEuPathDB/lib-s3-workspace.git")
developerConnection.set("scm:git:ssh://github.com/VEuPathDB/lib-s3-workspace.git")
url.set("https://github.com/VEuPathDB/lib-s3-workspace")
}
}
}
}
}
}
task("docs") {
dependsOn(
":lib:workspaces-java:dokkaHtml",
":lib:workspaces-java:dokkaJavadoc",
":lib:workspaces-kt:dokkaHtml",
":lib:workspaces-kt:dokkaJavadoc",
)
doLast {
val docDirs = mapOf(
file("lib/java/docs/dokka") to file("docs/java/dokka"),
file("lib/java/docs/javadoc") to file("docs/java/javadoc"),
file("lib/kotlin/docs/dokka") to file("docs/kotlin/dokka"),
file("lib/kotlin/docs/javadoc") to file("docs/kotlin/javadoc"),
)
for ((from, to) in docDirs) {
if (!from.exists())
throw Exception("expected path $from to exist but it didn't")
if (to.exists())
to.deleteRecursively()
else
to.ensureParentDirsCreated()
from.copyRecursively(to)
}
}
}