-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
124 lines (110 loc) · 3.61 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.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
group = "com.notkamui.libs"
version = "0.2.2"
val jvmVersion = "1.8"
plugins {
kotlin("jvm") version "1.5.31"
id("org.jlleitschuh.gradle.ktlint") version "10.2.0"
java
`maven-publish`
signing
}
ktlint {
debug.set(true)
outputToConsole.set(true)
disabledRules.add("filename")
reporters {
reporter(ReporterType.CHECKSTYLE)
reporter(ReporterType.PLAIN)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.sun.mail:javax.mail:1.6.2")
testImplementation("org.jetbrains.kotlin:kotlin-test:1.5.21")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.5.21")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks {
jar {
manifest {
attributes["Implementation-Title"] = project.name
attributes["Implementation-Version"] = project.version
}
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = jvmVersion
}
withType<JavaCompile> {
sourceCompatibility = jvmVersion
targetCompatibility = jvmVersion
}
withType<Wrapper> {
distributionType = Wrapper.DistributionType.ALL
}
}
val repositoryUrl = if (version.toString().endsWith("SNAPSHOT"))
"https://oss.sonatype.org/content/repositories/snapshots/"
else
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = project.group.toString()
artifactId = project.name.toLowerCase()
version = project.version.toString()
pom {
name.set(project.name)
description.set("A Kotlin wrapper around the JavaMail API")
url.set("https://github.com/notKamui/${project.name}")
licenses {
license {
name.set("MIT License")
url.set("https://mit-license.org/")
}
}
developers {
developer {
id.set("notKamui")
name.set("Jimmy Teillard")
email.set("jimmy.teillard@notkamui.com")
}
}
scm {
connection.set("scm:git:git://github.com/notKamui/${project.name}.git")
developerConnection.set("scm:git:ssh://github.com/notKamui/${project.name}.git")
url.set("https://github.com/notKamui/${project.name}.git")
}
}
}
}
repositories {
maven {
name = "MavenCentral"
setUrl(repositoryUrl)
credentials {
username = project.properties["ossrhUsername"] as String? ?: "Unknown user"
password = project.properties["ossrhPassword"] as String? ?: "Unknown password"
}
}
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/notKamui/${project.name}")
credentials {
username = project.properties["githubUsername"] as String? ?: "Unknown user"
password = project.properties["githubPassword"] as String? ?: "Unknown password"
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}