aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-01 16:38:56 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-02 12:48:53 +0200
commit2e02e56818609c683f95ba4f17fa749eb9e1c705 (patch)
tree53c1ccadcb26f651dec20ed7874db202081fc825 /core
parentbadd2d7e4bfad519f31b69ae9c1bea5659f3c59b (diff)
downloaddokka-2e02e56818609c683f95ba4f17fa749eb9e1c705.tar.gz
dokka-2e02e56818609c683f95ba4f17fa749eb9e1c705.tar.bz2
dokka-2e02e56818609c683f95ba4f17fa749eb9e1c705.zip
runner:gradle-plugin: Apply `java-gradle-plugin`
Diffstat (limited to 'core')
-rw-r--r--core/build.gradle.kts13
-rw-r--r--core/src/main/kotlin/DokkaVersion.kt10
-rw-r--r--core/src/main/resources/META-INF/dokka/dokka-version.properties1
3 files changed, 24 insertions, 0 deletions
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
index fc62b73d..45ddccf3 100644
--- a/core/build.gradle.kts
+++ b/core/build.gradle.kts
@@ -21,6 +21,19 @@ val sourceJar by tasks.registering(Jar::class) {
from(sourceSets["main"].allSource)
}
+tasks {
+ processResources {
+ val dokka_version: String by project
+ eachFile {
+ if (name == "dokka-version.properties") {
+ filter { line ->
+ line.replace("<dokka-version>", dokka_version)
+ }
+ }
+ }
+ }
+}
+
publishing {
publications {
register<MavenPublication>("dokkaCore") {
diff --git a/core/src/main/kotlin/DokkaVersion.kt b/core/src/main/kotlin/DokkaVersion.kt
new file mode 100644
index 00000000..410058f3
--- /dev/null
+++ b/core/src/main/kotlin/DokkaVersion.kt
@@ -0,0 +1,10 @@
+package org.jetbrains.dokka
+
+import java.util.*
+
+object DokkaVersion {
+ val version: String by lazy {
+ val stream = javaClass.getResourceAsStream("/META-INF/dokka/dokka-version.properties")
+ Properties().apply { load(stream) }.getProperty("dokka-version")
+ }
+}
diff --git a/core/src/main/resources/META-INF/dokka/dokka-version.properties b/core/src/main/resources/META-INF/dokka/dokka-version.properties
new file mode 100644
index 00000000..6b2e2bcd
--- /dev/null
+++ b/core/src/main/resources/META-INF/dokka/dokka-version.properties
@@ -0,0 +1 @@
+dokka-version=<dokka-version>