-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
111 lines (99 loc) · 3.26 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
import extensions.implementation
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = ApplicationConfiguration.groupId
version = ApplicationConfiguration.version
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(ApplicationDependencies.GradlePlugins.kotlinGradlePlugin)
}
}
plugins {
id("java-library")
id("maven-publish")
id("signing")
kotlin("jvm") version ApplicationDependencyVersions.kotlin
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
implementation(ApplicationDependencies.dependencies)
// testing
testImplementation(ApplicationDependencies.junit)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
from(sourceSets.main.get().allSource)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = ApplicationConfiguration.artifactId
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set(ApplicationConfiguration.name)
description.set(ApplicationConfiguration.description)
url.set(ApplicationConfiguration.url)
licenses {
license {
name.set("MIT License")
url.set("http://www.opensource.org/licenses/mit-license.php")
}
}
scm {
connection.set("scm:git:https://github.com/paysera/${ApplicationConfiguration.artifactId}.git")
developerConnection.set("scm:git:[email protected]:paysera/${ApplicationConfiguration.artifactId}.git")
url.set("https://github.com/paysera/${ApplicationConfiguration.artifactId}")
}
developers {
developer {
id.set("payseradev")
name.set("Paysera App Developers")
email.set("[email protected]")
}
}
}
}
}
repositories {
maven {
val repositoryUrl = if (version.toString().endsWith("SNAPSHOT")) {
ApplicationConfiguration.snapshotRepositoryUrl
} else {
ApplicationConfiguration.releaseRepositoryUrl
}
url = uri(repositoryUrl)
credentials {
username = rootProject.findProperty("ossrhUsername") as? String
password = rootProject.findProperty("ossrhPassword") as? String
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}