From 05d613daf13d7a0866b65ed555544b62e8197547 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 31 Oct 2017 18:51:45 +0300 Subject: Fix android-sdk license accepting on TeamCity --- .../android-licenses/android-sdk-license | 2 + .../android-licenses/android-sdk-preview-license | 2 + runners/gradle-integration-tests/build.gradle | 6 ++- .../dokka/gradle/AbstractDokkaAndroidGradleTest.kt | 43 ++++++++++++++++++++++ .../org/jetbrains/dokka/gradle/AndroidAppTest.kt | 3 +- .../dokka/gradle/AndroidMultiFlavourAppTest.kt | 2 +- 6 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 runners/gradle-integration-tests/android-licenses/android-sdk-license create mode 100644 runners/gradle-integration-tests/android-licenses/android-sdk-preview-license create mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt (limited to 'runners/gradle-integration-tests') diff --git a/runners/gradle-integration-tests/android-licenses/android-sdk-license b/runners/gradle-integration-tests/android-licenses/android-sdk-license new file mode 100644 index 00000000..c311cf48 --- /dev/null +++ b/runners/gradle-integration-tests/android-licenses/android-sdk-license @@ -0,0 +1,2 @@ + +d56f5187479451eabf01fb78af6dfcb131a6481e \ No newline at end of file diff --git a/runners/gradle-integration-tests/android-licenses/android-sdk-preview-license b/runners/gradle-integration-tests/android-licenses/android-sdk-preview-license new file mode 100644 index 00000000..da4552d2 --- /dev/null +++ b/runners/gradle-integration-tests/android-licenses/android-sdk-preview-license @@ -0,0 +1,2 @@ + +84831b9409646a918e30573bab4c9c91346d8abd \ No newline at end of file diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle index 179b6455..1b4ff5ed 100644 --- a/runners/gradle-integration-tests/build.gradle +++ b/runners/gradle-integration-tests/build.gradle @@ -42,4 +42,8 @@ task createClasspathManifest { createClasspathManifest.mustRunAfter project(":runners:fatjar").shadowJar testClasses.dependsOn project(":runners:fatjar").shadowJar -testClasses.dependsOn createClasspathManifest \ No newline at end of file +testClasses.dependsOn createClasspathManifest + +test { + systemProperty "android.licenses.overwrite", project.findProperty("android.licenses.overwrite") ?: "" +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt new file mode 100644 index 00000000..52aa4f15 --- /dev/null +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt @@ -0,0 +1,43 @@ +package org.jetbrains.dokka.gradle + +import org.junit.BeforeClass +import java.io.File + +abstract class AbstractDokkaAndroidGradleTest : AbstractDokkaGradleTest() { + + companion object { + + @JvmStatic + @BeforeClass + fun acceptAndroidSdkLicenses() { + val sdkDir = androidLocalProperties?.toFile()?.let { + val lines = it.readLines().map { it.trim() } + val sdkDirLine = lines.firstOrNull { "sdk.dir" in it } + sdkDirLine?.substringAfter("=")?.trim() + } ?: System.getenv("ANDROID_HOME") + + if (sdkDir == null || sdkDir.isEmpty()) { + error("Android SDK home not set, " + + "try setting \$ANDROID_HOME " + + "or sdk.dir in runners/gradle-integration-tests/testData/android.local.properties") + } + val sdkDirFile = File(sdkDir) + if (!sdkDirFile.exists()) error("\$ANDROID_HOME and android.local.properties points to non-existing location") + val sdkLicensesDir = sdkDirFile.resolve("licenses") + + val acceptedLicenses = File("android-licenses") + acceptedLicenses.listFiles().forEach { licenseFile -> + val target = sdkLicensesDir.resolve(licenseFile.name) + if(!target.exists() || target.readText() != licenseFile.readText()) { + val overwrite = System.getProperty("android.licenses.overwrite", "false").toBoolean() + if (!target.exists() || overwrite) { + licenseFile.copyTo(target, true) + println("Accepted ${licenseFile.name}, by copying $licenseFile to $target") + } + } + + } + } + + } +} \ No newline at end of file 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 de22a980..1975d6e2 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 @@ -3,10 +3,9 @@ package org.jetbrains.dokka.gradle import org.gradle.testkit.runner.TaskOutcome import org.junit.Test import java.io.File -import java.nio.file.Files import kotlin.test.assertEquals -class AndroidAppTest : AbstractDokkaGradleTest() { +class AndroidAppTest : AbstractDokkaAndroidGradleTest() { override val pluginClasspath: List = androidPluginClasspathData.toFile().readLines().map { File(it) } fun prepareTestData(testDataRootPath: String) { 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 aee0e14c..0a9b2427 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 @@ -6,7 +6,7 @@ import org.junit.Test import java.io.File import kotlin.test.assertEquals -class AndroidMultiFlavourAppTest : AbstractDokkaGradleTest() { +class AndroidMultiFlavourAppTest : AbstractDokkaAndroidGradleTest() { override val pluginClasspath: List = androidPluginClasspathData.toFile().readLines().map { File(it) } fun prepareTestData(testDataRootPath: String) { -- 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-integration-tests') 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 ce7ebd213a56abd2be6beacbef26b339935baeb6 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 3 Nov 2017 21:30:01 +0300 Subject: Fix not suppressing Android generated files in javadoc format fixes #224, fixes #197 --- .../kotlin/Java/JavaPsiDocumentationBuilder.kt | 9 +++- .../dokka/gradle/AbstractAndroidAppTest.kt | 51 ++++++++++++++++++ .../dokka/gradle/AbstractDokkaAndroidGradleTest.kt | 2 + .../org/jetbrains/dokka/gradle/AndroidAppTest.kt | 59 +++------------------ .../dokka/gradle/AndroidMultiFlavourAppTest.kt | 4 +- .../dokka/gradle/JavadocRSuppressionTest.kt | 20 +++++++ .../testData/androidAppJavadoc/app/build.gradle | 50 +++++++++++++++++ .../app/src/main/AndroidManifest.xml | 26 +++++++++ .../org/example/kotlin/mixed/JavaActivity.java | 34 ++++++++++++ .../org/example/kotlin/mixed/KotlinActivity.kt | 28 ++++++++++ .../app/src/main/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 9397 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 5237 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 14383 bytes .../app/src/main/res/layout/activity_main.xml | 24 +++++++++ .../app/src/main/res/layout/activity_main2.xml | 24 +++++++++ .../app/src/main/res/menu/main.xml | 6 +++ .../app/src/main/res/menu/main_activity2.xml | 6 +++ .../app/src/main/res/values/dimens.xml | 5 ++ .../app/src/main/res/values/strings.xml | 10 ++++ .../app/src/main/res/values/styles.xml | 20 +++++++ .../testData/androidAppJavadoc/build.gradle | 21 ++++++++ .../testData/androidAppJavadoc/fileTree.txt | 21 ++++++++ .../testData/androidAppJavadoc/settings.gradle | 3 ++ 23 files changed, 367 insertions(+), 56 deletions(-) create mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt create mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt create mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle (limited to 'runners/gradle-integration-tests') diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index a950e432..6b1f8cb4 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.kdoc.psi.impl.KDocTag import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.KtDeclaration import org.jetbrains.kotlin.psi.KtModifierListOwner +import java.io.File fun getSignature(element: PsiElement?) = when(element) { is PsiClass -> element.qualifiedName @@ -131,7 +132,10 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { } } - private fun skipElement(element: Any) = skipElementByVisibility(element) || hasSuppressDocTag(element) + private fun skipElement(element: Any) = + skipElementByVisibility(element) || + hasSuppressDocTag(element) || + skipElementBySuppressedFiles(element) private fun skipElementByVisibility(element: Any): Boolean = element is PsiModifierListOwner && !(options.effectivePackageOptions((element.containingFile as? PsiJavaFile)?.packageName ?: "").includeNonPublic) && @@ -139,6 +143,9 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { element.hasModifierProperty(PsiModifier.PACKAGE_LOCAL) || element.isInternal()) + private fun skipElementBySuppressedFiles(element: Any): Boolean = + element is PsiElement && File(element.containingFile.virtualFile.path).absoluteFile in options.suppressedFiles + private fun PsiElement.isInternal(): Boolean { val ktElement = (this as? KtLightElement<*, *>)?.kotlinOrigin ?: return false return (ktElement as? KtModifierListOwner)?.hasModifier(KtTokens.INTERNAL_KEYWORD) ?: false diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt new file mode 100644 index 00000000..c3fe2ea9 --- /dev/null +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt @@ -0,0 +1,51 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import kotlin.test.assertEquals + +abstract class AbstractAndroidAppTest(val testDataRootPath: String) : AbstractDokkaAndroidGradleTest() { + + fun prepareTestData() { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + val tmpRoot = testProjectDir.root.toPath() + + testDataRoot.resolve("app").copy(tmpRoot.resolve("app")) + testDataRoot.resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) + testDataRoot.resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) + + androidLocalProperties?.copy(tmpRoot.resolve("local.properties")) + } + + + data class AndroidPluginParams(val pluginVersion: String, val buildToolsVersion: String, val compileSdk: Int) { + fun asArguments(): List = listOf( + "-Pabt_plugin_version=$pluginVersion", + "-Pabt_version=$buildToolsVersion", + "-Psdk_version=$compileSdk" + ) + } + + + protected fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AndroidPluginParams) { + prepareTestData() + + val result = configure(gradleVersion, kotlinVersion, + arguments = arrayOf("dokka", "--stacktrace") + androidPluginParams.asArguments()) + .build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokka")?.outcome) + + val docsOutput = "app/build/dokka" + + checkOutputStructure("$testDataRootPath/fileTree.txt", docsOutput) + + checkNoErrorClasses(docsOutput) + checkNoUnresolvedLinks(docsOutput) + + checkExternalLink(docsOutput, "Activity", + """Activity""") + } + +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt index 52aa4f15..06753342 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt @@ -5,6 +5,8 @@ import java.io.File abstract class AbstractDokkaAndroidGradleTest : AbstractDokkaGradleTest() { + override val pluginClasspath: List = androidPluginClasspathData.toFile().readLines().map { File(it) } + companion object { @JvmStatic 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 1975d6e2..ba70479f 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 @@ -1,65 +1,20 @@ package org.jetbrains.dokka.gradle -import org.gradle.testkit.runner.TaskOutcome import org.junit.Test -import java.io.File -import kotlin.test.assertEquals -class AndroidAppTest : AbstractDokkaAndroidGradleTest() { - override val pluginClasspath: List = androidPluginClasspathData.toFile().readLines().map { File(it) } - - fun prepareTestData(testDataRootPath: String) { - val testDataRoot = testDataFolder.resolve(testDataRootPath) - val tmpRoot = testProjectDir.root.toPath() - - testDataRoot.resolve("app").copy(tmpRoot.resolve("app")) - testDataRoot.resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) - testDataRoot.resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) - - androidLocalProperties?.copy(tmpRoot.resolve("local.properties")) - } - - - data class AndroidPluginParams(val pluginVersion: String, val buildToolsVersion: String, val compileSdk: Int) { - fun asArguments(): List = listOf( - "-Pabt_plugin_version=$pluginVersion", - "-Pabt_version=$buildToolsVersion", - "-Psdk_version=$compileSdk" - ) - } - - - private fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AndroidPluginParams) { - prepareTestData("androidApp") - - val result = configure(gradleVersion, kotlinVersion, - arguments = arrayOf("dokka", "--stacktrace") + androidPluginParams.asArguments()) - .build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokka")?.outcome) - - val docsOutput = "app/build/dokka" - - checkOutputStructure("androidApp/fileTree.txt", docsOutput) - - checkNoErrorClasses(docsOutput) - checkNoUnresolvedLinks(docsOutput) - - checkExternalLink(docsOutput, "Activity", - """Activity""") - } - - @Test fun `test kotlin 1_1_2-5 and gradle 4_0 and abt 3_0_0-alpha3`() { +class AndroidAppTest : AbstractAndroidAppTest("androidApp") { + @Test + fun `test kotlin 1_1_2-5 and gradle 4_0 and abt 3_0_0-alpha3`() { doTest("4.0", "1.1.2-5", AndroidPluginParams("3.0.0-alpha3", "25.0.2", 25)) } - @Test fun `test kotlin 1_1_2 and gradle 3_5 and abt 2_3_0`() { + @Test + fun `test kotlin 1_1_2 and gradle 3_5 and abt 2_3_0`() { doTest("3.5", "1.1.2", AndroidPluginParams("2.3.0", "25.0.0", 24)) } - @Test fun `test kotlin 1_0_7 and gradle 2_14_1 and abt 2_2_3`() { + @Test + 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)) } } \ 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 0a9b2427..28328af8 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 @@ -1,13 +1,11 @@ package org.jetbrains.dokka.gradle import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.dokka.gradle.AndroidAppTest.AndroidPluginParams +import org.jetbrains.dokka.gradle.AbstractAndroidAppTest.AndroidPluginParams import org.junit.Test -import java.io.File import kotlin.test.assertEquals class AndroidMultiFlavourAppTest : AbstractDokkaAndroidGradleTest() { - override val pluginClasspath: List = androidPluginClasspathData.toFile().readLines().map { File(it) } fun prepareTestData(testDataRootPath: String) { val testDataRoot = testDataFolder.resolve(testDataRootPath) 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 new file mode 100644 index 00000000..511a033c --- /dev/null +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt @@ -0,0 +1,20 @@ +package org.jetbrains.dokka.gradle + +import org.junit.Test + +class JavadocRSuppressionTest : AbstractAndroidAppTest("androidAppJavadoc") { + @Test + fun `test kotlin 1_1_2-5 and gradle 4_0 and abt 3_0_0-alpha3`() { + doTest("4.0", "1.1.2-5", AndroidPluginParams("3.0.0-alpha3", "25.0.2", 25)) + } + + @Test + fun `test kotlin 1_1_2 and gradle 3_5 and abt 2_3_0`() { + doTest("3.5", "1.1.2", AndroidPluginParams("2.3.0", "25.0.0", 24)) + } + + @Test + 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)) + } +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle new file mode 100644 index 00000000..6a053a5e --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle @@ -0,0 +1,50 @@ +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka-android' +} + + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'org.jetbrains.dokka-android' + +android { + compileSdkVersion Integer.parseInt(sdk_version) + buildToolsVersion abt_version + + defaultConfig { + applicationId "org.example.kotlin.mixed" + minSdkVersion 14 + targetSdkVersion Integer.parseInt(sdk_version) + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt') + } + } + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" +} + + +dokka { + outputFormat = "javadoc" + dokkaFatJar = new File(dokka_fatjar) +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java new file mode 100644 index 00000000..3668c594 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java @@ -0,0 +1,34 @@ +package org.example.kotlin.mixed; + +import android.content.Intent; +import android.os.Bundle; +import android.app.Activity; +import android.view.Menu; +import android.view.View; +import android.widget.Button; + +public class JavaActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Button next = (Button) findViewById(R.id.Button01); + next.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), KotlinActivity.class); + startActivityForResult(myIntent, 0); + } + }); + } + + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.main, menu); + return true; + } + +} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt new file mode 100644 index 00000000..ca2f27b0 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt @@ -0,0 +1,28 @@ +package org.example.kotlin.mixed + +import android.content.Intent +import android.os.Bundle +import android.app.Activity +import android.view.Menu +import android.widget.Button + +class KotlinActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main2) + + val next = findViewById(R.id.Button02) as Button + next.setOnClickListener { + val intent: Intent = Intent() + setResult(RESULT_OK, intent) + finish() + } + } + + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + // Inflate the menu; this adds items to the action bar if it is present. + menuInflater.inflate(R.menu.main_activity2, menu) + return true + } +} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..96a442e5 Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..359047df Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..71c6d760 Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml @@ -0,0 +1,10 @@ + + + + AndroidSample + Settings + Hello world! + JavaActivity + KotlinActivity + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle new file mode 100644 index 00000000..59477b52 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle @@ -0,0 +1,21 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } + dependencies { + classpath "com.android.tools.build:gradle:$abt_plugin_version" + } +} + +allprojects { + repositories { + mavenCentral() + jcenter() + maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt b/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt new file mode 100644 index 00000000..c5e79eba --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt @@ -0,0 +1,21 @@ +/ + allclasses-frame.html + allclasses-noframe.html + constant-values.html + deprecated-list.html + help-doc.html + index-all.html + index.html + org/ + example/ + kotlin/ + mixed/ + JavaActivity.html + KotlinActivity.html + package-frame.html + package-summary.html + package-tree.html + overview-tree.html + package-list + script.js + stylesheet.css diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle new file mode 100644 index 00000000..a4e67fea --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "androidAppJavadoc" + +include ':app' \ No newline at end of file -- cgit From afea8e9e9c4b88af8c7eb7fc2d993d2eca29c4a1 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 21 Nov 2017 16:46:59 +0300 Subject: Fix reporting of FileComparisonFailure by adding idea_rt dependency --- build.gradle | 29 +++++++++++++++- core/build.gradle | 22 ++---------- .../rt/execution/junit/FileComparisonFailure.java | 39 ---------------------- .../rt/execution/junit/KnownException.java | 6 ---- runners/gradle-integration-tests/build.gradle | 1 + .../rt/execution/junit/FileComparisonFailure.java | 39 ---------------------- .../rt/execution/junit/KnownException.java | 6 ---- 7 files changed, 32 insertions(+), 110 deletions(-) delete mode 100644 core/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java delete mode 100644 core/src/test/java/com/intellij/rt/execution/junit/KnownException.java delete mode 100644 runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java delete mode 100644 runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/KnownException.java (limited to 'runners/gradle-integration-tests') diff --git a/build.gradle b/build.gradle index f9c2bd70..e64427b7 100644 --- a/build.gradle +++ b/build.gradle @@ -69,4 +69,31 @@ task wrapper(type: Wrapper) { def versions = DependenciesVersionGetter.getVersions(project, kotlin_compiler_version) -ext.ideaVersion = versions["idea.build.id"] \ No newline at end of file +ext.ideaVersion = versions["idea.build.id"] + +configurations { + ideaIC + intellijCore +} + +repositories { + maven { url 'https://www.jetbrains.com/intellij-repository/snapshots' } + maven { url 'https://www.jetbrains.com/intellij-repository/releases' } +} + +dependencies { + intellijCore "com.jetbrains.intellij.idea:intellij-core:$ideaVersion" + ideaIC "com.jetbrains.intellij.idea:ideaIC:$ideaVersion" +} + +def intellijCoreAnalysis() { + return zipTree(configurations.intellijCore.singleFile).matching ({ + include("intellij-core-analysis.jar") + }) +} + +def ideaRT() { + return zipTree(project.configurations.ideaIC.singleFile).matching ({ + include("lib/idea_rt.jar") + }) +} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 3c602a6b..68d3da89 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -10,15 +10,6 @@ apply plugin: 'kotlin' sourceCompatibility = 1.6 -repositories { - maven { url 'https://www.jetbrains.com/intellij-repository/snapshots' } - maven { url 'https://www.jetbrains.com/intellij-repository/releases' } -} - -configurations { - intellijCore -} - dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_compiler_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_compiler_version" @@ -32,6 +23,8 @@ dependencies { compile "teamcity:kotlin-ide-common:$kotlin_compiler_version" compile "teamcity:markdown:$kotlin_compiler_version" + compile intellijCoreAnalysis() + //tools.jar def toolsJar = files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") }) compileOnly toolsJar @@ -43,14 +36,5 @@ dependencies { testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_compiler_to_compile_core_version testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0" - intellijCore "com.jetbrains.intellij.idea:intellij-core:$ideaVersion" -} - - -afterEvaluate { - dependencies { - compile zipTree(configurations.intellijCore.singleFile).matching ({ - include("intellij-core-analysis.jar") - }) - } + testCompile ideaRT() } \ No newline at end of file diff --git a/core/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java b/core/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java deleted file mode 100644 index cbb1cc3c..00000000 --- a/core/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java +++ /dev/null @@ -1,39 +0,0 @@ - -package com.intellij.rt.execution.junit; - -import junit.framework.ComparisonFailure; - -public class FileComparisonFailure extends ComparisonFailure implements KnownException { - private final String myExpected; - private final String myActual; - private final String myFilePath; - private final String myActualFilePath; - - public FileComparisonFailure(String message, String expected, String actual, String filePath) { - this(message, expected, actual, filePath, (String)null); - } - - public FileComparisonFailure(String message, String expected, String actual, String expectedFilePath, String actualFilePath) { - super(message, expected, actual); - this.myExpected = expected; - this.myActual = actual; - this.myFilePath = expectedFilePath; - this.myActualFilePath = actualFilePath; - } - - public String getFilePath() { - return this.myFilePath; - } - - public String getActualFilePath() { - return this.myActualFilePath; - } - - public String getExpected() { - return this.myExpected; - } - - public String getActual() { - return this.myActual; - } -} diff --git a/core/src/test/java/com/intellij/rt/execution/junit/KnownException.java b/core/src/test/java/com/intellij/rt/execution/junit/KnownException.java deleted file mode 100644 index c24653ea..00000000 --- a/core/src/test/java/com/intellij/rt/execution/junit/KnownException.java +++ /dev/null @@ -1,6 +0,0 @@ - -package com.intellij.rt.execution.junit; - -interface KnownException { - -} diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle index 1b4ff5ed..f807c12b 100644 --- a/runners/gradle-integration-tests/build.gradle +++ b/runners/gradle-integration-tests/build.gradle @@ -14,6 +14,7 @@ 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 ideaRT() dokkaPlugin project(path: ':runners:gradle-plugin', configuration: 'shadow') dokkaAndroidPlugin project(path: ':runners:android-gradle-plugin', configuration: 'shadow') diff --git a/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java b/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java deleted file mode 100644 index cbb1cc3c..00000000 --- a/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/FileComparisonFailure.java +++ /dev/null @@ -1,39 +0,0 @@ - -package com.intellij.rt.execution.junit; - -import junit.framework.ComparisonFailure; - -public class FileComparisonFailure extends ComparisonFailure implements KnownException { - private final String myExpected; - private final String myActual; - private final String myFilePath; - private final String myActualFilePath; - - public FileComparisonFailure(String message, String expected, String actual, String filePath) { - this(message, expected, actual, filePath, (String)null); - } - - public FileComparisonFailure(String message, String expected, String actual, String expectedFilePath, String actualFilePath) { - super(message, expected, actual); - this.myExpected = expected; - this.myActual = actual; - this.myFilePath = expectedFilePath; - this.myActualFilePath = actualFilePath; - } - - public String getFilePath() { - return this.myFilePath; - } - - public String getActualFilePath() { - return this.myActualFilePath; - } - - public String getExpected() { - return this.myExpected; - } - - public String getActual() { - return this.myActual; - } -} diff --git a/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/KnownException.java b/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/KnownException.java deleted file mode 100644 index c24653ea..00000000 --- a/runners/gradle-integration-tests/src/test/java/com/intellij/rt/execution/junit/KnownException.java +++ /dev/null @@ -1,6 +0,0 @@ - -package com.intellij.rt.execution.junit; - -interface KnownException { - -} -- 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 'runners/gradle-integration-tests') 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 d552647b6a51241aa5d5e9e50b87e22564c069e7 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 13 Dec 2017 23:22:05 +0300 Subject: Fix adding class directories to classpath Fixes #252 --- core/src/main/kotlin/Analysis/AnalysisEnvironment.kt | 15 ++++++++++----- .../test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt | 1 + .../gradle-integration-tests/testData/basic/build.gradle | 1 + .../gradle-integration-tests/testData/basic/fileTree.txt | 3 +++ .../testData/basic/src/main/kotlin/demo/HelloWorld.kt | 4 ++++ 5 files changed, 19 insertions(+), 5 deletions(-) (limited to 'runners/gradle-integration-tests') diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index 003c6835..3b9b9149 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -13,7 +13,6 @@ import com.intellij.openapi.roots.ProjectFileIndex import com.intellij.openapi.roots.ProjectRootManager import com.intellij.openapi.util.Disposer import com.intellij.openapi.vfs.StandardFileSystems -import com.intellij.openapi.vfs.VirtualFileManager import com.intellij.psi.PsiElement import com.intellij.psi.search.GlobalSearchScope import com.intellij.util.io.URLUtil @@ -114,11 +113,17 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val builtIns = JvmBuiltIns(projectContext.storageManager) - val javaRoots = run { - val jvfs = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JAR_PROTOCOL) + val javaRoots = classpath + .map { + val rootFile = when { + it.extension == "jar" -> + StandardFileSystems.jar().findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}")!! + else -> + StandardFileSystems.local().findFileByPath(it.absolutePath)!! + } - classpath.map { JavaRoot(jvfs.findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}")!!, JavaRoot.RootType.BINARY) } - } + JavaRoot(rootFile, JavaRoot.RootType.BINARY) + } val resolverForProject = ResolverForProjectImpl( "Dokka", 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 f9801c82..b1364004 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 @@ -11,6 +11,7 @@ class BasicTest : AbstractDokkaGradleTest() { val tmpRoot = testProjectDir.root.toPath() testDataRoot.resolve("src").copy(tmpRoot.resolve("src")) + testDataRoot.resolve("classDir").copy(tmpRoot.resolve("classDir")) testDataRoot.resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) testDataRoot.resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) } diff --git a/runners/gradle-integration-tests/testData/basic/build.gradle b/runners/gradle-integration-tests/testData/basic/build.gradle index bc20e1cf..4a259f50 100644 --- a/runners/gradle-integration-tests/testData/basic/build.gradle +++ b/runners/gradle-integration-tests/testData/basic/build.gradle @@ -36,4 +36,5 @@ dependencies { dokka { dokkaFatJar = new File(dokka_fatjar) + classpath += files("$projectDir/classDir") } \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/fileTree.txt b/runners/gradle-integration-tests/testData/basic/fileTree.txt index 1a483d4e..2ceae371 100644 --- a/runners/gradle-integration-tests/testData/basic/fileTree.txt +++ b/runners/gradle-integration-tests/testData/basic/fileTree.txt @@ -22,6 +22,9 @@ constructor.html index.html main.html + p1.-my-binary-class/ + index.html + test.html str.html x.html index-outline.html diff --git a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt index 7492e2a8..3d7bcb51 100644 --- a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt +++ b/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt @@ -1,5 +1,7 @@ package demo +import p1.MyBinaryClass + /** * This class supports greeting people by name. * @@ -39,3 +41,5 @@ fun SomeType.constructor(): SomeType { annotation class A(val p: String) +val MyBinaryClass.test get() = s() + -- cgit From 0cd45fb746de1c94e009b15082480e869e59e295 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 15 Dec 2017 00:27:23 +0300 Subject: Add forgotten part of testData --- .gitignore | 4 +++- .../testData/basic/classDir/p1/MyBinaryClass.class | Bin 0 -> 670 bytes 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class (limited to 'runners/gradle-integration-tests') diff --git a/.gitignore b/.gitignore index a4f7f56b..fe5edc3b 100644 --- a/.gitignore +++ b/.gitignore @@ -89,4 +89,6 @@ gradle-app.setting !lib/*.jar local.properties -android.local.properties \ No newline at end of file +android.local.properties + +!runners/gradle-integration-tests/testData/basic/classDir/**/*.class \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class b/runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class new file mode 100644 index 00000000..ccfff300 Binary files /dev/null and b/runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class differ -- 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 'runners/gradle-integration-tests') 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 7c80cf7ab7f578f4221597ff9fab1f688a85cc54 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 30 Jan 2018 22:33:19 +0300 Subject: Use kotlin-test-junit in gradle-integration-tests --- runners/gradle-integration-tests/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runners/gradle-integration-tests') diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle index cb734db3..a681c82e 100644 --- a/runners/gradle-integration-tests/build.gradle +++ b/runners/gradle-integration-tests/build.gradle @@ -22,7 +22,7 @@ configurations { dependencies { 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 group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_for_gradle_runtime_version testCompile ideaRT() dokkaPlugin project(path: ':runners:gradle-plugin', configuration: 'shadow') -- cgit