diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2016-07-08 12:55:26 +0200 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2016-07-08 12:55:26 +0200 |
commit | 95a606f54604d673a8bda00f19dae81463925475 (patch) | |
tree | 94979d9f7eac102a8254f170a39a860c7df1e2ba | |
parent | 0f65cf0e4ce531715b76ac32a36a3dff488b2d70 (diff) | |
download | dokka-95a606f54604d673a8bda00f19dae81463925475.tar.gz dokka-95a606f54604d673a8bda00f19dae81463925475.tar.bz2 dokka-95a606f54604d673a8bda00f19dae81463925475.zip |
update Kotlin compiler and kotlin-ide-common to 1.0.4-dev-13, fixing the qualified name resolve problem in doc comments
-rw-r--r-- | build.gradle | 25 | ||||
-rw-r--r-- | core/build.gradle | 17 | ||||
-rw-r--r-- | core/src/main/kotlin/Analysis/AnalysisEnvironment.kt | 8 | ||||
-rw-r--r-- | core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt | 3 | ||||
-rw-r--r-- | core/src/main/kotlin/main.kt | 11 | ||||
-rw-r--r-- | core/src/test/kotlin/TestAPI.kt | 2 | ||||
-rw-r--r-- | core/src/test/kotlin/format/MarkdownFormatTest.kt | 8 | ||||
-rw-r--r-- | core/testdata/format/qualifiedNameLink.kt | 6 | ||||
-rw-r--r-- | core/testdata/format/qualifiedNameLink.md | 8 | ||||
-rw-r--r-- | dokka-android-gradle-plugin/build.gradle | 15 | ||||
-rw-r--r-- | dokka-gradle-plugin/build.gradle | 14 | ||||
-rw-r--r-- | lib/kotlin-compiler.jar | bin | 25364609 -> 25666592 bytes | |||
-rw-r--r-- | lib/kotlin-ide-common.jar | bin | 398791 -> 402440 bytes |
13 files changed, 64 insertions, 53 deletions
diff --git a/build.gradle b/build.gradle index 790e9dbc..ba425e95 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,31 @@ plugins { id "com.jfrog.bintray" version "1.4" } +allprojects { + buildscript { + repositories { + mavenCentral() + jcenter() + maven { + url "https://dl.bintray.com/kotlin/kotlin-eap" + } + maven { + url "https://dl.bintray.com/kotlin/kotlin-dev" + } + } + } + + repositories { + mavenCentral() + maven { + url "https://dl.bintray.com/kotlin/kotlin-eap" + } + maven { + url "https://dl.bintray.com/kotlin/kotlin-dev" + } + } +} + apply plugin: 'maven-publish' task updatePom << { diff --git a/core/build.gradle b/core/build.gradle index d3ba259f..c66fc5a1 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -14,12 +14,6 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' } - repositories { - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } - } } apply plugin: 'java' @@ -30,19 +24,12 @@ apply plugin: 'com.jfrog.bintray' sourceCompatibility = 1.5 -repositories { - mavenCentral() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } -} - configurations { provided } dependencies { - compile "com.google.inject:guice:4.0" + compile "com.google.inject:guice:4.1.0" compile "com.github.spullara.cli-parser:cli-parser:1.1.1" compile "org.jsoup:jsoup:1.8.3" compile "org.apache.ant:ant:1.9.6" @@ -66,7 +53,7 @@ dependencies { runtime files("../lib/asm-all.jar") runtime files("../lib/jps-model.jar") - testCompile group: 'junit', name: 'junit', version: '4.11' + testCompile group: 'junit', name: 'junit', version: '4.12' testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version } diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index 791c5380..c6fb0b5c 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -60,7 +60,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val projectComponentManager = environment.project as MockComponentManager val projectFileIndex = CoreProjectFileIndex(environment.project, - environment.configuration.getList(CommonConfigurationKeys.CONTENT_ROOTS)) + environment.configuration.getList(JVMConfigurationKeys.CONTENT_ROOTS)) val moduleManager = object : CoreModuleManager(environment.project, this) { override fun getModules(): Array<out Module> = arrayOf(projectFileIndex.module) @@ -127,7 +127,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { * List of source roots for this environment. */ val sources: List<String> - get() = configuration.get(CommonConfigurationKeys.CONTENT_ROOTS) + get() = configuration.get(JVMConfigurationKeys.CONTENT_ROOTS) ?.filterIsInstance<KotlinSourceRoot>() ?.map { it.path } ?: emptyList() @@ -146,7 +146,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { } fun addRoots(list: List<ContentRoot>) { - configuration.addAll(CommonConfigurationKeys.CONTENT_ROOTS, list) + configuration.addAll(JVMConfigurationKeys.CONTENT_ROOTS, list) } /** @@ -186,7 +186,7 @@ class DokkaResolutionFacade(override val project: Project, } override fun <T : Any> getFrontendService(moduleDescriptor: ModuleDescriptor, serviceClass: Class<T>): T { - throw UnsupportedOperationException() + return resolverForModule.componentProvider.getService(serviceClass) } override fun <T : Any> getIdeService(serviceClass: Class<T>): T { diff --git a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt index 3834dbf8..4c46f7d6 100644 --- a/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt +++ b/core/src/main/kotlin/Kotlin/DeclarationLinkResolver.kt @@ -17,7 +17,8 @@ class DeclarationLinkResolver val options: DocumentationOptions) { fun resolveContentLink(fromDescriptor: DeclarationDescriptor, href: String): ContentBlock { val symbol = try { - val symbols = resolveKDocLink(resolutionFacade, fromDescriptor, null, href.split('.').toList()) + val symbols = resolveKDocLink(resolutionFacade.resolveSession.bindingContext, + resolutionFacade, fromDescriptor, null, href.split('.').toList()) findTargetSymbol(symbols) } catch(e: Exception) { null diff --git a/core/src/main/kotlin/main.kt b/core/src/main/kotlin/main.kt index 30a33a96..22859187 100644 --- a/core/src/main/kotlin/main.kt +++ b/core/src/main/kotlin/main.kt @@ -17,7 +17,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.common.messages.MessageRenderer import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot -import org.jetbrains.kotlin.config.CommonConfigurationKeys +import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzerForTopLevel import org.jetbrains.kotlin.resolve.TopDownAnalysisMode import org.jetbrains.kotlin.utils.PathUtil @@ -136,9 +136,16 @@ object DokkaConsoleLogger: DokkaLogger { } class DokkaMessageCollector(val logger: DokkaLogger): MessageCollector { + private var seenErrors = false + override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation) { + if (severity == CompilerMessageSeverity.ERROR) { + seenErrors = true + } logger.error(MessageRenderer.PLAIN_FULL_PATHS.render(severity, message, location)) } + + override fun hasErrors() = seenErrors } class DokkaGenerator(val logger: DokkaLogger, @@ -242,7 +249,7 @@ fun buildDocumentationModule(injector: Injector, fun KotlinCoreEnvironment.getJavaSourceFiles(): List<PsiJavaFile> { - val sourceRoots = configuration.get(CommonConfigurationKeys.CONTENT_ROOTS) + val sourceRoots = configuration.get(JVMConfigurationKeys.CONTENT_ROOTS) ?.filterIsInstance<JavaSourceRoot>() ?.map { it.file } ?: listOf() diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index 508b490a..e13a61f8 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -37,6 +37,8 @@ fun verifyModel(vararg roots: ContentRoot, } } } + + override fun hasErrors() = false } val environment = AnalysisEnvironment(messageCollector) diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index 864fb9d1..496972a6 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -218,6 +218,10 @@ class MarkdownFormatTest { verifyMarkdownNodeByName("backtickInCodeBlock", "foo") } + @Test fun qualifiedNameLink() { + verifyMarkdownNodeByName("qualifiedNameLink", "foo", withKotlinRuntime = true) + } + private fun verifyMarkdownPackage(fileName: String, withKotlinRuntime: Boolean = false) { verifyOutput("testdata/format/$fileName.kt", ".package.md", withKotlinRuntime = withKotlinRuntime) { model, output -> markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members) @@ -244,8 +248,8 @@ class MarkdownFormatTest { } } - private fun verifyMarkdownNodeByName(fileName: String, name: String) { - verifyMarkdownNodes(fileName) { model-> + private fun verifyMarkdownNodeByName(fileName: String, name: String, withKotlinRuntime: Boolean = false) { + verifyMarkdownNodes(fileName, withKotlinRuntime) { model-> val nodesWithName = model.members.single().members.filter { it.name == name } if (nodesWithName.isEmpty()) { throw IllegalArgumentException("Found no nodes named $name") diff --git a/core/testdata/format/qualifiedNameLink.kt b/core/testdata/format/qualifiedNameLink.kt new file mode 100644 index 00000000..be82a990 --- /dev/null +++ b/core/testdata/format/qualifiedNameLink.kt @@ -0,0 +1,6 @@ +/** + * See [kotlin.apply] for the docs + */ +fun foo() { + +}
\ No newline at end of file diff --git a/core/testdata/format/qualifiedNameLink.md b/core/testdata/format/qualifiedNameLink.md new file mode 100644 index 00000000..590bb435 --- /dev/null +++ b/core/testdata/format/qualifiedNameLink.md @@ -0,0 +1,8 @@ +[test](test/index) / [foo](test/foo) + +# foo + +`fun foo(): Unit` + +See [kotlin.apply](#) for the docs + diff --git a/dokka-android-gradle-plugin/build.gradle b/dokka-android-gradle-plugin/build.gradle index 4e4a204f..0b412e02 100644 --- a/dokka-android-gradle-plugin/build.gradle +++ b/dokka-android-gradle-plugin/build.gradle @@ -2,13 +2,6 @@ group 'org.jetbrains.dokka' version dokka_version buildscript { - repositories { - mavenCentral() - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } - } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' @@ -22,14 +15,6 @@ apply plugin: 'com.jfrog.bintray' sourceCompatibility = 1.6 -repositories { - mavenCentral() - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } -} - dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' compile project(':core') diff --git a/dokka-gradle-plugin/build.gradle b/dokka-gradle-plugin/build.gradle index f603dcc7..76bf4e4d 100644 --- a/dokka-gradle-plugin/build.gradle +++ b/dokka-gradle-plugin/build.gradle @@ -2,13 +2,6 @@ group 'org.jetbrains.dokka' version dokka_version buildscript { - repositories { - mavenCentral() - jcenter() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } - } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' @@ -22,13 +15,6 @@ apply plugin: 'com.jfrog.bintray' sourceCompatibility = 1.6 -repositories { - mavenCentral() - maven { - url "https://dl.bintray.com/kotlin/kotlin-eap" - } -} - dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' compile project(':core') diff --git a/lib/kotlin-compiler.jar b/lib/kotlin-compiler.jar Binary files differindex a7bf55c8..4f113d83 100644 --- a/lib/kotlin-compiler.jar +++ b/lib/kotlin-compiler.jar diff --git a/lib/kotlin-ide-common.jar b/lib/kotlin-ide-common.jar Binary files differindex 371a75d4..0eddde68 100644 --- a/lib/kotlin-ide-common.jar +++ b/lib/kotlin-ide-common.jar |