-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
136 lines (120 loc) · 4.49 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
import org.gradle.jvm.tasks.Jar
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URI
import java.net.URL
plugins {
kotlin("jvm") version "1.9.0"
id("java-library")
id("maven-publish")
id("signing")
id("org.jetbrains.dokka") version "1.8.20"
}
val versionProject = "1.2"
val group = "dev.kaytea"
val jvmTargetCompatibility = 11
repositories {
mavenCentral()
maven { url = URI("https://oss.sonatype.org/content/repositories/snapshots/") }
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.31")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
platform("org.jetbrains.kotlin:kotlin-bom")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(jvmTargetCompatibility))
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = group
artifactId = project.name
version = versionProject
from(components.findByName("java"))
pom {
name .set("CompxCLib")
description .set("Complex Complete Library is a feature rich complex numbers library for Kotlin and Java")
url .set("https://github.com/KatieUmbra/compxclib")
inceptionYear .set("2023")
licenses {
license {
name .set("MIT License")
url .set("https://github.com/KatieUmbra/compxclib/blob/main/LICENSE")
}
}
developers {
developer {
id .set("Kanwi")
name .set("Katherine Chesterfield")
email .set("katherine@kaytea.dev")
}
}
scm {
connection .set("scm:git:git:github.com/KatieUmbra/compxclib.git")
developerConnection .set("scm:git:ssh://github.com/KatieUmbra/compxclib.git")
url .set("https://github.com/KatieUmbra/compxclib")
}
}
repositories {
maven {
name = "OSSRH"
url = URI("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["ossrhUsername"].toString()
password = project.properties["ossrhPassword"].toString()
}
}
}
}
}
}
signing {
sign(publishing.publications.findByName("mavenJava"))
}
tasks.named<Jar>("javadocJar") {
from(tasks.named("dokkaJavadoc"))
}
kotlin {
jvmToolchain(jvmTargetCompatibility)
}
tasks.withType<DokkaTask>().configureEach {
moduleName .set(project.name)
moduleVersion .set(project.version.toString())
outputDirectory .set(file("build/dokka/$name"))
failOnWarning .set(false)
suppressObviousFunctions .set(false)
suppressInheritedMembers .set(false)
offlineMode .set(false)
dokkaSourceSets.configureEach {
displayName .set(name)
suppress .set(displayName.get() != "main")
reportUndocumented .set(true)
skipEmptyPackages .set(true)
skipDeprecated .set(true)
suppressGeneratedFiles .set(true)
jdkVersion .set(8)
languageVersion .set("11")
apiVersion .set("11")
noStdlibLink. set(false)
noJdkLink .set(false)
noAndroidSdkLink .set(false)
includes .from(project.files(), "Module.md")
sourceRoots .from(file("src/main/kotlin"))
samples .from(project.files(), "src/samples/kotlin/Basic.kt")
sourceLink {
localDirectory .set(file("src/main/kotlin"))
remoteUrl .set(URL("https://github.com/KatieUmbra/compxclib/tree/main/src/main/kotlin"))
remoteLineSuffix .set("#L")
}
}
}
tasks.register<Copy>("Documentation") {
from(tasks.dokkaHtml)
from(layout.buildDirectory.dir("build/dokka/dokkaHtml"))
include("**/**")
into(layout.buildDirectory.dir("../docs"))
}