From a10c1f852813ea1c0e4f15b3c25a7a5388bbc996 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 2 Nov 2017 03:06:41 +0300 Subject: Make classpath Iterable #218 Fix #218 --- runners/gradle-plugin/src/main/kotlin/main.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 37feccc9..02970ae0 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -82,7 +82,7 @@ open class DokkaTask : DefaultTask() { @Deprecated("Going to be removed in 0.9.16, use classpath + sourceDirs instead if kotlinTasks is not suitable for you") @Input var processConfigurations: List = emptyList() - @Input var classpath: List = arrayListOf() + @InputFiles var classpath: Iterable = arrayListOf() @Input var includes: List = arrayListOf() -- cgit From 2290bcbd6efc8ac8d36b88d37b4281c1a90b106c Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 2 Nov 2017 05:32:50 +0300 Subject: Fix not rebuilding on source change Fixes #227 --- .../dokka/gradle/RebuildAfterSourceChangeTest.kt | 69 ++++++++++++++++++++++ .../kotlin/org/jetbrains/dokka/gradle/Utils.kt | 7 +-- .../testData/sourcesChange/build.gradle | 39 ++++++++++++ .../testData/sourcesChange/fileTree.txt | 10 ++++ .../testData/sourcesChange/fileTree1.txt | 11 ++++ .../testData/sourcesChange/settings.gradle | 1 + .../src/main/kotlin/demo/HelloWorld.kt | 6 ++ .../src1/main/kotlin/demo/HelloWorld.kt | 11 ++++ runners/gradle-plugin/src/main/kotlin/main.kt | 18 ++++-- 9 files changed, 162 insertions(+), 10 deletions(-) create mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/build.gradle create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/settings.gradle create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt create mode 100644 runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt new file mode 100644 index 00000000..42e79696 --- /dev/null +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt @@ -0,0 +1,69 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Test +import java.nio.file.Path +import kotlin.test.assertEquals + +class RebuildAfterSourceChangeTest : AbstractDokkaGradleTest() { + + fun prepareTestData(testDataRootPath: String): Pair { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + val tmpRoot = testProjectDir.root.toPath() + + testDataRoot.resolve("src").copy(tmpRoot.resolve("src")) + testDataRoot.resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) + testDataRoot.resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) + + return testDataRoot to tmpRoot + } + + private fun doTest(gradleVersion: String, kotlinVersion: String) { + + val (testDataRoot, tmpRoot) = prepareTestData("sourcesChange") + val docsOutput = "build/dokka" + + configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build().let { result -> + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) + } + + + configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build().let { result -> + println(result.output) + + assertEquals(TaskOutcome.UP_TO_DATE, result.task(":dokka")?.outcome) + } + + checkOutputStructure("sourcesChange/fileTree.txt", docsOutput) + + testDataRoot.resolve("src1").copy(tmpRoot.resolve("src")) + + configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build().let { result -> + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) + } + + + checkOutputStructure("sourcesChange/fileTree1.txt", docsOutput) + + } + + + @Test + fun `test kotlin 1_1_2 and gradle 3_5`() { + doTest("3.5", "1.1.2") + } + + @Test + fun `test kotlin 1_0_7 and gradle 2_14_1`() { + doTest("2.14.1", "1.0.7") + } + + @Test + fun `test kotlin 1_1_2 and gradle 4_0`() { + doTest("4.0", "1.1.2") + } +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt index d44459b1..6f17af22 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt @@ -3,10 +3,7 @@ package org.jetbrains.dokka.gradle import com.intellij.rt.execution.junit.FileComparisonFailure import java.io.File import java.io.IOException -import java.nio.file.FileVisitResult -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.SimpleFileVisitor +import java.nio.file.* import java.nio.file.attribute.BasicFileAttributes @@ -48,7 +45,7 @@ class CopyFileVisitor(private var sourcePath: Path?, private val targetPath: Pat @Throws(IOException::class) override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { - Files.copy(file, targetPath.resolve(sourcePath?.relativize(file))) + Files.copy(file, targetPath.resolve(sourcePath?.relativize(file)), StandardCopyOption.REPLACE_EXISTING) return FileVisitResult.CONTINUE } } diff --git a/runners/gradle-integration-tests/testData/sourcesChange/build.gradle b/runners/gradle-integration-tests/testData/sourcesChange/build.gradle new file mode 100644 index 00000000..bc20e1cf --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/build.gradle @@ -0,0 +1,39 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + +apply plugin: 'kotlin' +apply plugin: 'org.jetbrains.dokka' + +repositories { + mavenCentral() + jcenter() + maven { + url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" + } + maven { + url "https://dl.bintray.com/kotlin/kotlin-dev" + } +} + +dependencies { + compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version + compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version +} + + +dokka { + dokkaFatJar = new File(dokka_fatjar) +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt b/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt new file mode 100644 index 00000000..09f3724b --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt @@ -0,0 +1,10 @@ +/ + sources-change/ + alltypes.html + demo/ + hello.html + index.html + index-outline.html + index.html + package-list + style.css diff --git a/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt b/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt new file mode 100644 index 00000000..eeb377f7 --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt @@ -0,0 +1,11 @@ +/ + sources-change/ + alltypes.html + demo/ + hello.html + index.html + world.html + index-outline.html + index.html + package-list + style.css diff --git a/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle b/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle new file mode 100644 index 00000000..3fb032bf --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "sourcesChange" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt new file mode 100644 index 00000000..c54dea50 --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt @@ -0,0 +1,6 @@ +package demo + +/** + * @return Hello + */ +fun hello(): String = "Hello" \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt new file mode 100644 index 00000000..53f22ff5 --- /dev/null +++ b/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt @@ -0,0 +1,11 @@ +package demo + +/** + * @return Hello + */ +fun hello(): String = "Hello" + +/** + * @return World + */ +fun world(): String = "World" \ No newline at end of file diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 02970ae0..1fbbb0e0 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -95,7 +95,8 @@ open class DokkaTask : DefaultTask() { @Input var sourceDirs: Iterable = emptyList() - @Input var sourceRoots: MutableList = arrayListOf() + @Input + var sourceRoots: MutableList = arrayListOf() @Input var dokkaFatJar: Any = "org.jetbrains.dokka:dokka-fatjar:$version" @@ -331,10 +332,17 @@ open class DokkaTask : DefaultTask() { @InputFiles - fun getInputFiles(): FileCollection = - project.files(collectSourceRoots().map { project.fileTree(File(it.path)) }) + - project.files(includes) + - project.files(samples.map { project.fileTree(it) }) + fun getInputFiles(): FileCollection { + val (tasksClasspath, tasksSourceRoots) = kotlinCompileBasedClasspathAndSourceRoots + + val fullClasspath = collectClasspathFromOldSources() + tasksClasspath + classpath + + return project.files(tasksSourceRoots.map { project.fileTree(it) }) + + project.files(collectSourceRoots().map { project.fileTree(File(it.path)) }) + + project.files(fullClasspath.map { project.fileTree(it) }) + + project.files(includes) + + project.files(samples.map { project.fileTree(it) }) + } @OutputDirectory fun getOutputDirectoryAsFile(): File = project.file(outputDirectory) -- cgit From c14f3b06788df7309ba7034b030598b111540cb2 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 3 Nov 2017 18:38:35 +0300 Subject: Fix early lazy computation --- runners/gradle-plugin/src/main/kotlin/main.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 1fbbb0e0..fc5eb77c 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -333,7 +333,7 @@ open class DokkaTask : DefaultTask() { @InputFiles fun getInputFiles(): FileCollection { - val (tasksClasspath, tasksSourceRoots) = kotlinCompileBasedClasspathAndSourceRoots + val (tasksClasspath, tasksSourceRoots) = extractClasspathAndSourceRootsFromKotlinTasks() val fullClasspath = collectClasspathFromOldSources() + tasksClasspath + classpath -- cgit From 2a62816f1a50f03927dad34eb0ee80a889cb9e7e Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Thu, 5 Oct 2017 17:51:24 +0100 Subject: Add "suppress" to the per-package configuration options. --- core/src/main/kotlin/DokkaBootstrapImpl.kt | 3 ++- core/src/main/kotlin/Generation/configurationImpl.kt | 3 ++- integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt | 1 + runners/ant/src/main/kotlin/ant/dokka.kt | 3 ++- runners/cli/src/main/kotlin/cli/main.kt | 2 +- runners/gradle-plugin/src/main/kotlin/main.kt | 1 + runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 2 ++ 7 files changed, 11 insertions(+), 4 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index e9d0f3d5..0aea4422 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -17,7 +17,8 @@ fun parsePerPackageOptions(arg: String): List { val deprecated = args.find { it.endsWith("deprecated") }?.startsWith("+") ?: true val reportUndocumented = args.find { it.endsWith("warnUndocumented") }?.startsWith("+") ?: true val privateApi = args.find { it.endsWith("privateApi") }?.startsWith("+") ?: false - PackageOptionsImpl(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated) + val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") ?: false + PackageOptionsImpl(prefix, includeNonPublic = privateApi, reportUndocumented = reportUndocumented, skipDeprecated = !deprecated, suppress = suppress) } } diff --git a/core/src/main/kotlin/Generation/configurationImpl.kt b/core/src/main/kotlin/Generation/configurationImpl.kt index f67582a7..befe7e72 100644 --- a/core/src/main/kotlin/Generation/configurationImpl.kt +++ b/core/src/main/kotlin/Generation/configurationImpl.kt @@ -32,7 +32,8 @@ class SourceRootImpl(path: String, override val platforms: List = emptyL data class PackageOptionsImpl(override val prefix: String, override val includeNonPublic: Boolean = false, override val reportUndocumented: Boolean = true, - override val skipDeprecated: Boolean = false) : DokkaConfiguration.PackageOptions + override val skipDeprecated: Boolean = false, + override val suppress: Boolean = false) : DokkaConfiguration.PackageOptions data class DokkaConfigurationImpl(override val moduleName: String, override val classpath: List, diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt index 4c4d479f..fd6a4209 100644 --- a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt +++ b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt @@ -56,6 +56,7 @@ interface DokkaConfiguration { val includeNonPublic: Boolean val reportUndocumented: Boolean val skipDeprecated: Boolean + val suppress: Boolean } interface ExternalDocumentationLink { diff --git a/runners/ant/src/main/kotlin/ant/dokka.kt b/runners/ant/src/main/kotlin/ant/dokka.kt index fb70aefd..2872f845 100644 --- a/runners/ant/src/main/kotlin/ant/dokka.kt +++ b/runners/ant/src/main/kotlin/ant/dokka.kt @@ -28,7 +28,8 @@ class AntPackageOptions( override var prefix: String = "", override var includeNonPublic: Boolean = false, override var reportUndocumented: Boolean = true, - override var skipDeprecated: Boolean = false) : DokkaConfiguration.PackageOptions + override var skipDeprecated: Boolean = false, + override var suppress: Boolean = false) : DokkaConfiguration.PackageOptions class DokkaAntTask: Task() { diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index 77ca57f6..b6eb1564 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -44,7 +44,7 @@ class DokkaArguments { @set:Argument(value = "impliedPlatforms", description = "List of implied platforms (comma-separated)") var impliedPlatforms: String = "" - @set:Argument(value = "packageOptions", description = "List of package options in format \"prefix,-deprecated,-privateApi,+warnUndocumented;...\" ") + @set:Argument(value = "packageOptions", description = "List of package options in format \"prefix,-deprecated,-privateApi,+warnUndocumented,+suppress;...\" ") var packageOptions: String = "" @set:Argument(value = "links", description = "External documentation links in format url^packageListUrl^^url2...") diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index fc5eb77c..48d874a8 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -422,4 +422,5 @@ class PackageOptions : Serializable, DokkaConfiguration.PackageOptions { override var includeNonPublic: Boolean = false override var reportUndocumented: Boolean = true override var skipDeprecated: Boolean = false + override var suppress: Boolean = false } diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 345de523..c0904396 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -50,6 +50,8 @@ abstract class AbstractDokkaMojo : AbstractMojo() { override var reportUndocumented: Boolean = true @Parameter override var skipDeprecated: Boolean = false + @Parameter + override var suppress: Boolean = false } @Parameter(required = true, defaultValue = "\${project.compileSourceRoots}") -- cgit From 9733b4be121ae2cf21af99d63be4cdd7f87d1b2f Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 22 Nov 2017 17:16:05 +0300 Subject: Fix compilation, after enabling JSR305 --- runners/gradle-plugin/src/main/kotlin/main.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 48d874a8..3269395d 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -341,7 +341,7 @@ open class DokkaTask : DefaultTask() { project.files(collectSourceRoots().map { project.fileTree(File(it.path)) }) + project.files(fullClasspath.map { project.fileTree(it) }) + project.files(includes) + - project.files(samples.map { project.fileTree(it) }) + project.files(samples.filterNotNull().map { project.fileTree(it) }) } @OutputDirectory -- cgit From a88cd9d682866df1f379447ea07928463ee0f696 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 23 Nov 2017 18:55:33 +0300 Subject: Don't require JavaPluginConvention --- runners/gradle-plugin/src/main/kotlin/main.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 3269395d..623a627c 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -307,9 +307,7 @@ open class DokkaTask : DefaultTask() { val allConfigurations = project.configurations val fromConfigurations = - processConfigurations.map { - allConfigurations?.getByName(it.toString()) ?: throw IllegalArgumentException("No configuration $it found") - }.flatten() + processConfigurations.flatMap { allConfigurations.getByName(it.toString()) } return fromConfigurations } @@ -319,10 +317,11 @@ open class DokkaTask : DefaultTask() { logger.info("Dokka: Taking source directories provided by the user") sourceDirs.toSet() } else if (kotlinTasks.isEmpty()) { - logger.info("Dokka: Taking source directories from default java plugin") - val javaPluginConvention = project.convention.getPlugin(JavaPluginConvention::class.java) - val sourceSets = javaPluginConvention.sourceSets?.findByName(SourceSet.MAIN_SOURCE_SET_NAME) - sourceSets?.allSource?.srcDirs + project.convention.findPlugin(JavaPluginConvention::class.java)?.let { javaPluginConvention -> + logger.info("Dokka: Taking source directories from default java plugin") + val sourceSets = javaPluginConvention.sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME) + sourceSets?.allSource?.srcDirs + } } else { emptySet() } -- cgit From 13c4cb93f55693f3bfa396ccad9549d8654ec3f9 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 27 Nov 2017 16:05:59 +0300 Subject: Add language version arguments --- .../main/kotlin/Analysis/AnalysisEnvironment.kt | 9 +++- core/src/main/kotlin/DokkaBootstrapImpl.kt | 2 + core/src/main/kotlin/Generation/DokkaGenerator.kt | 2 + .../main/kotlin/Generation/configurationImpl.kt | 46 +++++++++++---------- .../src/main/kotlin/Kotlin/DocumentationBuilder.kt | 2 + core/src/test/kotlin/TestAPI.kt | 13 ++++-- .../test/kotlin/format/KotlinWebSiteFormatTest.kt | 9 +++- .../kotlin/format/KotlinWebSiteHtmlFormatTest.kt | 9 +++- core/src/test/kotlin/format/MarkdownFormatTest.kt | 18 +++++++- .../kotlin/org/jetbrains/dokka/configuration.kt | 48 ++++++++++++---------- runners/ant/src/main/kotlin/ant/dokka.kt | 11 ++++- runners/cli/src/main/kotlin/cli/main.kt | 11 ++++- runners/gradle-plugin/src/main/kotlin/main.kt | 14 ++++++- runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 10 ++++- 14 files changed, 147 insertions(+), 57 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index 3eb235e5..003c6835 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -69,7 +69,6 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val projectFileIndex = CoreProjectFileIndex(environment.project, environment.configuration.getList(JVMConfigurationKeys.CONTENT_ROOTS)) - environment.configuration.put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, LanguageVersionSettingsImpl.DEFAULT) val moduleManager = object : CoreModuleManager(environment.project, this) { override fun getModules(): Array = arrayOf(projectFileIndex.module) @@ -142,7 +141,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { }, CompilerEnvironment, packagePartProviderFactory = { info, content -> - JvmPackagePartProvider(LanguageVersionSettingsImpl.DEFAULT, content.moduleContentScope).apply { + JvmPackagePartProvider(configuration.languageVersionSettings, content.moduleContentScope).apply { addRoots(javaRoots) } }, @@ -157,6 +156,12 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { return DokkaResolutionFacade(environment.project, moduleDescriptor, resolverForModule) } + fun loadLanguageVersionSettings(languageVersionString: String?, apiVersionString: String?) { + val languageVersion = LanguageVersion.fromVersionString(languageVersionString) ?: LanguageVersion.LATEST_STABLE + val apiVersion = apiVersionString?.let { ApiVersion.parse(it) } ?: ApiVersion.createByLanguageVersion(languageVersion) + configuration.languageVersionSettings = LanguageVersionSettingsImpl(languageVersion, apiVersion) + } + /** * Classpath for this environment. */ diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index 0aea4422..126a0175 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -66,6 +66,8 @@ class DokkaBootstrapImpl : DokkaBootstrap { perPackageOptions, externalDocumentationLinks, noStdlibLink, + languageVersion, + apiVersion, cacheRoot, suppressedFiles.map { File(it) } ) diff --git a/core/src/main/kotlin/Generation/DokkaGenerator.kt b/core/src/main/kotlin/Generation/DokkaGenerator.kt index 17b6b156..09e5cedf 100644 --- a/core/src/main/kotlin/Generation/DokkaGenerator.kt +++ b/core/src/main/kotlin/Generation/DokkaGenerator.kt @@ -94,6 +94,8 @@ class DokkaGenerator(val logger: DokkaLogger, addSources(sourcePaths) addSources(this@DokkaGenerator.samples) + + loadLanguageVersionSettings(options.languageVersion, options.apiVersion) } return environment diff --git a/core/src/main/kotlin/Generation/configurationImpl.kt b/core/src/main/kotlin/Generation/configurationImpl.kt index befe7e72..34d4154e 100644 --- a/core/src/main/kotlin/Generation/configurationImpl.kt +++ b/core/src/main/kotlin/Generation/configurationImpl.kt @@ -35,24 +35,28 @@ data class PackageOptionsImpl(override val prefix: String, override val skipDeprecated: Boolean = false, override val suppress: Boolean = false) : DokkaConfiguration.PackageOptions -data class DokkaConfigurationImpl(override val moduleName: String, - override val classpath: List, - override val sourceRoots: List, - override val samples: List, - override val includes: List, - override val outputDir: String, - override val format: String, - override val includeNonPublic: Boolean, - override val includeRootPackage: Boolean, - override val reportUndocumented: Boolean, - override val skipEmptyPackages: Boolean, - override val skipDeprecated: Boolean, - override val jdkVersion: Int, - override val generateIndexPages: Boolean, - override val sourceLinks: List, - override val impliedPlatforms: List, - override val perPackageOptions: List, - override val externalDocumentationLinks: List, - override val noStdlibLink: Boolean, - override val cacheRoot: String?, - override val suppressedFiles: List) : DokkaConfiguration \ No newline at end of file +data class DokkaConfigurationImpl( + override val moduleName: String, + override val classpath: List, + override val sourceRoots: List, + override val samples: List, + override val includes: List, + override val outputDir: String, + override val format: String, + override val includeNonPublic: Boolean, + override val includeRootPackage: Boolean, + override val reportUndocumented: Boolean, + override val skipEmptyPackages: Boolean, + override val skipDeprecated: Boolean, + override val jdkVersion: Int, + override val generateIndexPages: Boolean, + override val sourceLinks: List, + override val impliedPlatforms: List, + override val perPackageOptions: List, + override val externalDocumentationLinks: List, + override val noStdlibLink: Boolean, + override val cacheRoot: String?, + override val suppressedFiles: List, + override val languageVersion: String?, + override val apiVersion: String? +) : DokkaConfiguration \ No newline at end of file diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 2998e314..61bf50d6 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -48,6 +48,8 @@ class DocumentationOptions(val outputDir: String, perPackageOptions: List = emptyList(), externalDocumentationLinks: List = emptyList(), noStdlibLink: Boolean, + val languageVersion: String?, + val apiVersion: String?, cacheRoot: String? = null, val suppressedFiles: List = emptyList()) { init { diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index 8bbeb2f2..ff8a5260 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -28,15 +28,20 @@ fun verifyModel(vararg roots: ContentRoot, verifier: (DocumentationModule) -> Unit) { val documentation = DocumentationModule("test") - val options = DocumentationOptions("", format, + val options = DocumentationOptions( + "", + format, includeNonPublic = includeNonPublic, skipEmptyPackages = false, includeRootPackage = true, - sourceLinks = listOf(), + sourceLinks = listOf(), perPackageOptions = perPackageOptions, generateIndexPages = false, noStdlibLink = true, - cacheRoot = "default") + cacheRoot = "default", + languageVersion = null, + apiVersion = null + ) appendDocumentation(documentation, *roots, withJdk = withJdk, @@ -88,6 +93,8 @@ fun appendDocumentation(documentation: DocumentationModule, addClasspath(File(kotlinStrictfpRoot)) } addRoots(roots.toList()) + + loadLanguageVersionSettings(options.languageVersion, options.apiVersion) } val defaultPlatformsProvider = object : DefaultPlatformsProvider { override fun getDefaultPlatforms(descriptor: DeclarationDescriptor) = defaultPlatforms diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt index f4ca2982..af44b048 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -42,7 +42,14 @@ class KotlinWebSiteFormatTest { private fun buildMultiplePlatforms(path: String): DocumentationModule { val module = DocumentationModule("test") - val options = DocumentationOptions("", "html", generateIndexPages = false, noStdlibLink = true) + val options = DocumentationOptions( + outputDir = "", + outputFormat = "html", + generateIndexPages = false, + noStdlibLink = true, + languageVersion = null, + apiVersion = null + ) appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options) appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/jre7.kt"), defaultPlatforms = listOf("JVM", "JRE7"), options = options) appendDocumentation(module, contentRootFromPath("testdata/format/website/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options) diff --git a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt index b4b133f4..433c9c13 100644 --- a/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt +++ b/core/src/test/kotlin/format/KotlinWebSiteHtmlFormatTest.kt @@ -57,7 +57,14 @@ class KotlinWebSiteHtmlFormatTest { private fun buildMultiplePlatforms(path: String): DocumentationModule { val module = DocumentationModule("test") - val options = DocumentationOptions("", "html", generateIndexPages = false, noStdlibLink = true) + val options = DocumentationOptions( + outputDir = "", + outputFormat = "kotlin-website-html", + generateIndexPages = false, + noStdlibLink = true, + languageVersion = null, + apiVersion = null + ) appendDocumentation(module, contentRootFromPath("testdata/format/website-html/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options) appendDocumentation(module, contentRootFromPath("testdata/format/website-html/$path/jre7.kt"), defaultPlatforms = listOf("JVM", "JRE7"), options = options) appendDocumentation(module, contentRootFromPath("testdata/format/website-html/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options) diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index d2ab5b5c..2c5422c5 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -300,7 +300,14 @@ class MarkdownFormatTest { @Test fun packagePlatformsWithExtExtensions() { val path = "multiplatform/packagePlatformsWithExtExtensions" val module = DocumentationModule("test") - val options = DocumentationOptions("", "html", generateIndexPages = false, noStdlibLink = true) + val options = DocumentationOptions( + outputDir = "", + outputFormat = "html", + generateIndexPages = false, + noStdlibLink = true, + languageVersion = null, + apiVersion = null + ) appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), withKotlinRuntime = true, options = options) verifyMultiplatformIndex(module, path) verifyMultiplatformPackage(module, path) @@ -402,7 +409,14 @@ class MarkdownFormatTest { private fun buildMultiplePlatforms(path: String): DocumentationModule { val module = DocumentationModule("test") - val options = DocumentationOptions("", "html", generateIndexPages = false, noStdlibLink = true) + val options = DocumentationOptions( + outputDir = "", + outputFormat = "html", + generateIndexPages = false, + noStdlibLink = true, + languageVersion = null, + apiVersion = null + ) appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options) appendDocumentation(module, contentRootFromPath("testdata/format/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options) return module diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt index fd6a4209..90e5b5fc 100644 --- a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt +++ b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt @@ -36,6 +36,8 @@ interface DokkaConfiguration { val impliedPlatforms: List val perPackageOptions: List val externalDocumentationLinks: List + val languageVersion: String? + val apiVersion: String? val noStdlibLink: Boolean val cacheRoot: String? val suppressedFiles: List @@ -79,27 +81,31 @@ interface DokkaConfiguration { } } -data class SerializeOnlyDokkaConfiguration(override val moduleName: String, - override val classpath: List, - override val sourceRoots: List, - override val samples: List, - override val includes: List, - override val outputDir: String, - override val format: String, - override val includeNonPublic: Boolean, - override val includeRootPackage: Boolean, - override val reportUndocumented: Boolean, - override val skipEmptyPackages: Boolean, - override val skipDeprecated: Boolean, - override val jdkVersion: Int, - override val generateIndexPages: Boolean, - override val sourceLinks: List, - override val impliedPlatforms: List, - override val perPackageOptions: List, - override val externalDocumentationLinks: List, - override val noStdlibLink: Boolean, - override val cacheRoot: String?, - override val suppressedFiles: List) : DokkaConfiguration +data class SerializeOnlyDokkaConfiguration( + override val moduleName: String, + override val classpath: List, + override val sourceRoots: List, + override val samples: List, + override val includes: List, + override val outputDir: String, + override val format: String, + override val includeNonPublic: Boolean, + override val includeRootPackage: Boolean, + override val reportUndocumented: Boolean, + override val skipEmptyPackages: Boolean, + override val skipDeprecated: Boolean, + override val jdkVersion: Int, + override val generateIndexPages: Boolean, + override val sourceLinks: List, + override val impliedPlatforms: List, + override val perPackageOptions: List, + override val externalDocumentationLinks: List, + override val noStdlibLink: Boolean, + override val cacheRoot: String?, + override val suppressedFiles: List, + override val languageVersion: String?, + override val apiVersion: String? +) : DokkaConfiguration data class ExternalDocumentationLinkImpl(@CustomSerializer(UrlSerializer::class) override val url: URL, 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 ) ) -- cgit From 0b3595a8e38d5f5b1d280eec4c35eea4976023f5 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Sun, 26 Nov 2017 09:25:46 +1100 Subject: Pick correct closure type in the gradle plugin Replace Closure with Closure in the gradle plugin. Fixes #241 --- runners/gradle-plugin/src/main/kotlin/main.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index bdecc3f6..505b2baf 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -133,7 +133,7 @@ open class DokkaTask : DefaultTask() { kotlinTasksConfigurator = { closure.call() as? List } } - fun linkMapping(closure: Closure) { + fun linkMapping(closure: Closure) { val mapping = LinkMapping() closure.delegate = mapping closure.call() @@ -148,21 +148,21 @@ open class DokkaTask : DefaultTask() { linkMappings.add(mapping) } - fun sourceRoot(closure: Closure) { + fun sourceRoot(closure: Closure) { val sourceRoot = SourceRoot() closure.delegate = sourceRoot closure.call() sourceRoots.add(sourceRoot) } - fun packageOptions(closure: Closure) { + fun packageOptions(closure: Closure) { val packageOptions = PackageOptions() closure.delegate = packageOptions closure.call() perPackageOptions.add(packageOptions) } - fun externalDocumentationLink(closure: Closure) { + fun externalDocumentationLink(closure: Closure) { val builder = DokkaConfiguration.ExternalDocumentationLink.Builder() closure.delegate = builder closure.call() -- cgit From 9dc46252c40b64b094ca3c53ccf4750d1b31e221 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Sun, 26 Nov 2017 09:32:25 +1100 Subject: Fix ReportNotDocumented in the Gradle plugin Replace ReportNotDocumented with ReportUndocumented in the Gradle plugin for consistency. Fixes #243 --- runners/gradle-plugin/src/main/kotlin/main.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 505b2baf..20d99c47 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -104,7 +104,7 @@ open class DokkaTask : DefaultTask() { @Input var includeNonPublic = false @Input var skipDeprecated = false @Input var skipEmptyPackages = true - @Input var reportNotDocumented = true + @Input var reportUndocumented = true @Input var perPackageOptions: MutableList = arrayListOf() @Input var impliedPlatforms: MutableList = arrayListOf() @@ -278,7 +278,7 @@ open class DokkaTask : DefaultTask() { outputFormat, includeNonPublic, false, - reportNotDocumented, + reportUndocumented, skipEmptyPackages, skipDeprecated, jdkVersion, -- cgit From 7485016705c4364dcea0212b5bc816f326ad7a87 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 11 Dec 2017 19:03:28 +0300 Subject: Add deprecation message for reportNotDocumented, in sake of #243 --- runners/gradle-plugin/src/main/kotlin/main.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 20d99c47..057efb98 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -51,6 +51,8 @@ object ClassloaderContainer { var fatJarClassLoader: ClassLoader? = null } +const val `deprecationMessage reportNotDocumented` = "Will be removed in 0.9.17, see dokka#243" + open class DokkaTask : DefaultTask() { fun defaultKotlinTasks() = with(ReflectDsl) { @@ -104,6 +106,15 @@ open class DokkaTask : DefaultTask() { @Input var includeNonPublic = false @Input var skipDeprecated = false @Input var skipEmptyPackages = true + + @Deprecated(`deprecationMessage reportNotDocumented`, replaceWith = ReplaceWith("reportUndocumented")) + var reportNotDocumented + get() = reportUndocumented + set(value) { + logger.warn("Dokka: reportNotDocumented is deprecated and " + `deprecationMessage reportNotDocumented`.decapitalize()) + reportUndocumented = value + } + @Input var reportUndocumented = true @Input var perPackageOptions: MutableList = arrayListOf() @Input var impliedPlatforms: MutableList = arrayListOf() -- cgit From 4a425e29fba4030d9cde7072ee6bf39ab7ae3668 Mon Sep 17 00:00:00 2001 From: Roman Elizarov Date: Fri, 22 Dec 2017 16:15:02 +0300 Subject: Supports hacks for MPP documentation generation --- core/src/main/kotlin/Analysis/AnalysisEnvironment.kt | 8 ++++---- runners/gradle-plugin/src/main/kotlin/main.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index 3b9b9149..56249ac4 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -114,15 +114,15 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val javaRoots = classpath - .map { + .mapNotNull { val rootFile = when { it.extension == "jar" -> - StandardFileSystems.jar().findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}")!! + StandardFileSystems.jar().findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}") else -> - StandardFileSystems.local().findFileByPath(it.absolutePath)!! + StandardFileSystems.local().findFileByPath(it.absolutePath) } - JavaRoot(rootFile, JavaRoot.RootType.BINARY) + rootFile?.let { JavaRoot(it, JavaRoot.RootType.BINARY) } } val resolverForProject = ResolverForProjectImpl( diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 057efb98..78bf4978 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -379,7 +379,7 @@ open class DokkaTask : DefaultTask() { } } -class SourceRoot : DokkaConfiguration.SourceRoot { +class SourceRoot : DokkaConfiguration.SourceRoot, Serializable { override var path: String = "" set(value) { field = File(value).absolutePath -- cgit From f1536cc86b9cedebb10664e63783eb45e60c4856 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 31 Jan 2018 14:35:28 +0300 Subject: Fix dependencies in Gradle 4.5 --- gradle/wrapper/gradle-wrapper.properties | 2 +- runners/gradle-plugin/src/main/kotlin/main.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin') diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 590f0e81..610ad4c5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index 78bf4978..8c7f608e 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -71,7 +71,7 @@ open class DokkaTask : DefaultTask() { description = "Generates dokka documentation for Kotlin" @Suppress("LeakingThis") - dependsOn(Callable { kotlinTasks.flatMap { it.dependsOn } }) + dependsOn(Callable { kotlinTasks.map { it.taskDependencies } }) } @Input -- cgit