aboutsummaryrefslogtreecommitdiff
path: root/runners
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-27 16:05:59 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-27 16:05:59 +0300
commit13c4cb93f55693f3bfa396ccad9549d8654ec3f9 (patch)
treed0af242a455f14d051251eeabb2b1dcc6d6db700 /runners
parentcc2a478ff0f1831be2333bf97712e1ffe9d764fe (diff)
downloaddokka-13c4cb93f55693f3bfa396ccad9549d8654ec3f9.tar.gz
dokka-13c4cb93f55693f3bfa396ccad9549d8654ec3f9.tar.bz2
dokka-13c4cb93f55693f3bfa396ccad9549d8654ec3f9.zip
Add language version arguments
Diffstat (limited to 'runners')
-rw-r--r--runners/ant/src/main/kotlin/ant/dokka.kt11
-rw-r--r--runners/cli/src/main/kotlin/cli/main.kt11
-rw-r--r--runners/gradle-plugin/src/main/kotlin/main.kt14
-rw-r--r--runners/maven-plugin/src/main/kotlin/DokkaMojo.kt10
4 files changed, 40 insertions, 6 deletions
diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt
index 2872f845..d1b6bef5 100644
--- a/runners/ant/src/main/kotlin/ant/dokka.kt
+++ b/runners/ant/src/main/kotlin/ant/dokka.kt
@@ -45,6 +45,9 @@ class DokkaAntTask: Task() {
var cacheRoot: String? = null
+ var languageVersion: String? = null
+ var apiVersion: String? = null
+
val compileClasspath: Path by lazy { Path(getProject()) }
val sourcePath: Path by lazy { Path(getProject()) }
val samplesPath: Path by lazy { Path(getProject()) }
@@ -118,7 +121,9 @@ class DokkaAntTask: Task() {
samplesPath.list().toList(),
includesPath.list().toList(),
moduleName!!,
- DocumentationOptions(outputDir!!, outputFormat,
+ DocumentationOptions(
+ outputDir!!,
+ outputFormat,
skipDeprecated = skipDeprecated,
sourceLinks = sourceLinks,
jdkVersion = jdkVersion,
@@ -126,7 +131,9 @@ class DokkaAntTask: Task() {
perPackageOptions = antPackageOptions,
externalDocumentationLinks = antExternalDocumentationLinks.map { it.build() },
noStdlibLink = noStdlibLink,
- cacheRoot = cacheRoot
+ cacheRoot = cacheRoot,
+ languageVersion = languageVersion,
+ apiVersion = apiVersion
)
)
generator.generate()
diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt
index b6eb1564..fe945ed3 100644
--- a/runners/cli/src/main/kotlin/cli/main.kt
+++ b/runners/cli/src/main/kotlin/cli/main.kt
@@ -55,6 +55,13 @@ class DokkaArguments {
@set:Argument(value = "cacheRoot", description = "Path to cache folder, or 'default' to use ~/.cache/dokka, if not provided caching is disabled")
var cacheRoot: String? = null
+
+ @set:Argument(value = "languageVersion", description = "Language Version to pass to Kotlin Analysis")
+ var languageVersion: String? = null
+
+ @set:Argument(value = "apiVersion", description = "Kotlin Api Version to pass to Kotlin Analysis")
+ var apiVersion: String? = null
+
}
@@ -108,7 +115,9 @@ object MainKt {
jdkVersion = arguments.jdkVersion,
externalDocumentationLinks = parseLinks(arguments.links),
noStdlibLink = arguments.noStdlibLink,
- cacheRoot = arguments.cacheRoot
+ cacheRoot = arguments.cacheRoot,
+ languageVersion = arguments.languageVersion,
+ apiVersion = arguments.apiVersion
)
val generator = DokkaGenerator(
diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt
index 623a627c..bdecc3f6 100644
--- a/runners/gradle-plugin/src/main/kotlin/main.kt
+++ b/runners/gradle-plugin/src/main/kotlin/main.kt
@@ -112,7 +112,15 @@ open class DokkaTask : DefaultTask() {
@Input var noStdlibLink: Boolean = false
- @Optional @Input var cacheRoot: String? = null
+ @Optional @Input
+ var cacheRoot: String? = null
+
+
+ @Optional @Input
+ var languageVersion: String? = null
+
+ @Optional @Input
+ var apiVersion: String? = null
@get:Input
internal val kotlinCompileBasedClasspathAndSourceRoots: ClasspathAndSourceRoots by lazy { extractClasspathAndSourceRootsFromKotlinTasks() }
@@ -281,7 +289,9 @@ open class DokkaTask : DefaultTask() {
externalDocumentationLinks,
noStdlibLink,
cacheRoot,
- collectSuppressedFiles(sourceRoots))
+ collectSuppressedFiles(sourceRoots),
+ languageVersion,
+ apiVersion)
bootstrapProxy.configure(
diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
index c0904396..09da90c6 100644
--- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
+++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
@@ -107,6 +107,12 @@ abstract class AbstractDokkaMojo : AbstractMojo() {
@Parameter
var cacheRoot: String? = null
+ @Parameter
+ var languageVersion: String? = null
+
+ @Parameter
+ var apiVersion: String? = null
+
protected abstract fun getOutDir(): String
protected abstract fun getOutFormat(): String
@@ -133,7 +139,9 @@ abstract class AbstractDokkaMojo : AbstractMojo() {
perPackageOptions = perPackageOptions,
externalDocumentationLinks = externalDocumentationLinks.map { it.build() },
noStdlibLink = noStdlibLink,
- cacheRoot = cacheRoot
+ cacheRoot = cacheRoot,
+ languageVersion = languageVersion,
+ apiVersion = apiVersion
)
)