forked from JetBrains/gradle-changelog-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
91 lines (76 loc) · 2.48 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
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
import org.jetbrains.dokka.gradle.DokkaTask
fun properties(key: String) = project.findProperty(key)?.toString()
plugins {
`kotlin-dsl`
`maven-publish`
kotlin("jvm") version "1.7.20"
id("com.gradle.plugin-publish") version "1.0.0"
id("org.jetbrains.changelog") version "2.0.0"
id("org.jetbrains.dokka") version "1.7.20"
}
version = properties("version")!!
group = properties("projectGroup")!!
description = properties("description")
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains:markdown:0.3.1") {
exclude(group = "org.jetbrains.kotlin")
}
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
}
kotlin {
jvmToolchain(11)
}
gradlePlugin {
plugins.create("changelog") {
id = properties("pluginId")
implementationClass = properties("pluginImplementationClass")
displayName = properties("pluginDisplayName")
description = properties("pluginDescription")
}
}
pluginBundle {
website = properties("website")
vcsUrl = properties("vcsUrl")
description = properties("description")
tags = properties("tags")?.split(',')
}
val dokkaHtml by tasks.getting(DokkaTask::class)
val javadocJar by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}
val sourcesJar = tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
artifacts {
archives(javadocJar)
archives(sourcesJar)
}
changelog {
groups.set(emptyList())
repositoryUrl.set("https://github.com/JetBrains/gradle-changelog-plugin")
}
tasks {
test {
val testGradleHomePath = "$buildDir/testGradleHome"
doFirst {
File(testGradleHomePath).mkdir()
}
systemProperties["test.gradle.home"] = testGradleHomePath
systemProperties["test.gradle.default"] = properties("gradleVersion")
systemProperties["test.gradle.version"] = properties("testGradleVersion")
systemProperties["test.gradle.arguments"] = properties("testGradleArguments")
outputs.dir(testGradleHomePath)
}
wrapper {
gradleVersion = properties("gradleVersion")
distributionUrl = "https://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
}