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. --- integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'integration') 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 { -- cgit From ac00e0375473a5de711f7866cb17ea5c82f4e7a5 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 14 Nov 2017 13:32:46 +0300 Subject: Fix bundling of kotlin-runtime & reflect into Gradle plugin Fix #219 --- integration/build.gradle | 8 +++++--- runners/gradle-plugin/build.gradle | 7 +------ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'integration') diff --git a/integration/build.gradle b/integration/build.gradle index 55ac9dca..571ad0b3 100644 --- a/integration/build.gradle +++ b/integration/build.gradle @@ -7,7 +7,9 @@ buildscript { apply plugin: 'kotlin' dependencies { - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_for_gradle_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_version - compile 'com.github.yole:jkid:7d9c529c87' + compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_version + compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_version + compile('com.github.yole:jkid:7d9c529c87') { + transitive = false + } } \ No newline at end of file diff --git a/runners/gradle-plugin/build.gradle b/runners/gradle-plugin/build.gradle index fff58092..21603a26 100644 --- a/runners/gradle-plugin/build.gradle +++ b/runners/gradle-plugin/build.gradle @@ -6,18 +6,13 @@ sourceCompatibility = 1.8 apply plugin: 'com.github.johnrengelman.shadow' apply plugin: "com.gradle.plugin-publish" -tasks.withType(AbstractCompile) { - classpath += configurations.shadow -} - compileKotlin { - kotlinOptions { freeCompilerArgs += "-Xjsr305-annotations=strict" } - } + dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' -- cgit From f94beaa25f07333ad47738d5d7fafdd3dd302b04 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 14 Nov 2017 16:19:46 +0300 Subject: Clarify Kotlin Versions and config in project --- build.gradle | 4 ++-- core/build.gradle | 26 +++++++++++++++++--------- gradle.properties | 7 +++---- integration/build.gradle | 17 ++++++++++++++--- runners/android-gradle-plugin/build.gradle | 12 +++++++++--- runners/ant/build.gradle | 11 ++++++++++- runners/build.gradle | 12 ++---------- runners/cli/build.gradle | 10 +++++++++- runners/fatjar/build.gradle | 2 +- runners/gradle-integration-tests/build.gradle | 16 +++++++++++++--- runners/gradle-plugin/build.gradle | 13 ++++++++----- runners/maven-plugin/build.gradle | 15 ++++++++++----- 12 files changed, 98 insertions(+), 47 deletions(-) (limited to 'integration') diff --git a/build.gradle b/build.gradle index e64427b7..0002ee69 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ allprojects { maven { url "http://dl.bintray.com/kotlin/kotlin-eap" } maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } maven { url 'https://jitpack.io' } - maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$kotlin_compiler_version/maven" } + maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$bundled_kotlin_compiler_version/maven" } ivy(repo) } } @@ -67,7 +67,7 @@ task wrapper(type: Wrapper) { distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } -def versions = DependenciesVersionGetter.getVersions(project, kotlin_compiler_version) +def versions = DependenciesVersionGetter.getVersions(project, bundled_kotlin_compiler_version) ext.ideaVersion = versions["idea.build.id"] diff --git a/core/build.gradle b/core/build.gradle index 68d3da89..a8f0f275 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -2,26 +2,34 @@ import javax.tools.ToolProvider buildscript { dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_compiler_to_compile_core_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } apply plugin: 'kotlin' -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + languageVersion = "1.2" + apiVersion = languageVersion + jvmTarget = "1.8" + } +} dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_compiler_version" - compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_compiler_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:$bundled_kotlin_compiler_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$bundled_kotlin_compiler_version" compile group: 'com.google.inject', name: 'guice', version: '3.0' compile "org.jsoup:jsoup:1.8.3" - compile "org.jetbrains.kotlin:kotlin-compiler:$kotlin_compiler_version" - compile "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_compiler_version" + compile "org.jetbrains.kotlin:kotlin-compiler:$bundled_kotlin_compiler_version" + compile "org.jetbrains.kotlin:kotlin-script-runtime:$bundled_kotlin_compiler_version" - compile "teamcity:kotlin-ide-common:$kotlin_compiler_version" - compile "teamcity:markdown:$kotlin_compiler_version" + compile "teamcity:kotlin-ide-common:$bundled_kotlin_compiler_version" + compile "teamcity:markdown:$bundled_kotlin_compiler_version" compile intellijCoreAnalysis() @@ -33,7 +41,7 @@ dependencies { compile project(":integration") testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_compiler_to_compile_core_version + testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0" testCompile ideaRT() diff --git a/gradle.properties b/gradle.properties index 154d7776..d109426b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,10 +2,9 @@ dokka_version=0.9.16 dokka_publication_channel=dokka #Kotlin compiler and plugin -kotlin_version=1.1.51 -kotlin_compiler_version=1.2.20-dev-175 -kotlin_compiler_to_compile_core_version=1.2.0-rc-39 -kotlin_for_gradle_version=1.0.7 +bundled_kotlin_compiler_version=1.2.20-dev-175 +kotlin_version=1.2.0-rc-39 +kotlin_for_gradle_runtime_version=1.0.7 #IntelliJ plugin to download openapi.jar gradle_intellij_plugin_version=0.3.0-SNAPSHOT diff --git a/integration/build.gradle b/integration/build.gradle index 571ad0b3..32ca3454 100644 --- a/integration/build.gradle +++ b/integration/build.gradle @@ -1,14 +1,25 @@ buildscript { dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_for_gradle_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } apply plugin: 'kotlin' + +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + languageVersion = "1.2" + apiVersion = "1.0" + jvmTarget = "1.8" + } +} + dependencies { - compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_version - compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_version + compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_runtime_version + compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_runtime_version compile('com.github.yole:jkid:7d9c529c87') { transitive = false } diff --git a/runners/android-gradle-plugin/build.gradle b/runners/android-gradle-plugin/build.gradle index 193b8eee..5050fd87 100644 --- a/runners/android-gradle-plugin/build.gradle +++ b/runners/android-gradle-plugin/build.gradle @@ -3,13 +3,19 @@ import org.jetbrains.CorrectShadowPublishing apply plugin: 'java' apply plugin: 'kotlin' -sourceCompatibility = 1.8 apply plugin: 'com.github.johnrengelman.shadow' apply plugin: "com.gradle.plugin-publish" -tasks.withType(AbstractCompile) { - classpath += configurations.shadow +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = "1.2" + apiVersion = "1.0" + jvmTarget = "1.8" + } } repositories { diff --git a/runners/ant/build.gradle b/runners/ant/build.gradle index 85328d95..e7dcd441 100644 --- a/runners/ant/build.gradle +++ b/runners/ant/build.gradle @@ -1,6 +1,15 @@ apply plugin: 'kotlin' -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = "1.2" + apiVersion = languageVersion + jvmTarget = "1.8" + } +} dependencies { compile project(":core") diff --git a/runners/build.gradle b/runners/build.gradle index f1d2873c..23d232d2 100644 --- a/runners/build.gradle +++ b/runners/build.gradle @@ -1,15 +1,7 @@ -configure([project("ant"), project("cli"), project("fatjar"), project("maven-plugin")]) { +subprojects { buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } -} - -configure([project("gradle-plugin"), project("android-gradle-plugin"), project("gradle-integration-tests")]) { - buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_for_gradle_version" - } - } -} +} \ No newline at end of file diff --git a/runners/cli/build.gradle b/runners/cli/build.gradle index 13b0c941..7f733140 100644 --- a/runners/cli/build.gradle +++ b/runners/cli/build.gradle @@ -1,6 +1,14 @@ apply plugin: 'kotlin' -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + languageVersion = "1.2" + apiVersion = languageVersion + jvmTarget = "1.8" + } +} dependencies { compile project(":core") diff --git a/runners/fatjar/build.gradle b/runners/fatjar/build.gradle index fc9abeda..4ce0416c 100644 --- a/runners/fatjar/build.gradle +++ b/runners/fatjar/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer import org.jetbrains.PluginXmlTransformer -apply plugin: 'kotlin' +apply plugin: 'java' apply plugin: 'com.github.johnrengelman.shadow' dependencies { diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle index f807c12b..1809589f 100644 --- a/runners/gradle-integration-tests/build.gradle +++ b/runners/gradle-integration-tests/build.gradle @@ -2,6 +2,16 @@ apply plugin: 'kotlin' +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = "1.2" + apiVersion = "1.0" + jvmTarget = "1.8" + } +} configurations { dokkaPlugin @@ -11,9 +21,9 @@ configurations { dependencies { - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_for_gradle_version - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_version - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test', version: kotlin_for_gradle_version + testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_for_gradle_runtime_version + testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_runtime_version + testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test', version: kotlin_for_gradle_runtime_version testCompile ideaRT() dokkaPlugin project(path: ':runners:gradle-plugin', configuration: 'shadow') diff --git a/runners/gradle-plugin/build.gradle b/runners/gradle-plugin/build.gradle index 21603a26..790f3132 100644 --- a/runners/gradle-plugin/build.gradle +++ b/runners/gradle-plugin/build.gradle @@ -1,23 +1,26 @@ apply plugin: 'java' apply plugin: 'kotlin' -sourceCompatibility = 1.8 apply plugin: 'com.github.johnrengelman.shadow' apply plugin: "com.gradle.plugin-publish" +sourceCompatibility = 1.8 -compileKotlin { +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { - freeCompilerArgs += "-Xjsr305-annotations=strict" + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = "1.2" + apiVersion = "1.0" + jvmTarget = "1.8" } } dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' - shadow group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_for_gradle_version - shadow group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_version + shadow group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_runtime_version + shadow group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_runtime_version compile project(":integration") diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle index a9a77a8b..0e8d6a4d 100644 --- a/runners/maven-plugin/build.gradle +++ b/runners/maven-plugin/build.gradle @@ -1,17 +1,22 @@ import groovy.io.FileType import org.jetbrains.CrossPlatformExec -import shadow.org.apache.commons.io.FileUtils -import java.nio.file.FileVisitResult import java.nio.file.Files -import java.nio.file.Paths import java.nio.file.StandardCopyOption -import java.nio.file.attribute.BasicFileAttributes - apply plugin: 'kotlin' apply plugin: 'com.github.johnrengelman.shadow' +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = "1.2" + apiVersion = languageVersion + jvmTarget = "1.8" + } +} dependencies { shadow project(":runners:fatjar") -- 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 'integration') 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 56213b9d66a78fdd35c2826c6edc3f36d491ff32 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 29 Jan 2018 19:53:23 +0300 Subject: Update Gradle Kotlin Runtime dependencies version to 1.1 Dokka drops support for Gradle less then 3.5 --- gradle.properties | 2 +- integration/build.gradle | 2 +- integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt | 2 ++ runners/android-gradle-plugin/build.gradle | 2 +- runners/gradle-integration-tests/build.gradle | 3 +-- .../src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt | 5 +++++ .../kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt | 4 ++++ .../src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt | 3 +++ .../kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt | 4 ++++ .../kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt | 3 +++ .../org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt | 5 +++++ runners/gradle-plugin/build.gradle | 2 +- 12 files changed, 31 insertions(+), 6 deletions(-) (limited to 'integration') diff --git a/gradle.properties b/gradle.properties index 6b9383bf..4a6475b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ dokka_publication_channel=dokka #Kotlin compiler and plugin bundled_kotlin_compiler_version=1.2.20-dev-419 kotlin_version=1.2.0 -kotlin_for_gradle_runtime_version=1.0.7 +kotlin_for_gradle_runtime_version=1.1.60 ant_version=1.9.6 diff --git a/integration/build.gradle b/integration/build.gradle index 32ca3454..026cfbc0 100644 --- a/integration/build.gradle +++ b/integration/build.gradle @@ -12,7 +12,7 @@ sourceCompatibility = 1.8 tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { languageVersion = "1.2" - apiVersion = "1.0" + apiVersion = "1.1" jvmTarget = "1.8" } } diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt b/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt index 3c9bf156..1984a3e5 100644 --- a/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt +++ b/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka import kotlin.reflect.* +import kotlin.reflect.full.memberFunctions +import kotlin.reflect.full.memberProperties import kotlin.reflect.jvm.isAccessible object ReflectDsl { diff --git a/runners/android-gradle-plugin/build.gradle b/runners/android-gradle-plugin/build.gradle index 5050fd87..7d286cc7 100644 --- a/runners/android-gradle-plugin/build.gradle +++ b/runners/android-gradle-plugin/build.gradle @@ -13,7 +13,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { freeCompilerArgs += "-Xjsr305=strict" languageVersion = "1.2" - apiVersion = "1.0" + apiVersion = "1.1" jvmTarget = "1.8" } } diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle index 1809589f..cb734db3 100644 --- a/runners/gradle-integration-tests/build.gradle +++ b/runners/gradle-integration-tests/build.gradle @@ -21,8 +21,7 @@ configurations { dependencies { - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: kotlin_for_gradle_runtime_version - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_runtime_version + testCompileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_runtime_version testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test', version: kotlin_for_gradle_runtime_version testCompile ideaRT() diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt index ba70479f..bbb63909 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt @@ -17,4 +17,9 @@ class AndroidAppTest : AbstractAndroidAppTest("androidApp") { fun `test kotlin 1_0_7 and gradle 2_14_1 and abt 2_2_3`() { doTest("2.14.1", "1.0.7", AndroidPluginParams("2.2.3", "25.0.0", 24)) } + + @Test + fun `test kotlin 1_2_20 and gradle 4_5 and abt 3_0_1`() { + doTest("4.5", "1.2.20", AndroidPluginParams("3.0.1", "27.0.0", 27)) + } } \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt index 28328af8..ef1b94d8 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt @@ -53,4 +53,8 @@ class AndroidMultiFlavourAppTest : AbstractDokkaAndroidGradleTest() { doTest("2.14.1", "1.0.7", AndroidPluginParams("2.2.3", "25.0.0", 24)) } + @Test fun `test kotlin 1_2_20 and gradle 4_5 and abt 3_0_1`() { + doTest("4.5", "1.2.20", AndroidPluginParams("3.0.1", "27.0.0", 27)) + } + } \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt index b1364004..ebaf1653 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt @@ -49,4 +49,7 @@ class BasicTest : AbstractDokkaGradleTest() { doTest("4.0", "1.1.2") } + @Test fun `test kotlin 1_2_20 and gradle 4_5`() { + doTest("4.5", "1.2.20") + } } \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt index 511a033c..3a4d08b8 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt @@ -17,4 +17,8 @@ class JavadocRSuppressionTest : AbstractAndroidAppTest("androidAppJavadoc") { fun `test kotlin 1_0_7 and gradle 2_14_1 and abt 2_2_3`() { doTest("2.14.1", "1.0.7", AndroidPluginParams("2.2.3", "25.0.0", 24)) } + + @Test fun `test kotlin 1_2_20 and gradle 4_5 and abt 3_0_1`() { + doTest("4.5", "1.2.20", AndroidPluginParams("3.0.1", "27.0.0", 27)) + } } \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt index 13c7c37e..9458528c 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt @@ -51,4 +51,7 @@ class MultiProjectSingleOutTest : AbstractDokkaGradleTest() { doTest("4.0", "1.1.2") } + @Test fun `test kotlin 1_2_20 and gradle 4_5`() { + doTest("4.5", "1.2.20") + } } \ No newline at end of file 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 index 42e79696..f712998c 100644 --- 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 @@ -66,4 +66,9 @@ class RebuildAfterSourceChangeTest : AbstractDokkaGradleTest() { fun `test kotlin 1_1_2 and gradle 4_0`() { doTest("4.0", "1.1.2") } + + @Test + fun `test kotlin 1_2_20 and gradle 4_5`() { + doTest("4.5", "1.2.20") + } } \ No newline at end of file diff --git a/runners/gradle-plugin/build.gradle b/runners/gradle-plugin/build.gradle index 790f3132..d3dbae22 100644 --- a/runners/gradle-plugin/build.gradle +++ b/runners/gradle-plugin/build.gradle @@ -11,7 +11,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { freeCompilerArgs += "-Xjsr305=strict" languageVersion = "1.2" - apiVersion = "1.0" + apiVersion = "1.1" jvmTarget = "1.8" } } -- cgit From 6fa36fde9628685c274fd6af0aebc467e76c79e9 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 31 Jan 2018 00:49:52 +0300 Subject: Update jkid --- integration/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'integration') diff --git a/integration/build.gradle b/integration/build.gradle index 026cfbc0..24d59edf 100644 --- a/integration/build.gradle +++ b/integration/build.gradle @@ -20,7 +20,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { dependencies { compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_for_gradle_runtime_version compileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_for_gradle_runtime_version - compile('com.github.yole:jkid:7d9c529c87') { + compile('com.github.yole:jkid:8fc7f12e1a') { transitive = false } } \ No newline at end of file -- cgit