This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
117 lines (107 loc) · 3.69 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
import com.jfrog.bintray.gradle.BintrayExtension
import groovy.lang.Closure
import groovy.util.Node
import net.researchgate.release.BaseScmAdapter
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.0"
id("net.researchgate.release") version "2.7.0"
id("com.jfrog.bintray") version "1.8.4"
`maven-publish`
`jacoco`
}
group = "io.kesselring.sukejura"
allprojects {
repositories {
mavenCentral()
jcenter()
}
}
tasks {
getByName<JacocoReport>("jacocoTestReport") {
reports {
xml.isEnabled = true
xml.destination = file("$buildDir/reports/jacoco/report.xml")
}
}
}
dependencies {
compile(kotlin("stdlib-jdk8"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0")
testCompile("org.junit.jupiter:junit-jupiter-api:5.3.1")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.3.1")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.withType<Test> {
useJUnitPlatform()
}
val sourcesJar by tasks.registering(Jar::class) {
classifier = "sources"
from(sourceSets["main"].allSource)
}
tasks.withType(Test::class.java) {
testLogging.showStandardStreams = true
}
tasks.findByPath("build")?.finalizedBy(sourcesJar)
release {
buildTasks = listOf("build", "bintrayPublish", "bintrayUpload")
}
publishing {
publications.invoke {
register(findProperty("publicationName")!!, MavenPublication::class) {
from(components["java"])
artifact(sourcesJar.get())
pom.withXml {
asNode().get("dependencies").delegateClosureOf<Node> {
configurations.compile.allDependencies.forEach {
appendNode("dependency").apply {
appendNode("groupId", it.group)
appendNode("artifactId", it.name)
appendNode("version", it.version)
}
}
}
asNode().apply {
appendNode("name", "Sukejura")
appendNode("url", "https://github.com/Ingwersaft/sukejura")
appendNode("licenses").apply {
appendNode("license").apply {
appendNode("name", "MIT License")
appendNode("url", "https://github.com/Ingwersaft/sukejura/blob/master/LICENSE")
appendNode("distribution", "repo")
}
}
}
}
artifactId = "Sukejura"
version = findProperty("version")
group = project.group
}
}
}
fun findProperty(s: String) = project.findProperty(s) as String?
bintray {
user = findProperty("bintrayUser")
key = findProperty("bintrayApiKey")
publish = true
dryRun = false
setPublications(findProperty("publicationName"))
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "Sukejura"
name = "Sukejura"
userOrg = user
websiteUrl = "https://github.com/Ingwersaft/sukejura"
githubRepo = "https://github.com/Ingwersaft/sukejura"
vcsUrl = "https://github.com/Ingwersaft/sukejura.git"
issueTrackerUrl = "https://github.com/Ingwersaft/sukejura/issues"
description = "cron-like library for kotlin - coroutine based"
setLabels("kotlin", "cron", "scheduling", "schedule", "sukejura", "coroutines", "tasks")
setLicenses("MIT")
desc = description
version(delegateClosureOf<BintrayExtension.VersionConfig> {
name = findProperty("version")!!
})
})
}