-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
132 lines (108 loc) · 3.41 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
extra.apply {
set("aws-version", "1.12.54")
}
}
plugins {
kotlin("jvm") version "1.5.30"
`maven-publish`
signing
id("io.gitlab.arturbosch.detekt") version "1.18.0"
}
allprojects {
apply(plugin = "kotlin")
apply(plugin = "maven-publish")
apply(plugin = "signing")
version = System.getenv("RELEASE_VERSION") ?: "local"
group = "br.com.guiabolso"
dependencies {
// Kotlin
implementation(kotlin("reflect"))
// Events Protocol
implementation("br.com.guiabolso:events-core:6.0.0")
// SLF4J
implementation("org.slf4j:slf4j-api:1.7.32")
// JUnit
testImplementation("junit:junit:4.+")
// Mockito
testImplementation("org.mockito:mockito-core:3.12.3")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
}
repositories {
mavenCentral()
}
tasks.withType<KotlinCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
kotlinOptions {
jvmTarget = "11"
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
val javadoc = tasks.named("javadoc")
val javadocsJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles java doc to jar"
archiveClassifier.set("javadoc")
from(javadoc)
}
publishing {
repositories {
maven {
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
publications.register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(javadocsJar)
artifact(sourcesJar.get())
artifactId = "hyperloop-${[email protected]}"
pom {
name.set("Hyperloop")
description.set("Hyperloop")
url.set("https://github.com/GuiaBolso/Hyperloop")
scm {
url.set("https://github.com/GuiaBolso/Hyperloop")
connection.set("scm:git:https://github.com/GuiaBolso/Hyperloop")
}
licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
developers {
developer {
id.set("Guiabolso")
name.set("Guiabolso")
}
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useGpgCmd()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign((extensions.getByName("publishing") as PublishingExtension).publications)
}
}
repositories {
mavenCentral()
}