-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
97 lines (85 loc) · 2.67 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
import org.gradle.api.tasks.bundling.Jar
import org.jetbrains.dokka.gradle.DokkaTask
group = "org.litote"
val kotlinpoet: String by project
plugins {
kotlin("jvm") version "1.4.32"
`maven-publish`
signing
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
compile(kotlin("stdlib"))
compile(kotlin("reflect"))
compile("com.squareup", "kotlinpoet", kotlinpoet)
}
buildscript {
dependencies {
classpath("org.jetbrains.dokka", "dokka-gradle-plugin", "0.10.1")
}
}
apply {
plugin("org.jetbrains.dokka")
}
tasks.withType<DokkaTask> {
outputFormat = "html"
outputDirectory = "$buildDir/docs/kdoc"
}
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
dependsOn(tasks.withType<DokkaTask>() )
classifier = "javadoc"
from("$buildDir/docs/kdoc")
}
publishing {
repositories {
maven {
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = property("sonatypeUsername").toString()
password = property("sonatypePassword").toString()
}
}
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
pom {
name.set("KGenerator")
description.set("Utility library for kapt generation")
url.set("https://github.com/Litote/kgenerator")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("zigzago")
name.set("Julien Buret")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:[email protected]:Litote/kgenerator.git")
developerConnection.set("scm:git:[email protected]:Litote/kgenerator.git")
url.set("[email protected]:Litote/kgenerator.git")
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}