-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
108 lines (94 loc) · 2.98 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id("org.springframework.boot") version "2.4.1"
id("io.spring.dependency-management") version "1.0.10.RELEASE"
id("org.jetbrains.dokka") version "0.10.1"
id("com.jfrog.bintray") version "1.8.5"
kotlin("jvm") version "1.4.21"
kotlin("plugin.spring") version "1.4.21"
`maven-publish`
}
group = "common.marvel"
version = "0.1.12"
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")
testImplementation("io.kotlintest:kotlintest-extensions-spring:3.4.2")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.dokka {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
}
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokka)
}
val sourceJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Source"
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
publishing {
publications {
create<MavenPublication>("default") {
from(components["java"])
artifact(sourceJar)
artifact(dokkaJar)
}
}
}
bintray {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
publish = true
setPublications("default")
pkg(
delegateClosureOf<com.jfrog.bintray.gradle.BintrayExtension.PackageConfig> {
userOrg = "common-marvel"
repo = "kotlin"
name = "spring-boot-helper-kotlin"
websiteUrl = "https://github.com/CommonMarvel/spring-boot-helper-kotlin"
githubRepo = "CommonMarvel/spring-boot-helper-kotlin"
vcsUrl = "https://github.com/CommonMarvel/spring-boot-helper-kotlin.git"
description = ""
setLabels("kotlin")
setLicenses("MIT")
desc = description
}
)
}
tasks.getByName("bintrayUpload").enabled = true
tasks.getByName("publish").enabled = false
tasks.getByName("bootJar").enabled = false
tasks.getByName("jar").enabled = true