-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
115 lines (97 loc) · 3.12 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.41"
`maven-publish`
id("com.jfrog.bintray") version "1.8.4"
}
group = "br.com.devsrsouza"
version = "1.2.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
//clients
compileClasspath("redis.clients:jedis:3.0.1")
compileClasspath("io.lettuce:lettuce-core:5.1.6.RELEASE")
// test
testImplementation("org.junit.jupiter:junit-jupiter:5.4.2")
testImplementation("io.mockk:mockk:1.9")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
val settings = file("publish.json").takeIf { it.exists() }?.let {
groovy.json.JsonSlurper().parseText(it.readText())
} as Map<*,*>?
if(settings != null) {
bintray {
user = settings["bintray_user"] as String
key = settings["bintray_key"] as String
setPublications("maven")
with(pkg) {
repo = "maven"
name = "Redissed"
websiteUrl = "https://github.com/DevSrSouza/Redissed"
vcsUrl = "https://github.com/DevSrSouza/Redissed.git"
setLicenses("Apache-2.0")
with(version) {
name = project.version.toString()
with(gpg) {
sign = settings["gpg_sign"] as Boolean
passphrase = settings["gpg_passphrase"] as String
}
with(mavenCentralSync) {
sync = settings["maven_sync"] as Boolean
user = settings["maven_user"] as String
password = settings["maven_password"] as String
}
}
}
}
}
val sources by tasks.registering(Jar::class) {
baseName = project.name
classifier = "sources"
from(sourceSets.main.get().allSource)
}
val javadocJar by tasks.registering(Jar::class) {
baseName = project.name
classifier = "javadoc"
from(tasks.javadoc)
}
publishing {
publications {
create<MavenPublication>("maven") {
artifactId = project.name.toLowerCase()
from(components["java"])
artifact(sources.get())
artifact(javadocJar.get())
pom {
name.set("Redissed")
description.set("Redis Kotlin wrapper inspired on Exposed")
url.set("https://github.com/DevSrSouza/Redissed")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("DevSrSouza")
name.set("Gabriel Souza")
email.set("devsrsouza@gmail.com")
}
}
scm {
url.set("https://github.com/DevSrSouza/Redissed/tree/master/")
}
}
}
}
}