-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
79 lines (64 loc) · 2.19 KB
/
build.gradle.kts
File metadata and controls
79 lines (64 loc) · 2.19 KB
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
import java.io.BufferedReader
import java.io.InputStreamReader
plugins {
id("maven-publish")
kotlin("jvm") version System.getProperty("kotlinVersion")
}
fun getTag(): String {
try {
val versionRequest: String? = project.findProperty("version")?.toString()
if (!versionRequest.isNullOrBlank() && !versionRequest.equals("unspecified", ignoreCase = true)) {
return versionRequest
}
val process = ProcessBuilder("git", "describe", "--tags", "--abbrev=0")
.redirectErrorStream(true)
.start()
val reader = BufferedReader(InputStreamReader(process.inputStream))
val tag = reader.readLine()
if (tag.isNotBlank()) {
return tag
}
} catch (err: Throwable) {
println("Failed to get ${project.name} version")
}
return System.getProperty("pluginsVersion")
}
val sourceGroup = "com.github.softwareplace.springboot"
val tagVersion = getTag()
group = sourceGroup
version = tagVersion
tasks.getByName<Jar>("jar") {
archiveClassifier.set("")
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.toVersion(System.getProperty("jdkVersion"))
targetCompatibility = JavaVersion.toVersion(System.getProperty("jdkVersion"))
toolchain {
languageVersion.set(JavaLanguageVersion.of(System.getProperty("jdkVersion")))
}
}
repositories {
mavenCentral()
mavenLocal()
gradlePluginPortal()
maven("https://jitpack.io")
maven("https://repo.spring.io/milestone")
}
publishing {
publications {
create<MavenPublication>("plugins") {
artifactId = "plugins"
groupId = sourceGroup
from(components["java"])
}
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:${System.getProperty("kotlinVersion")}")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${System.getProperty("kotlinVersion")}")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${System.getProperty("kotlinVersion")}")
implementation("com.github.softwareplace.springboot:kotlin:$tagVersion")
implementation("com.github.softwareplace.springboot:java:$tagVersion")
}