From 47b825f5ce812e2563c2e613ba39dca0d69516d1 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 11 Sep 2019 16:53:54 +0200 Subject: Bump Gradle to 4.10.3 --- gradle/wrapper/gradle-wrapper.jar | Bin 56172 -> 55616 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'gradle/wrapper') diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 28861d27..5c2d1cf0 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f73107db..290541c7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -- cgit From 3aa6f80eec4e922add92646a5d5547b6db82cc4b Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 18 Sep 2019 15:10:24 +0200 Subject: Move gradle-integration-tests to new module --- .gitignore | 2 +- gradle/wrapper/gradle-wrapper.properties | 5 +- integration-tests/build.gradle | 7 ++ .../android-licenses/android-sdk-license | 2 + .../android-licenses/android-sdk-preview-license | 2 + .../gradle-integration-tests/build.gradle | 59 +++++++++++ .../dokka/gradle/AbstractAndroidAppTest.kt | 51 ++++++++++ .../dokka/gradle/AbstractDokkaAndroidGradleTest.kt | 45 +++++++++ .../dokka/gradle/AbstractDokkaGradleTest.kt | 108 +++++++++++++++++++++ .../org/jetbrains/dokka/gradle/AndroidAppTest.kt | 25 +++++ .../dokka/gradle/AndroidLibDependsOnJavaLibTest.kt | 48 +++++++++ .../dokka/gradle/AndroidMultiFlavourAppTest.kt | 60 ++++++++++++ .../kotlin/org/jetbrains/dokka/gradle/BasicTest.kt | 51 ++++++++++ .../dokka/gradle/JavadocRSuppressionTest.kt | 24 +++++ .../dokka/gradle/MultiProjectSingleOutTest.kt | 57 +++++++++++ .../dokka/gradle/MultiplatformProjectTest.kt | 54 +++++++++++ .../dokka/gradle/RebuildAfterSourceChangeTest.kt | 74 ++++++++++++++ .../dokka/gradle/TypeSafeConfigurationTest.kt | 36 +++++++ .../kotlin/org/jetbrains/dokka/gradle/Utils.kt | 56 +++++++++++ .../testData/androidApp/app/build.gradle | 45 +++++++++ .../androidApp/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 +++++ .../androidApp/app/src/main/res/menu/main.xml | 6 ++ .../app/src/main/res/menu/main_activity2.xml | 6 ++ .../androidApp/app/src/main/res/values/dimens.xml | 5 + .../androidApp/app/src/main/res/values/strings.xml | 10 ++ .../androidApp/app/src/main/res/values/styles.xml | 20 ++++ .../testData/androidApp/build.gradle | 21 ++++ .../testData/androidApp/fileTree.txt | 20 ++++ .../testData/androidApp/settings.gradle | 3 + .../testData/androidAppJavadoc/app/build.gradle | 49 ++++++++++ .../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 + .../androidLibDependsOnJavaLib/build.gradle | 20 ++++ .../androidLibDependsOnJavaLib/fileTree.txt | 14 +++ .../androidLibDependsOnJavaLib/jlib/build.gradle | 1 + .../jlib/src/main/java/example/jlib/LibClz.java | 5 + .../androidLibDependsOnJavaLib/lib/build.gradle | 39 ++++++++ .../lib/src/main/AndroidManifest.xml | 4 + .../lib/src/main/kotlin/example/LibClzUse.kt | 13 +++ .../androidLibDependsOnJavaLib/package-list | 1 + .../androidLibDependsOnJavaLib/settings.gradle | 5 + .../androidMultiFlavourApp/app/build.gradle | 75 ++++++++++++++ .../app/src/free/AndroidManifest.xml | 9 ++ .../org/example/kotlin/mixed/free/AdActivity.kt | 14 +++ .../app/src/free/res/layout/activity_ad.xml | 24 +++++ .../app/src/free/res/values/strings.xml | 3 + .../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/androidMultiFlavourApp/build.gradle | 21 ++++ .../testData/androidMultiFlavourApp/fileTree.txt | 47 +++++++++ .../androidMultiFlavourApp/settings.gradle | 3 + .../testData/basic/build.gradle | 42 ++++++++ .../testData/basic/classDir/p1/MyBinaryClass.class | Bin 0 -> 670 bytes .../testData/basic/fileTree.txt | 33 +++++++ .../testData/basic/settings.gradle | 1 + .../basic/src/main/kotlin/demo/HelloWorld.kt | 45 +++++++++ .../testData/multiProjectSingleOut/build.gradle | 37 +++++++ .../testData/multiProjectSingleOut/fileTree.txt | 33 +++++++ .../testData/multiProjectSingleOut/settings.gradle | 3 + .../multiProjectSingleOut/subA/build.gradle | 6 ++ .../subA/src/main/kotlin/module.kt | 31 ++++++ .../multiProjectSingleOut/subB/build.gradle | 7 ++ .../subB/src/main/kotlin/module.kt | 31 ++++++ .../testData/multiplatformProject/build.gradle | 60 ++++++++++++ .../testData/multiplatformProject/fileTree.txt | 18 ++++ .../testData/multiplatformProject/settings.gradle | 1 + .../src/jsMain/kotlin/org/kotlintestmpp/main.kt | 14 +++ .../src/jvmMain/kotlin/org/kotlintestmpp/main.kt | 20 ++++ .../testData/sourcesChange/build.gradle | 35 +++++++ .../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 +++ .../testData/typeSafeConfiguration/build.gradle | 73 ++++++++++++++ .../testData/typeSafeConfiguration/settings.gradle | 1 + .../android-licenses/android-sdk-license | 2 - .../android-licenses/android-sdk-preview-license | 2 - runners/gradle-integration-tests/build.gradle | 59 ----------- .../dokka/gradle/AbstractAndroidAppTest.kt | 51 ---------- .../dokka/gradle/AbstractDokkaAndroidGradleTest.kt | 45 --------- .../dokka/gradle/AbstractDokkaGradleTest.kt | 108 --------------------- .../org/jetbrains/dokka/gradle/AndroidAppTest.kt | 25 ----- .../dokka/gradle/AndroidLibDependsOnJavaLibTest.kt | 48 --------- .../dokka/gradle/AndroidMultiFlavourAppTest.kt | 60 ------------ .../kotlin/org/jetbrains/dokka/gradle/BasicTest.kt | 51 ---------- .../dokka/gradle/JavadocRSuppressionTest.kt | 24 ----- .../dokka/gradle/MultiProjectSingleOutTest.kt | 57 ----------- .../dokka/gradle/MultiplatformProjectTest.kt | 54 ----------- .../dokka/gradle/RebuildAfterSourceChangeTest.kt | 74 -------------- .../dokka/gradle/TypeSafeConfigurationTest.kt | 36 ------- .../kotlin/org/jetbrains/dokka/gradle/Utils.kt | 56 ----------- .../testData/androidApp/app/build.gradle | 45 --------- .../androidApp/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 9397 -> 0 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 0 bytes .../app/src/main/res/layout/activity_main.xml | 24 ----- .../app/src/main/res/layout/activity_main2.xml | 24 ----- .../androidApp/app/src/main/res/menu/main.xml | 6 -- .../app/src/main/res/menu/main_activity2.xml | 6 -- .../androidApp/app/src/main/res/values/dimens.xml | 5 - .../androidApp/app/src/main/res/values/strings.xml | 10 -- .../androidApp/app/src/main/res/values/styles.xml | 20 ---- .../testData/androidApp/build.gradle | 21 ---- .../testData/androidApp/fileTree.txt | 20 ---- .../testData/androidApp/settings.gradle | 3 - .../testData/androidAppJavadoc/app/build.gradle | 49 ---------- .../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 9397 -> 0 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 0 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 - .../androidLibDependsOnJavaLib/build.gradle | 20 ---- .../androidLibDependsOnJavaLib/fileTree.txt | 14 --- .../androidLibDependsOnJavaLib/jlib/build.gradle | 1 - .../jlib/src/main/java/example/jlib/LibClz.java | 5 - .../androidLibDependsOnJavaLib/lib/build.gradle | 39 -------- .../lib/src/main/AndroidManifest.xml | 4 - .../lib/src/main/kotlin/example/LibClzUse.kt | 13 --- .../androidLibDependsOnJavaLib/package-list | 1 - .../androidLibDependsOnJavaLib/settings.gradle | 5 - .../androidMultiFlavourApp/app/build.gradle | 75 -------------- .../app/src/free/AndroidManifest.xml | 9 -- .../org/example/kotlin/mixed/free/AdActivity.kt | 14 --- .../app/src/free/res/layout/activity_ad.xml | 24 ----- .../app/src/free/res/values/strings.xml | 3 - .../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 9397 -> 0 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 5237 -> 0 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 14383 -> 0 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/androidMultiFlavourApp/build.gradle | 21 ---- .../testData/androidMultiFlavourApp/fileTree.txt | 47 --------- .../androidMultiFlavourApp/settings.gradle | 3 - .../testData/basic/build.gradle | 42 -------- .../testData/basic/classDir/p1/MyBinaryClass.class | Bin 670 -> 0 bytes .../testData/basic/fileTree.txt | 33 ------- .../testData/basic/settings.gradle | 1 - .../basic/src/main/kotlin/demo/HelloWorld.kt | 45 --------- .../testData/multiProjectSingleOut/build.gradle | 37 ------- .../testData/multiProjectSingleOut/fileTree.txt | 33 ------- .../testData/multiProjectSingleOut/settings.gradle | 3 - .../multiProjectSingleOut/subA/build.gradle | 6 -- .../subA/src/main/kotlin/module.kt | 31 ------ .../multiProjectSingleOut/subB/build.gradle | 7 -- .../subB/src/main/kotlin/module.kt | 31 ------ .../testData/multiplatformProject/build.gradle | 60 ------------ .../testData/multiplatformProject/fileTree.txt | 18 ---- .../testData/multiplatformProject/settings.gradle | 1 - .../src/jsMain/kotlin/org/kotlintestmpp/main.kt | 14 --- .../src/jvmMain/kotlin/org/kotlintestmpp/main.kt | 20 ---- .../testData/sourcesChange/build.gradle | 35 ------- .../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 --- .../testData/typeSafeConfiguration/build.gradle | 73 -------------- .../testData/typeSafeConfiguration/settings.gradle | 1 - settings.gradle | 9 +- 214 files changed, 2327 insertions(+), 2320 deletions(-) create mode 100644 integration-tests/build.gradle create mode 100644 integration-tests/gradle-integration-tests/android-licenses/android-sdk-license create mode 100644 integration-tests/gradle-integration-tests/android-licenses/android-sdk-preview-license create mode 100644 integration-tests/gradle-integration-tests/build.gradle create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt create mode 100644 integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/androidApp/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list create mode 100644 integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/basic/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class create mode 100644 integration-tests/gradle-integration-tests/testData/basic/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/basic/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt create mode 100644 integration-tests/gradle-integration-tests/testData/multiplatformProject/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiplatformProject/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/multiplatformProject/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt create mode 100644 integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree1.txt create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/settings.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt create mode 100644 integration-tests/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt create mode 100644 integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle delete mode 100644 runners/gradle-integration-tests/android-licenses/android-sdk-license delete mode 100644 runners/gradle-integration-tests/android-licenses/android-sdk-preview-license delete mode 100644 runners/gradle-integration-tests/build.gradle delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt delete mode 100644 runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml delete mode 100644 runners/gradle-integration-tests/testData/androidApp/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidApp/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/androidApp/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list delete mode 100644 runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/basic/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class delete mode 100644 runners/gradle-integration-tests/testData/basic/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/basic/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt delete mode 100644 runners/gradle-integration-tests/testData/multiplatformProject/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt delete mode 100644 runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/settings.gradle delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt delete mode 100644 runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt delete mode 100644 runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle delete mode 100644 runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle (limited to 'gradle/wrapper') diff --git a/.gitignore b/.gitignore index 0c5476ae..a6376444 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,4 @@ gradle-app.setting local.properties android.local.properties -!runners/gradle-integration-tests/testData/basic/classDir/**/*.class \ No newline at end of file +!integration-tests/gradle-integration-tests/testData/basic/classDir/**/*.class \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 290541c7..f9fe22d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Sep 18 14:13:14 CEST 2019 +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/integration-tests/build.gradle b/integration-tests/build.gradle new file mode 100644 index 00000000..23d232d2 --- /dev/null +++ b/integration-tests/build.gradle @@ -0,0 +1,7 @@ +subprojects { + buildscript { + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/android-licenses/android-sdk-license b/integration-tests/gradle-integration-tests/android-licenses/android-sdk-license new file mode 100644 index 00000000..c311cf48 --- /dev/null +++ b/integration-tests/gradle-integration-tests/android-licenses/android-sdk-license @@ -0,0 +1,2 @@ + +d56f5187479451eabf01fb78af6dfcb131a6481e \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/android-licenses/android-sdk-preview-license b/integration-tests/gradle-integration-tests/android-licenses/android-sdk-preview-license new file mode 100644 index 00000000..da4552d2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/android-licenses/android-sdk-preview-license @@ -0,0 +1,2 @@ + +84831b9409646a918e30573bab4c9c91346d8abd \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/build.gradle b/integration-tests/gradle-integration-tests/build.gradle new file mode 100644 index 00000000..bbbf2e33 --- /dev/null +++ b/integration-tests/gradle-integration-tests/build.gradle @@ -0,0 +1,59 @@ +apply plugin: 'kotlin' + +sourceCompatibility = 1.8 + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = language_version + apiVersion = language_version + jvmTarget = "1.8" + } +} + +configurations { + dokkaPlugin + dokkaFatJar + kotlinGradle +} + +dependencies { + + testCompileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', 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') + dokkaFatJar project(path: ":runners:fatjar", configuration: 'shadow') + + kotlinGradle "org.jetbrains.kotlin:kotlin-gradle-plugin" + + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile gradleTestKit() +} + + + +task createClasspathManifest { + def outputDir = file("$buildDir/$name") + + inputs.files(configurations.dokkaPlugin + configurations.dokkaFatJar) + outputs.dir outputDir + + doLast { + outputDir.mkdirs() + file("$outputDir/dokka-plugin-classpath.txt").text = configurations.dokkaPlugin.join("\n") + file("$outputDir/fatjar.txt").text = configurations.dokkaFatJar.join("\n") + file("$outputDir/kotlin-gradle.txt").text = configurations.kotlinGradle.join("\n") + } +} + + +createClasspathManifest.mustRunAfter project(":runners:fatjar").getTasksByName("shadowJar", true) +testClasses.dependsOn project(":runners:fatjar").shadowJar +testClasses.dependsOn createClasspathManifest + +test { + systemProperty "android.licenses.overwrite", project.findProperty("android.licenses.overwrite") ?: "" + inputs.dir(file('testData')) +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt new file mode 100644 index 00000000..c3fe2ea9 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt new file mode 100644 index 00000000..334fc7c8 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt @@ -0,0 +1,45 @@ +package org.jetbrains.dokka.gradle + +import org.junit.BeforeClass +import java.io.File + +abstract class AbstractDokkaAndroidGradleTest : AbstractDokkaGradleTest() { + + override val pluginClasspath: List = pluginClasspathData.toFile().readLines().map { File(it) } + + 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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt new file mode 100644 index 00000000..4814e707 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt @@ -0,0 +1,108 @@ +package org.jetbrains.dokka.gradle + + +import com.intellij.rt.execution.junit.FileComparisonFailure +import org.gradle.testkit.runner.GradleRunner +import org.junit.Rule +import org.junit.rules.TemporaryFolder +import java.io.File +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths + + +val testDataFolder: Path = Paths.get("testData") + +val pluginClasspathData: Path = Paths.get("build", "createClasspathManifest", "dokka-plugin-classpath.txt") + +val dokkaFatJarPathData: Path = pluginClasspathData.resolveSibling("fatjar.txt") + +val androidLocalProperties = testDataFolder.resolve("android.local.properties").let { if (Files.exists(it)) it else null } + +abstract class AbstractDokkaGradleTest { + @get:Rule val testProjectDir = TemporaryFolder() + + open val pluginClasspath: List = pluginClasspathData.toFile().readLines().map { File(it) } + + fun checkOutputStructure(expected: String, actualSubpath: String) { + val expectedPath = testDataFolder.resolve(expected) + val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() + + assertEqualsIgnoringSeparators(expectedPath.toFile(), buildString { + actualPath.toFile().writeStructure(this, File(actualPath.toFile(), ".")) + }) + } + + fun checkNoErrorClasses(actualSubpath: String, extension: String = "html", errorClassMarker: String = "ERROR CLASS") { + val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() + var checked = 0 + Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { + val text = it.toFile().readText() + + val noErrorClasses = text.replace(errorClassMarker, "?!") + + if (noErrorClasses != text) { + throw FileComparisonFailure("", noErrorClasses, text, null) + } + + checked++ + } + println("$checked files checked for error classes") + } + + fun checkNoUnresolvedLinks(actualSubpath: String, extension: String = "html", marker: Regex = "[\"']#[\"']".toRegex()) { + val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() + var checked = 0 + Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { + val text = it.toFile().readText() + + val noErrorClasses = text.replace(marker, "?!") + + if (noErrorClasses != text) { + throw FileComparisonFailure("", noErrorClasses, text, null) + } + + checked++ + } + println("$checked files checked for unresolved links") + } + + fun checkExternalLink(actualSubpath: String, linkBody: String, fullLink: String, extension: String = "html") { + val match = "!!match!!" + val notMatch = "!!not-match!!" + + val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() + var checked = 0 + var totalEntries = 0 + Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { + val text = it.toFile().readText() + + val textWithoutMatches = text.replace(fullLink, match) + + val textWithoutNonMatches = textWithoutMatches.replace(linkBody, notMatch) + + if (textWithoutNonMatches != textWithoutMatches) { + + val expected = textWithoutNonMatches.replace(notMatch, fullLink).replace(match, fullLink) + val actual = textWithoutMatches.replace(match, fullLink) + + throw FileComparisonFailure("", expected, actual, null) + } + if (text != textWithoutMatches) + totalEntries++ + + checked++ + } + println("$checked files checked for valid external links '$linkBody', found $totalEntries links") + } + + fun configure(gradleVersion: String = "3.5", kotlinVersion: String = "1.1.2", arguments: Array): GradleRunner { + val fatjar = dokkaFatJarPathData.toFile().readText() + + return GradleRunner.create().withProjectDir(testProjectDir.root) + .withArguments("-Pdokka_fatjar=$fatjar", "-Ptest_kotlin_version=$kotlinVersion", *arguments) + .withPluginClasspath(pluginClasspath) + .withGradleVersion(gradleVersion) + .withDebug(true) + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt new file mode 100644 index 00000000..bbb63909 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt @@ -0,0 +1,25 @@ +package org.jetbrains.dokka.gradle + +import org.junit.Test + +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`() { + 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)) + } + + @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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt new file mode 100644 index 00000000..9bc52273 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt @@ -0,0 +1,48 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Test +import kotlin.test.assertEquals + +class AndroidLibDependsOnJavaLibTest: AbstractDokkaAndroidGradleTest() { + + private val testDataRootPath = "androidLibDependsOnJavaLib" + + private fun prepareTestData() { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + val tmpRoot = testProjectDir.root.toPath() + + testDataRoot.copy(tmpRoot) + + androidLocalProperties?.copy(tmpRoot.resolve("local.properties")) + } + + + private fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AbstractAndroidAppTest.AndroidPluginParams) { + prepareTestData() + + val result = configure(gradleVersion, kotlinVersion, + arguments = arrayOf("dokka", "--stacktrace") + androidPluginParams.asArguments()) + .build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":lib:dokka")?.outcome) + + val docsOutput = "lib/build/dokka" + + checkOutputStructure("$testDataRootPath/fileTree.txt", docsOutput) + + checkNoErrorClasses(docsOutput) + checkNoUnresolvedLinks(docsOutput) + + checkExternalLink(docsOutput, "LibClz", + """LibClz""") + } + + + @Test + fun `test kotlin 1_2_20 and gradle 4_5 and abt 3_0_1`() { + doTest("4.5", "1.2.20", AbstractAndroidAppTest.AndroidPluginParams("3.0.1", "27.0.0", 27)) + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt new file mode 100644 index 00000000..ef1b94d8 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt @@ -0,0 +1,60 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.jetbrains.dokka.gradle.AbstractAndroidAppTest.AndroidPluginParams +import org.junit.Test +import kotlin.test.assertEquals + +class AndroidMultiFlavourAppTest : AbstractDokkaAndroidGradleTest() { + + 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")) + } + + private fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AndroidPluginParams) { + prepareTestData("androidMultiFlavourApp") + + val result = configure(gradleVersion, kotlinVersion, + arguments = arrayOf("dokka", "dokkaFullFlavourOnly", "--stacktrace") + androidPluginParams.asArguments()) + .build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokka")?.outcome) + assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokkaFullFlavourOnly")?.outcome) + + val docsOutput = "app/build/dokka" + + checkOutputStructure("androidMultiFlavourApp/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`() { + 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)) + } + + @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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt new file mode 100644 index 00000000..2e1a0d41 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt @@ -0,0 +1,51 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Test +import kotlin.test.assertEquals + +class BasicTest : AbstractDokkaGradleTest() { + + fun prepareTestData(testDataRootPath: String) { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + 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")) + } + + private fun doTest(gradleVersion: String, kotlinVersion: String) { + + prepareTestData("basic") + + val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) + + val docsOutput = "build/dokka" + + checkOutputStructure("basic/fileTree.txt", docsOutput) + + checkNoErrorClasses(docsOutput) + checkNoUnresolvedLinks(docsOutput) + + checkExternalLink(docsOutput, "String", + """String""") + } + + @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") + } + + @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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt new file mode 100644 index 00000000..3a4d08b8 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt @@ -0,0 +1,24 @@ +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)) + } + + @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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt new file mode 100644 index 00000000..9458528c --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt @@ -0,0 +1,57 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Test +import kotlin.test.assertEquals + +class MultiProjectSingleOutTest : AbstractDokkaGradleTest() { + + fun prepareTestData(testDataRootPath: String) { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + val tmpRoot = testProjectDir.root.toPath() + + testDataRoot.apply { + resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) + resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) + resolve("subA").copy(tmpRoot.resolve("subA")) + resolve("subB").copy(tmpRoot.resolve("subB")) + } + } + + private fun doTest(gradleVersion: String, kotlinVersion: String) { + + prepareTestData("multiProjectSingleOut") + + val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) + + val docsOutput = "build/dokka" + + checkOutputStructure("multiProjectSingleOut/fileTree.txt", docsOutput) + + checkNoErrorClasses(docsOutput) + checkNoUnresolvedLinks(docsOutput) + + checkExternalLink(docsOutput, "String", + """String""") + } + + @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") + } + + @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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt new file mode 100644 index 00000000..3e61d79e --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt @@ -0,0 +1,54 @@ +package org.jetbrains.dokka.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Test +import java.io.File +import kotlin.test.assertEquals + +class MultiplatformProjectTest : AbstractDokkaGradleTest() { + + fun prepareTestData(testDataRootPath: String) { + val testDataRoot = testDataFolder.resolve(testDataRootPath) + val tmpRoot = testProjectDir.root.toPath() + + testDataRoot.apply { + resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) + resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) + resolve("src").copy(tmpRoot.resolve("src")) + } + } + + private fun doTest(gradleVersion: String, kotlinVersion: String) { + val kotlinGradlePlugin = pluginClasspathData.resolveSibling("kotlin-gradle.txt").toFile().readLines().map { File(it) } + prepareTestData("multiplatformProject") + + // Remove withDebug(false) when https://github.com/gradle/gradle/issues/6862 is solved + val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")) + .withDebug(false) + .withPluginClasspath(pluginClasspath.union(kotlinGradlePlugin)) + .build() + + println(result.output) + + assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) + + val docsOutput = "build/dokka" + + checkOutputStructure("multiplatformProject/fileTree.txt", docsOutput) + + checkNoErrorClasses(docsOutput) + checkNoUnresolvedLinks(docsOutput) + } + + @Test fun `test kotlin 1_3_30 and gradle 4_7`() { + doTest("4.7", "1.3.30") + } + + @Test fun `test kotlin 1_3_40 and gradle 4_10_3`() { + doTest("4.10.3", "1.3.40") + } + + @Test fun `test kotlin 1_3_40 and gradle 5_6_1`() { + doTest("5.6.1", "1.3.50") + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt new file mode 100644 index 00000000..8b2db560 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt @@ -0,0 +1,74 @@ +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", "-i", "--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_0_7 and gradle 2_14_1`() { + doTest("2.14.1", "1.0.7") + } + + @Test + fun `test kotlin 1_1_2 and gradle 3_5`() { + doTest("3.5", "1.1.2") + } + + @Test + 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/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt new file mode 100644 index 00000000..7b179e92 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt @@ -0,0 +1,36 @@ +package org.jetbrains.dokka.gradle + +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + +@RunWith(Parameterized::class) +class TypeSafeConfigurationTest(private val testCase: TestCase) : AbstractDokkaGradleTest() { + + data class TestCase(val gradleVersion: String, val kotlinVersion: String) { + override fun toString(): String = "Gradle $gradleVersion and Kotlin $kotlinVersion" + } + + companion object { + @Parameterized.Parameters(name = "{0}") + @JvmStatic + fun testCases() = listOf( + TestCase("4.0", "1.1.2"), + TestCase("4.5", "1.2.20"), + TestCase("4.10.1", "1.2.60") + ) + } + + @Test + fun test() { + + testDataFolder.resolve("typeSafeConfiguration").toFile() + .copyRecursively(testProjectDir.root) + + configure( + testCase.gradleVersion, + testCase.kotlinVersion, + arguments = arrayOf("help", "-s") + ).build() + } +} diff --git a/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt new file mode 100644 index 00000000..6f17af22 --- /dev/null +++ b/integration-tests/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt @@ -0,0 +1,56 @@ +package org.jetbrains.dokka.gradle + +import com.intellij.rt.execution.junit.FileComparisonFailure +import java.io.File +import java.io.IOException +import java.nio.file.* +import java.nio.file.attribute.BasicFileAttributes + + +fun File.writeStructure(builder: StringBuilder, relativeTo: File = this, spaces: Int = 0) { + builder.append(" ".repeat(spaces)) + val out = if (this != relativeTo) this.relativeTo(relativeTo) else this + + builder.append(out) + if (this.isDirectory) { + builder.appendln("/") + this.listFiles().sortedBy { it.name }.forEach { it.writeStructure(builder, this, spaces + 4) } + } else { + builder.appendln() + } +} + +fun assertEqualsIgnoringSeparators(expectedFile: File, output: String) { + if (!expectedFile.exists()) expectedFile.createNewFile() + val expectedText = expectedFile.readText().replace("\r\n", "\n") + val actualText = output.replace("\r\n", "\n") + + if (expectedText != actualText) + throw FileComparisonFailure("", expectedText, actualText, expectedFile.canonicalPath) +} + +class CopyFileVisitor(private var sourcePath: Path?, private val targetPath: Path) : SimpleFileVisitor() { + + @Throws(IOException::class) + override fun preVisitDirectory(dir: Path, + attrs: BasicFileAttributes): FileVisitResult { + if (sourcePath == null) { + sourcePath = dir + } else { + Files.createDirectories(targetPath.resolve(sourcePath?.relativize(dir))) + } + return FileVisitResult.CONTINUE + } + + @Throws(IOException::class) + override fun visitFile(file: Path, + attrs: BasicFileAttributes): FileVisitResult { + Files.copy(file, targetPath.resolve(sourcePath?.relativize(file)), StandardCopyOption.REPLACE_EXISTING) + return FileVisitResult.CONTINUE + } +} + +fun Path.copy(to: Path) { + Files.walkFileTree(this, CopyFileVisitor(this, to)) +} + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle b/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle new file mode 100644 index 00000000..2420107c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle @@ -0,0 +1,45 @@ +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' + +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" + dokkaRuntime files(dokka_fatjar) +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java new file mode 100644 index 00000000..3668c594 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/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/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt new file mode 100644 index 00000000..ca2f27b0 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/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/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..96a442e5 Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..359047df Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..71c6d760 Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml @@ -0,0 +1,10 @@ + + + + AndroidSample + Settings + Hello world! + JavaActivity + KotlinActivity + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/build.gradle b/integration-tests/gradle-integration-tests/testData/androidApp/build.gradle new file mode 100644 index 00000000..35356b90 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/build.gradle @@ -0,0 +1,21 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/fileTree.txt b/integration-tests/gradle-integration-tests/testData/androidApp/fileTree.txt new file mode 100644 index 00000000..f66c79e3 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/fileTree.txt @@ -0,0 +1,20 @@ +/ + app/ + alltypes/ + index.html + index-outline.html + index.html + org.example.kotlin.mixed/ + -java-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + -kotlin-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + index.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/settings.gradle b/integration-tests/gradle-integration-tests/testData/androidApp/settings.gradle new file mode 100644 index 00000000..1feb2867 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidApp/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "androidApp" + +include ':app' \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle new file mode 100644 index 00000000..66421f52 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle @@ -0,0 +1,49 @@ +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-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" + dokkaRuntime files(dokka_fatjar) +} + + +dokka { + outputFormat = "javadoc" +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/integration-tests/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/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/integration-tests/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/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/build.gradle b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/build.gradle new file mode 100644 index 00000000..35356b90 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/build.gradle @@ -0,0 +1,21 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} diff --git a/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt new file mode 100644 index 00000000..c5e79eba --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle new file mode 100644 index 00000000..a4e67fea --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "androidAppJavadoc" + +include ':app' \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle new file mode 100644 index 00000000..736668ab --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle @@ -0,0 +1,20 @@ +subprojects { + buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } + + } + + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt new file mode 100644 index 00000000..6c96a01c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt @@ -0,0 +1,14 @@ +/ + lib/ + alltypes/ + index.html + example/ + -lib-clz-use/ + -init-.html + f.html + index.html + index.html + index-outline.html + index.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle new file mode 100644 index 00000000..bbfeb03c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle @@ -0,0 +1 @@ +apply plugin: 'java' diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java new file mode 100644 index 00000000..1d9a6fb2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java @@ -0,0 +1,5 @@ +package example.jlib; + +public class LibClz { + +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle new file mode 100644 index 00000000..b1ee52ab --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle @@ -0,0 +1,39 @@ +buildscript { + dependencies { + classpath "com.android.tools.build:gradle:$abt_plugin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + + +plugins { + id 'org.jetbrains.dokka' +} + + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + + +android { + compileSdkVersion Integer.parseInt(sdk_version) + buildToolsVersion abt_version + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } +} + +dependencies { + api(project(":jlib")) + dokkaRuntime files(dokka_fatjar) +} + +dokka { + configuration { + externalDocumentationLink { + url = new URL("https://example.com") + packageListUrl = file("$rootDir/package-list").toURI().toURL() + } + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml new file mode 100644 index 00000000..267f6efd --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt new file mode 100644 index 00000000..d034a3a9 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt @@ -0,0 +1,13 @@ +package example + +import example.jlib.LibClz + +/** + * Uses jlib + */ +class LibClzUse { + /** + * Returns LibClz + */ + fun f(): LibClz = LibClz() +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list new file mode 100644 index 00000000..bf76058e --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list @@ -0,0 +1 @@ +example.jlib \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle new file mode 100644 index 00000000..5b4250a0 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = "androidLibDependsOnJavaLib" + + +include(":lib") +include(":jlib") \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle new file mode 100644 index 00000000..660257ab --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle @@ -0,0 +1,75 @@ +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' + +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') + } + } + + flavorDimensions "mode" + productFlavors { + free { + dimension "mode" + applicationIdSuffix ".free" + versionNameSuffix "-free" + } + full { + dimension "mode" + applicationIdSuffix ".full" + versionNameSuffix "-full" + } + } + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + free.java.srcDirs += 'src/free/kotlin' + } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" + dokkaRuntime files(dokka_fatjar) +} + + +dokka { + outputDirectory = "$buildDir/dokka/all" +} + +task dokkaFullFlavourOnly(type: org.jetbrains.dokka.gradle.DokkaTask) { + outputDirectory = "$buildDir/dokka/fullOnly" + configuration { + moduleName = "full" + kotlinTasks { + ["compileFullReleaseKotlin"] + } + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml new file mode 100644 index 00000000..3ecbcd3a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt new file mode 100644 index 00000000..b0b980fd --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt @@ -0,0 +1,14 @@ +package org.example.kotlin.mixed.free + +import android.os.Bundle +import android.app.Activity +import org.example.kotlin.mixed.R + +class AdActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_ad) + } + +} diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml new file mode 100644 index 00000000..e6443d05 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml new file mode 100644 index 00000000..bbdf2d06 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml @@ -0,0 +1,3 @@ + + AdActivity + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java new file mode 100644 index 00000000..3668c594 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt new file mode 100644 index 00000000..ca2f27b0 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..96a442e5 Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..359047df Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..71c6d760 Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml @@ -0,0 +1,10 @@ + + + + AndroidSample + Settings + Hello world! + JavaActivity + KotlinActivity + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle new file mode 100644 index 00000000..35356b90 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle @@ -0,0 +1,21 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt new file mode 100644 index 00000000..77b563b2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt @@ -0,0 +1,47 @@ +/ + all/ + app/ + alltypes/ + index.html + index-outline.html + index.html + org.example.kotlin.mixed/ + -java-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + -kotlin-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + index.html + org.example.kotlin.mixed.free/ + -ad-activity/ + -init-.html + index.html + on-create.html + index.html + package-list + style.css + fullOnly/ + full/ + alltypes/ + index.html + index-outline.html + index.html + org.example.kotlin.mixed/ + -java-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + -kotlin-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + index.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle new file mode 100644 index 00000000..1feb2867 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "androidApp" + +include ':app' \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/basic/build.gradle b/integration-tests/gradle-integration-tests/testData/basic/build.gradle new file mode 100644 index 00000000..79645204 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/basic/build.gradle @@ -0,0 +1,42 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" + } + maven { + url "https://dl.bintray.com/kotlin/kotlin-dev" + } +} + +dependencies { + dokkaRuntime files(dokka_fatjar) + 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 { + configuration { + classpath += "$projectDir/classDir" + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class b/integration-tests/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class new file mode 100644 index 00000000..ccfff300 Binary files /dev/null and b/integration-tests/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class differ diff --git a/integration-tests/gradle-integration-tests/testData/basic/fileTree.txt b/integration-tests/gradle-integration-tests/testData/basic/fileTree.txt new file mode 100644 index 00000000..2ceae371 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/basic/fileTree.txt @@ -0,0 +1,33 @@ +/ + basic/ + alltypes/ + index.html + demo/ + -a/ + -init-.html + index.html + p.html + -greeter/ + -init-.html + greet.html + index.html + name.html + -some-interface.html + -some-sub-type/ + -init-.html + index.html + -some-type/ + -init-.html + index.html + constructor.html + index.html + main.html + p1.-my-binary-class/ + index.html + test.html + str.html + x.html + index-outline.html + index.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/basic/settings.gradle b/integration-tests/gradle-integration-tests/testData/basic/settings.gradle new file mode 100644 index 00000000..c36a146c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/basic/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "basic" \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt b/integration-tests/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt new file mode 100644 index 00000000..3d7bcb51 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt @@ -0,0 +1,45 @@ +package demo + +import p1.MyBinaryClass + +/** + * This class supports greeting people by name. + * + * @property name The name of the person to be greeted. + */ +class Greeter(val name: String) { + + /** + * Prints the greeting to the standard output. + */ + fun greet() { + println("Hello $name!") + } +} + +fun main(args: Array) { + Greeter(args[0]).greet() +} + +val str = "Hello! ".repeat(4) +val x: (a: String, b: Int) -> Int = { a, b -> 0 } + +interface SomeInterface +private class SomeImpl : SomeInterface + +fun SomeInterface.constructor(): SomeInterface { + return SomeImpl() +} + +open class SomeType +class SomeSubType : SomeType() + +fun SomeType.constructor(): SomeType { + return SomeSubType() +} + + +annotation class A(val p: String) + +val MyBinaryClass.test get() = s() + diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle new file mode 100644 index 00000000..0ea86d4c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'org.jetbrains.dokka' +} + +subprojects { + buildscript { + repositories { + mavenCentral() + jcenter() + maven { url "https://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" + } + } + repositories { + mavenCentral() + jcenter() + maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} + +dependencies { + dokkaRuntime files(dokka_fatjar) +} + +apply plugin: 'org.jetbrains.dokka' + +dokka { + configuration { + kotlinTasks { + [":subA:compileKotlin", ":subB:compileKotlin"] + } + } +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt new file mode 100644 index 00000000..5624fca6 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt @@ -0,0 +1,33 @@ +/ + multi-project-root/ + alltypes/ + index.html + index-outline.html + index.html + package-list + s1/ + -my-class/ + -init-.html + index.html + otherworks.html + -super/ + -init-.html + bar.html + foo.html + index.html + index.html + some-cool-thing.html + s2/ + -cooler/ + -init-.html + a.html + coolest.html + index.html + my-class.html + -superful/ + -init-.html + bar.html + index.html + index.html + main.html + style.css diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle new file mode 100644 index 00000000..283cc526 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "multiProjectRoot" + +include 'subA', 'subB' \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle new file mode 100644 index 00000000..0600411e --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle @@ -0,0 +1,6 @@ +apply plugin: 'kotlin' + +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 +} diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt new file mode 100644 index 00000000..126d7f3e --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt @@ -0,0 +1,31 @@ +package s1 + +/** + * Coolest one + */ +fun someCoolThing(s: String) = s.repeat(2) + +/** + * Just a class + */ +class MyClass { + /** + * Ultimate answer to all questions + */ + fun otherworks(): Int = 42 +} + +/** + * Just a SUPER class + */ +open class Super { + /** + * Same as [MyClass.otherworks] + */ + fun foo(i: Int = 21) = i * 2 + + /** + * magic + */ + open fun bar() = foo() +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle new file mode 100644 index 00000000..7b8ff9f3 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle @@ -0,0 +1,7 @@ +apply plugin: 'kotlin' + +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 + compile project(":subA") +} diff --git a/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt new file mode 100644 index 00000000..8a87590a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt @@ -0,0 +1,31 @@ +package s2 + +import s1.Super +import s1.MyClass +import s1.someCoolThing + +/** + * Just an entry-point + */ +fun main(args: Array) { + +} + +/** + * Take a glass of hot water + */ +class Cooler { + val myClass = MyClass() + val a = myClass.otherworks() + val coolest = someCoolThing() +} + +/** + * Powerful + */ +class Superful : Super() { + /** + * Overriden magic + */ + override fun bar() = foo(20) * 2 +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/multiplatformProject/build.gradle b/integration-tests/gradle-integration-tests/testData/multiplatformProject/build.gradle new file mode 100644 index 00000000..b5454c55 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiplatformProject/build.gradle @@ -0,0 +1,60 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url "https://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' +} + +repositories { + jcenter() + mavenLocal() +} + +group 'org.test' +version '1.0-SNAPSHOT' + +apply plugin: "org.jetbrains.kotlin.multiplatform" + +kotlin { + jvm() // Create a JVM target with the default name 'jvm' + js() + sourceSets { + jsMain { + dependencies{ + implementation "org.jetbrains.kotlin:kotlin-stdlib-js" + } + } + jvmMain { + dependencies { + implementation kotlin('stdlib-jdk8') + } + } + } +} + +dependencies { + dokkaRuntime files(dokka_fatjar) +} + +apply plugin: 'org.jetbrains.dokka' + +dokka { + + multiplatform { + javascript { + targets = ["js"] + platform = "js" + kotlinTasks { [tasks.getByPath(":compileKotlinJs")] } + } + jvm {} + } +} diff --git a/integration-tests/gradle-integration-tests/testData/multiplatformProject/fileTree.txt b/integration-tests/gradle-integration-tests/testData/multiplatformProject/fileTree.txt new file mode 100644 index 00000000..e9cc847c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiplatformProject/fileTree.txt @@ -0,0 +1,18 @@ +/ + multiplatform-project-root/ + alltypes/ + index.html + index-outline.html + index.html + org.kotlintestmpp/ + get-current-date.html + index.html + js.html + jvm.html + kotlin.-string/ + index.html + my-extension.html + main.html + shared.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/multiplatformProject/settings.gradle b/integration-tests/gradle-integration-tests/testData/multiplatformProject/settings.gradle new file mode 100644 index 00000000..0bb1e91b --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiplatformProject/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "multiplatformProjectRoot" diff --git a/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt b/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt new file mode 100644 index 00000000..a77b50f9 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt @@ -0,0 +1,14 @@ +package org.kotlintestmpp + +fun main(args : Array) { + console.log("Hello, world!") +} + +fun js(){} +fun shared(){} + +fun getCurrentDate(): String { + return "test" +} + +fun String.myExtension() = println("test") \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt b/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt new file mode 100644 index 00000000..96d725fc --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt @@ -0,0 +1,20 @@ +package org.kotlintestmpp + + +fun main(args : Array) { + println("Hello, world!") +} + +/** + * comment for this class + */ +fun jvm(){} +fun shared(){} + +fun getCurrentDate(): String { + return "test" +} + +fun String.myExtension() = println("test2") + + diff --git a/integration-tests/gradle-integration-tests/testData/sourcesChange/build.gradle b/integration-tests/gradle-integration-tests/testData/sourcesChange/build.gradle new file mode 100644 index 00000000..a6270e23 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/sourcesChange/build.gradle @@ -0,0 +1,35 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" + } + maven { + url "https://dl.bintray.com/kotlin/kotlin-dev" + } +} + +dependencies { + dokkaRuntime files(dokka_fatjar) + compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version + compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version +} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree.txt b/integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree.txt new file mode 100644 index 00000000..09f3724b --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree1.txt b/integration-tests/gradle-integration-tests/testData/sourcesChange/fileTree1.txt new file mode 100644 index 00000000..eeb377f7 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/sourcesChange/settings.gradle b/integration-tests/gradle-integration-tests/testData/sourcesChange/settings.gradle new file mode 100644 index 00000000..3fb032bf --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/sourcesChange/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "sourcesChange" \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt b/integration-tests/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt new file mode 100644 index 00000000..c54dea50 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt b/integration-tests/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt new file mode 100644 index 00000000..53f22ff5 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle b/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle new file mode 100644 index 00000000..8688ae41 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle @@ -0,0 +1,73 @@ +import org.jetbrains.dokka.* +import org.jetbrains.dokka.gradle.* +import org.jetbrains.kotlin.gradle.tasks.* + +import groovy.transform.CompileStatic +import java.util.concurrent.Callable + +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + +apply plugin: 'kotlin' + +@CompileStatic +def configureDokkaTypeSafely(DokkaTask dokka) { + dokka.with { + outputFormat = "some String" + outputDirectory = "some String" + cacheRoot = null as String + impliedPlatforms = new ArrayList() + } + dokka.configuration.with { + moduleName = "some String" + classpath = Arrays.asList("someClassDir") + includes = Collections. emptyList() + samples = Collections. emptyList() + jdkVersion = 6 + sourceRoots = new ArrayList() as List + + includeNonPublic = false + skipDeprecated = false + skipEmptyPackages = true + reportUndocumented = true + perPackageOptions = new ArrayList() as List + externalDocumentationLinks = new ArrayList() + noStdlibLink = false + languageVersion = null as String + apiVersion = null as String + sourceRoot(new Action() { + @Override + void execute(GradleSourceRootImpl sourceRoot) { + sourceRoot.path = "some String" + } + }) + externalDocumentationLink(new Action() { + @Override + void execute(GradleExternalDocumentationLinkImpl link) { + link.url = uri("some URI").toURL() + link.packageListUrl = uri("some URI").toURL() + } + }) + kotlinTasks(new Callable>() { + @Override + List call() { + return defaultKotlinTasks() + } + }) + } +} + +project.tasks.withType(DokkaTask) { dokka -> + configureDokkaTypeSafely(dokka) +} diff --git a/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle b/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle new file mode 100644 index 00000000..be82e328 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "type-safe-configuration" \ No newline at end of file diff --git a/runners/gradle-integration-tests/android-licenses/android-sdk-license b/runners/gradle-integration-tests/android-licenses/android-sdk-license deleted file mode 100644 index c311cf48..00000000 --- a/runners/gradle-integration-tests/android-licenses/android-sdk-license +++ /dev/null @@ -1,2 +0,0 @@ - -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 deleted file mode 100644 index da4552d2..00000000 --- a/runners/gradle-integration-tests/android-licenses/android-sdk-preview-license +++ /dev/null @@ -1,2 +0,0 @@ - -84831b9409646a918e30573bab4c9c91346d8abd \ No newline at end of file diff --git a/runners/gradle-integration-tests/build.gradle b/runners/gradle-integration-tests/build.gradle deleted file mode 100644 index 2430d46b..00000000 --- a/runners/gradle-integration-tests/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -apply plugin: 'kotlin' - -sourceCompatibility = 1.8 - -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict" - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -configurations { - dokkaPlugin - dokkaFatJar - kotlinGradle -} - -dependencies { - - testCompileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', 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') - dokkaFatJar project(path: ":runners:fatjar", configuration: 'shadow') - - kotlinGradle "org.jetbrains.kotlin:kotlin-gradle-plugin" - - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile gradleTestKit() -} - - - -task createClasspathManifest { - def outputDir = file("$buildDir/$name") - - inputs.files(configurations.dokkaPlugin + configurations.dokkaFatJar) - outputs.dir outputDir - - doLast { - outputDir.mkdirs() - file("$outputDir/dokka-plugin-classpath.txt").text = configurations.dokkaPlugin.join("\n") - file("$outputDir/fatjar.txt").text = configurations.dokkaFatJar.join("\n") - file("$outputDir/kotlin-gradle.txt").text = configurations.kotlinGradle.join("\n") - } -} - - -createClasspathManifest.mustRunAfter project(":runners:fatjar").shadowJar -testClasses.dependsOn project(":runners:fatjar").shadowJar -testClasses.dependsOn createClasspathManifest - -test { - systemProperty "android.licenses.overwrite", project.findProperty("android.licenses.overwrite") ?: "" - inputs.dir(file('testData')) -} \ No newline at end of file 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 deleted file mode 100644 index c3fe2ea9..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractAndroidAppTest.kt +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index 334fc7c8..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaAndroidGradleTest.kt +++ /dev/null @@ -1,45 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.junit.BeforeClass -import java.io.File - -abstract class AbstractDokkaAndroidGradleTest : AbstractDokkaGradleTest() { - - override val pluginClasspath: List = pluginClasspathData.toFile().readLines().map { File(it) } - - 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/AbstractDokkaGradleTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt deleted file mode 100644 index 4814e707..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaGradleTest.kt +++ /dev/null @@ -1,108 +0,0 @@ -package org.jetbrains.dokka.gradle - - -import com.intellij.rt.execution.junit.FileComparisonFailure -import org.gradle.testkit.runner.GradleRunner -import org.junit.Rule -import org.junit.rules.TemporaryFolder -import java.io.File -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths - - -val testDataFolder: Path = Paths.get("testData") - -val pluginClasspathData: Path = Paths.get("build", "createClasspathManifest", "dokka-plugin-classpath.txt") - -val dokkaFatJarPathData: Path = pluginClasspathData.resolveSibling("fatjar.txt") - -val androidLocalProperties = testDataFolder.resolve("android.local.properties").let { if (Files.exists(it)) it else null } - -abstract class AbstractDokkaGradleTest { - @get:Rule val testProjectDir = TemporaryFolder() - - open val pluginClasspath: List = pluginClasspathData.toFile().readLines().map { File(it) } - - fun checkOutputStructure(expected: String, actualSubpath: String) { - val expectedPath = testDataFolder.resolve(expected) - val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() - - assertEqualsIgnoringSeparators(expectedPath.toFile(), buildString { - actualPath.toFile().writeStructure(this, File(actualPath.toFile(), ".")) - }) - } - - fun checkNoErrorClasses(actualSubpath: String, extension: String = "html", errorClassMarker: String = "ERROR CLASS") { - val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() - var checked = 0 - Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { - val text = it.toFile().readText() - - val noErrorClasses = text.replace(errorClassMarker, "?!") - - if (noErrorClasses != text) { - throw FileComparisonFailure("", noErrorClasses, text, null) - } - - checked++ - } - println("$checked files checked for error classes") - } - - fun checkNoUnresolvedLinks(actualSubpath: String, extension: String = "html", marker: Regex = "[\"']#[\"']".toRegex()) { - val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() - var checked = 0 - Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { - val text = it.toFile().readText() - - val noErrorClasses = text.replace(marker, "?!") - - if (noErrorClasses != text) { - throw FileComparisonFailure("", noErrorClasses, text, null) - } - - checked++ - } - println("$checked files checked for unresolved links") - } - - fun checkExternalLink(actualSubpath: String, linkBody: String, fullLink: String, extension: String = "html") { - val match = "!!match!!" - val notMatch = "!!not-match!!" - - val actualPath = testProjectDir.root.toPath().resolve(actualSubpath).normalize() - var checked = 0 - var totalEntries = 0 - Files.walk(actualPath).filter { Files.isRegularFile(it) && it.fileName.toString().endsWith(".$extension") }.forEach { - val text = it.toFile().readText() - - val textWithoutMatches = text.replace(fullLink, match) - - val textWithoutNonMatches = textWithoutMatches.replace(linkBody, notMatch) - - if (textWithoutNonMatches != textWithoutMatches) { - - val expected = textWithoutNonMatches.replace(notMatch, fullLink).replace(match, fullLink) - val actual = textWithoutMatches.replace(match, fullLink) - - throw FileComparisonFailure("", expected, actual, null) - } - if (text != textWithoutMatches) - totalEntries++ - - checked++ - } - println("$checked files checked for valid external links '$linkBody', found $totalEntries links") - } - - fun configure(gradleVersion: String = "3.5", kotlinVersion: String = "1.1.2", arguments: Array): GradleRunner { - val fatjar = dokkaFatJarPathData.toFile().readText() - - return GradleRunner.create().withProjectDir(testProjectDir.root) - .withArguments("-Pdokka_fatjar=$fatjar", "-Ptest_kotlin_version=$kotlinVersion", *arguments) - .withPluginClasspath(pluginClasspath) - .withGradleVersion(gradleVersion) - .withDebug(true) - } -} \ 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 deleted file mode 100644 index bbb63909..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAppTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.junit.Test - -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`() { - 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)) - } - - @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/AndroidLibDependsOnJavaLibTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt deleted file mode 100644 index 9bc52273..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidLibDependsOnJavaLibTest.kt +++ /dev/null @@ -1,48 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Test -import kotlin.test.assertEquals - -class AndroidLibDependsOnJavaLibTest: AbstractDokkaAndroidGradleTest() { - - private val testDataRootPath = "androidLibDependsOnJavaLib" - - private fun prepareTestData() { - val testDataRoot = testDataFolder.resolve(testDataRootPath) - val tmpRoot = testProjectDir.root.toPath() - - testDataRoot.copy(tmpRoot) - - androidLocalProperties?.copy(tmpRoot.resolve("local.properties")) - } - - - private fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AbstractAndroidAppTest.AndroidPluginParams) { - prepareTestData() - - val result = configure(gradleVersion, kotlinVersion, - arguments = arrayOf("dokka", "--stacktrace") + androidPluginParams.asArguments()) - .build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":lib:dokka")?.outcome) - - val docsOutput = "lib/build/dokka" - - checkOutputStructure("$testDataRootPath/fileTree.txt", docsOutput) - - checkNoErrorClasses(docsOutput) - checkNoUnresolvedLinks(docsOutput) - - checkExternalLink(docsOutput, "LibClz", - """LibClz""") - } - - - @Test - fun `test kotlin 1_2_20 and gradle 4_5 and abt 3_0_1`() { - doTest("4.5", "1.2.20", AbstractAndroidAppTest.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 deleted file mode 100644 index ef1b94d8..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidMultiFlavourAppTest.kt +++ /dev/null @@ -1,60 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.dokka.gradle.AbstractAndroidAppTest.AndroidPluginParams -import org.junit.Test -import kotlin.test.assertEquals - -class AndroidMultiFlavourAppTest : AbstractDokkaAndroidGradleTest() { - - 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")) - } - - private fun doTest(gradleVersion: String, kotlinVersion: String, androidPluginParams: AndroidPluginParams) { - prepareTestData("androidMultiFlavourApp") - - val result = configure(gradleVersion, kotlinVersion, - arguments = arrayOf("dokka", "dokkaFullFlavourOnly", "--stacktrace") + androidPluginParams.asArguments()) - .build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokka")?.outcome) - assertEquals(TaskOutcome.SUCCESS, result.task(":app:dokkaFullFlavourOnly")?.outcome) - - val docsOutput = "app/build/dokka" - - checkOutputStructure("androidMultiFlavourApp/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`() { - 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)) - } - - @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 deleted file mode 100644 index 2e1a0d41..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt +++ /dev/null @@ -1,51 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Test -import kotlin.test.assertEquals - -class BasicTest : AbstractDokkaGradleTest() { - - fun prepareTestData(testDataRootPath: String) { - val testDataRoot = testDataFolder.resolve(testDataRootPath) - 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")) - } - - private fun doTest(gradleVersion: String, kotlinVersion: String) { - - prepareTestData("basic") - - val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) - - val docsOutput = "build/dokka" - - checkOutputStructure("basic/fileTree.txt", docsOutput) - - checkNoErrorClasses(docsOutput) - checkNoUnresolvedLinks(docsOutput) - - checkExternalLink(docsOutput, "String", - """String""") - } - - @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") - } - - @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 deleted file mode 100644 index 3a4d08b8..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/JavadocRSuppressionTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -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)) - } - - @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 deleted file mode 100644 index 9458528c..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiProjectSingleOutTest.kt +++ /dev/null @@ -1,57 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Test -import kotlin.test.assertEquals - -class MultiProjectSingleOutTest : AbstractDokkaGradleTest() { - - fun prepareTestData(testDataRootPath: String) { - val testDataRoot = testDataFolder.resolve(testDataRootPath) - val tmpRoot = testProjectDir.root.toPath() - - testDataRoot.apply { - resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) - resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) - resolve("subA").copy(tmpRoot.resolve("subA")) - resolve("subB").copy(tmpRoot.resolve("subB")) - } - } - - private fun doTest(gradleVersion: String, kotlinVersion: String) { - - prepareTestData("multiProjectSingleOut") - - val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")).build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) - - val docsOutput = "build/dokka" - - checkOutputStructure("multiProjectSingleOut/fileTree.txt", docsOutput) - - checkNoErrorClasses(docsOutput) - checkNoUnresolvedLinks(docsOutput) - - checkExternalLink(docsOutput, "String", - """String""") - } - - @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") - } - - @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/MultiplatformProjectTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt deleted file mode 100644 index 3e61d79e..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt +++ /dev/null @@ -1,54 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.testkit.runner.TaskOutcome -import org.junit.Test -import java.io.File -import kotlin.test.assertEquals - -class MultiplatformProjectTest : AbstractDokkaGradleTest() { - - fun prepareTestData(testDataRootPath: String) { - val testDataRoot = testDataFolder.resolve(testDataRootPath) - val tmpRoot = testProjectDir.root.toPath() - - testDataRoot.apply { - resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) - resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) - resolve("src").copy(tmpRoot.resolve("src")) - } - } - - private fun doTest(gradleVersion: String, kotlinVersion: String) { - val kotlinGradlePlugin = pluginClasspathData.resolveSibling("kotlin-gradle.txt").toFile().readLines().map { File(it) } - prepareTestData("multiplatformProject") - - // Remove withDebug(false) when https://github.com/gradle/gradle/issues/6862 is solved - val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace")) - .withDebug(false) - .withPluginClasspath(pluginClasspath.union(kotlinGradlePlugin)) - .build() - - println(result.output) - - assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome) - - val docsOutput = "build/dokka" - - checkOutputStructure("multiplatformProject/fileTree.txt", docsOutput) - - checkNoErrorClasses(docsOutput) - checkNoUnresolvedLinks(docsOutput) - } - - @Test fun `test kotlin 1_3_30 and gradle 4_7`() { - doTest("4.7", "1.3.30") - } - - @Test fun `test kotlin 1_3_40 and gradle 4_10_3`() { - doTest("4.10.3", "1.3.40") - } - - @Test fun `test kotlin 1_3_40 and gradle 5_6_1`() { - doTest("5.6.1", "1.3.50") - } -} \ 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 deleted file mode 100644 index 8b2db560..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/RebuildAfterSourceChangeTest.kt +++ /dev/null @@ -1,74 +0,0 @@ -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", "-i", "--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_0_7 and gradle 2_14_1`() { - doTest("2.14.1", "1.0.7") - } - - @Test - fun `test kotlin 1_1_2 and gradle 3_5`() { - doTest("3.5", "1.1.2") - } - - @Test - 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-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt deleted file mode 100644 index 7b179e92..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/TypeSafeConfigurationTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.Parameterized - -@RunWith(Parameterized::class) -class TypeSafeConfigurationTest(private val testCase: TestCase) : AbstractDokkaGradleTest() { - - data class TestCase(val gradleVersion: String, val kotlinVersion: String) { - override fun toString(): String = "Gradle $gradleVersion and Kotlin $kotlinVersion" - } - - companion object { - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun testCases() = listOf( - TestCase("4.0", "1.1.2"), - TestCase("4.5", "1.2.20"), - TestCase("4.10.1", "1.2.60") - ) - } - - @Test - fun test() { - - testDataFolder.resolve("typeSafeConfiguration").toFile() - .copyRecursively(testProjectDir.root) - - configure( - testCase.gradleVersion, - testCase.kotlinVersion, - arguments = arrayOf("help", "-s") - ).build() - } -} 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 deleted file mode 100644 index 6f17af22..00000000 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/Utils.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.jetbrains.dokka.gradle - -import com.intellij.rt.execution.junit.FileComparisonFailure -import java.io.File -import java.io.IOException -import java.nio.file.* -import java.nio.file.attribute.BasicFileAttributes - - -fun File.writeStructure(builder: StringBuilder, relativeTo: File = this, spaces: Int = 0) { - builder.append(" ".repeat(spaces)) - val out = if (this != relativeTo) this.relativeTo(relativeTo) else this - - builder.append(out) - if (this.isDirectory) { - builder.appendln("/") - this.listFiles().sortedBy { it.name }.forEach { it.writeStructure(builder, this, spaces + 4) } - } else { - builder.appendln() - } -} - -fun assertEqualsIgnoringSeparators(expectedFile: File, output: String) { - if (!expectedFile.exists()) expectedFile.createNewFile() - val expectedText = expectedFile.readText().replace("\r\n", "\n") - val actualText = output.replace("\r\n", "\n") - - if (expectedText != actualText) - throw FileComparisonFailure("", expectedText, actualText, expectedFile.canonicalPath) -} - -class CopyFileVisitor(private var sourcePath: Path?, private val targetPath: Path) : SimpleFileVisitor() { - - @Throws(IOException::class) - override fun preVisitDirectory(dir: Path, - attrs: BasicFileAttributes): FileVisitResult { - if (sourcePath == null) { - sourcePath = dir - } else { - Files.createDirectories(targetPath.resolve(sourcePath?.relativize(dir))) - } - return FileVisitResult.CONTINUE - } - - @Throws(IOException::class) - override fun visitFile(file: Path, - attrs: BasicFileAttributes): FileVisitResult { - Files.copy(file, targetPath.resolve(sourcePath?.relativize(file)), StandardCopyOption.REPLACE_EXISTING) - return FileVisitResult.CONTINUE - } -} - -fun Path.copy(to: Path) { - Files.walkFileTree(this, CopyFileVisitor(this, to)) -} - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/build.gradle b/runners/gradle-integration-tests/testData/androidApp/app/build.gradle deleted file mode 100644 index 2420107c..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/build.gradle +++ /dev/null @@ -1,45 +0,0 @@ -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - -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" - dokkaRuntime files(dokka_fatjar) -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml deleted file mode 100644 index b4e1a892..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java deleted file mode 100644 index 3668c594..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -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/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt deleted file mode 100644 index ca2f27b0..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt +++ /dev/null @@ -1,28 +0,0 @@ -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/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e5..00000000 Binary files a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047df..00000000 Binary files a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d760..00000000 Binary files a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index ede57c39..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml deleted file mode 100644 index d707536a..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/layout/activity_main2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/menu/main_activity2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml deleted file mode 100644 index 47c82246..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 16dp - 16dp - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml deleted file mode 100644 index d8f08bc2..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - AndroidSample - Settings - Hello world! - JavaActivity - KotlinActivity - - diff --git a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml deleted file mode 100644 index 6ce89c7b..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidApp/build.gradle b/runners/gradle-integration-tests/testData/androidApp/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://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 "https://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/androidApp/fileTree.txt b/runners/gradle-integration-tests/testData/androidApp/fileTree.txt deleted file mode 100644 index f66c79e3..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/fileTree.txt +++ /dev/null @@ -1,20 +0,0 @@ -/ - app/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidApp/settings.gradle b/runners/gradle-integration-tests/testData/androidApp/settings.gradle deleted file mode 100644 index 1feb2867..00000000 --- a/runners/gradle-integration-tests/testData/androidApp/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidApp" - -include ':app' \ 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 deleted file mode 100644 index 66421f52..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-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" - dokkaRuntime files(dokka_fatjar) -} - - -dokka { - outputFormat = "javadoc" -} \ 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 deleted file mode 100644 index b4e1a892..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 3668c594..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index ca2f27b0..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 96a442e5..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index 359047df..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index 71c6d760..00000000 Binary files a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null 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 deleted file mode 100644 index ede57c39..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index d707536a..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/layout/activity_main2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - 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 deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 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 deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/menu/main_activity2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 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 deleted file mode 100644 index 47c82246..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 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 deleted file mode 100644 index d8f08bc2..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - 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 deleted file mode 100644 index 6ce89c7b..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle b/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://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 "https://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 deleted file mode 100644 index c5e79eba..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/fileTree.txt +++ /dev/null @@ -1,21 +0,0 @@ -/ - 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 deleted file mode 100644 index a4e67fea..00000000 --- a/runners/gradle-integration-tests/testData/androidAppJavadoc/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidAppJavadoc" - -include ':app' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle deleted file mode 100644 index 736668ab..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -subprojects { - buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } - - } - - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt deleted file mode 100644 index 6c96a01c..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/fileTree.txt +++ /dev/null @@ -1,14 +0,0 @@ -/ - lib/ - alltypes/ - index.html - example/ - -lib-clz-use/ - -init-.html - f.html - index.html - index.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle deleted file mode 100644 index bbfeb03c..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/build.gradle +++ /dev/null @@ -1 +0,0 @@ -apply plugin: 'java' diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java deleted file mode 100644 index 1d9a6fb2..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/jlib/src/main/java/example/jlib/LibClz.java +++ /dev/null @@ -1,5 +0,0 @@ -package example.jlib; - -public class LibClz { - -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle deleted file mode 100644 index b1ee52ab..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -buildscript { - dependencies { - classpath "com.android.tools.build:gradle:$abt_plugin_version" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - - -android { - compileSdkVersion Integer.parseInt(sdk_version) - buildToolsVersion abt_version - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } -} - -dependencies { - api(project(":jlib")) - dokkaRuntime files(dokka_fatjar) -} - -dokka { - configuration { - externalDocumentationLink { - url = new URL("https://example.com") - packageListUrl = file("$rootDir/package-list").toURI().toURL() - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml deleted file mode 100644 index 267f6efd..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt deleted file mode 100644 index d034a3a9..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/lib/src/main/kotlin/example/LibClzUse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package example - -import example.jlib.LibClz - -/** - * Uses jlib - */ -class LibClzUse { - /** - * Returns LibClz - */ - fun f(): LibClz = LibClz() -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list deleted file mode 100644 index bf76058e..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/package-list +++ /dev/null @@ -1 +0,0 @@ -example.jlib \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle b/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle deleted file mode 100644 index 5b4250a0..00000000 --- a/runners/gradle-integration-tests/testData/androidLibDependsOnJavaLib/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = "androidLibDependsOnJavaLib" - - -include(":lib") -include(":jlib") \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle deleted file mode 100644 index 660257ab..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - -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') - } - } - - flavorDimensions "mode" - productFlavors { - free { - dimension "mode" - applicationIdSuffix ".free" - versionNameSuffix "-free" - } - full { - dimension "mode" - applicationIdSuffix ".full" - versionNameSuffix "-full" - } - } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - free.java.srcDirs += 'src/free/kotlin' - } -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" - dokkaRuntime files(dokka_fatjar) -} - - -dokka { - outputDirectory = "$buildDir/dokka/all" -} - -task dokkaFullFlavourOnly(type: org.jetbrains.dokka.gradle.DokkaTask) { - outputDirectory = "$buildDir/dokka/fullOnly" - configuration { - moduleName = "full" - kotlinTasks { - ["compileFullReleaseKotlin"] - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml deleted file mode 100644 index 3ecbcd3a..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt deleted file mode 100644 index b0b980fd..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.example.kotlin.mixed.free - -import android.os.Bundle -import android.app.Activity -import org.example.kotlin.mixed.R - -class AdActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_ad) - } - -} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml deleted file mode 100644 index e6443d05..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml deleted file mode 100644 index bbdf2d06..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AdActivity - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml deleted file mode 100644 index b4e1a892..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java deleted file mode 100644 index 3668c594..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java +++ /dev/null @@ -1,34 +0,0 @@ -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/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt deleted file mode 100644 index ca2f27b0..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt +++ /dev/null @@ -1,28 +0,0 @@ -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/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 96a442e5..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 359047df..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 71c6d760..00000000 Binary files a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index ede57c39..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml deleted file mode 100644 index d707536a..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml deleted file mode 100644 index f3b10b6c..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml deleted file mode 100644 index 47c82246..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 16dp - 16dp - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml deleted file mode 100644 index d8f08bc2..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - AndroidSample - Settings - Hello world! - JavaActivity - KotlinActivity - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml deleted file mode 100644 index 6ce89c7b..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle deleted file mode 100644 index 35356b90..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url 'https://maven.google.com' } - maven { url "https://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 "https://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/androidMultiFlavourApp/fileTree.txt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt deleted file mode 100644 index 77b563b2..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt +++ /dev/null @@ -1,47 +0,0 @@ -/ - all/ - app/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - org.example.kotlin.mixed.free/ - -ad-activity/ - -init-.html - index.html - on-create.html - index.html - package-list - style.css - fullOnly/ - full/ - alltypes/ - index.html - index-outline.html - index.html - org.example.kotlin.mixed/ - -java-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - -kotlin-activity/ - -init-.html - index.html - on-create-options-menu.html - on-create.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle deleted file mode 100644 index 1feb2867..00000000 --- a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "androidApp" - -include ':app' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/build.gradle b/runners/gradle-integration-tests/testData/basic/build.gradle deleted file mode 100644 index 79645204..00000000 --- a/runners/gradle-integration-tests/testData/basic/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" - } - maven { - url "https://dl.bintray.com/kotlin/kotlin-dev" - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) - 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 { - configuration { - classpath += "$projectDir/classDir" - } -} \ 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 deleted file mode 100644 index ccfff300..00000000 Binary files a/runners/gradle-integration-tests/testData/basic/classDir/p1/MyBinaryClass.class and /dev/null differ diff --git a/runners/gradle-integration-tests/testData/basic/fileTree.txt b/runners/gradle-integration-tests/testData/basic/fileTree.txt deleted file mode 100644 index 2ceae371..00000000 --- a/runners/gradle-integration-tests/testData/basic/fileTree.txt +++ /dev/null @@ -1,33 +0,0 @@ -/ - basic/ - alltypes/ - index.html - demo/ - -a/ - -init-.html - index.html - p.html - -greeter/ - -init-.html - greet.html - index.html - name.html - -some-interface.html - -some-sub-type/ - -init-.html - index.html - -some-type/ - -init-.html - index.html - constructor.html - index.html - main.html - p1.-my-binary-class/ - index.html - test.html - str.html - x.html - index-outline.html - index.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/basic/settings.gradle b/runners/gradle-integration-tests/testData/basic/settings.gradle deleted file mode 100644 index c36a146c..00000000 --- a/runners/gradle-integration-tests/testData/basic/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "basic" \ No newline at end of file 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 deleted file mode 100644 index 3d7bcb51..00000000 --- a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,45 +0,0 @@ -package demo - -import p1.MyBinaryClass - -/** - * This class supports greeting people by name. - * - * @property name The name of the person to be greeted. - */ -class Greeter(val name: String) { - - /** - * Prints the greeting to the standard output. - */ - fun greet() { - println("Hello $name!") - } -} - -fun main(args: Array) { - Greeter(args[0]).greet() -} - -val str = "Hello! ".repeat(4) -val x: (a: String, b: Int) -> Int = { a, b -> 0 } - -interface SomeInterface -private class SomeImpl : SomeInterface - -fun SomeInterface.constructor(): SomeInterface { - return SomeImpl() -} - -open class SomeType -class SomeSubType : SomeType() - -fun SomeType.constructor(): SomeType { - return SomeSubType() -} - - -annotation class A(val p: String) - -val MyBinaryClass.test get() = s() - diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle deleted file mode 100644 index 0ea86d4c..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'org.jetbrains.dokka' -} - -subprojects { - buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://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" - } - } - repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) -} - -apply plugin: 'org.jetbrains.dokka' - -dokka { - configuration { - kotlinTasks { - [":subA:compileKotlin", ":subB:compileKotlin"] - } - } -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt deleted file mode 100644 index 5624fca6..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/fileTree.txt +++ /dev/null @@ -1,33 +0,0 @@ -/ - multi-project-root/ - alltypes/ - index.html - index-outline.html - index.html - package-list - s1/ - -my-class/ - -init-.html - index.html - otherworks.html - -super/ - -init-.html - bar.html - foo.html - index.html - index.html - some-cool-thing.html - s2/ - -cooler/ - -init-.html - a.html - coolest.html - index.html - my-class.html - -superful/ - -init-.html - bar.html - index.html - index.html - main.html - style.css diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle deleted file mode 100644 index 283cc526..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = "multiProjectRoot" - -include 'subA', 'subB' \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle deleted file mode 100644 index 0600411e..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -apply plugin: 'kotlin' - -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 -} diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt deleted file mode 100644 index 126d7f3e..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subA/src/main/kotlin/module.kt +++ /dev/null @@ -1,31 +0,0 @@ -package s1 - -/** - * Coolest one - */ -fun someCoolThing(s: String) = s.repeat(2) - -/** - * Just a class - */ -class MyClass { - /** - * Ultimate answer to all questions - */ - fun otherworks(): Int = 42 -} - -/** - * Just a SUPER class - */ -open class Super { - /** - * Same as [MyClass.otherworks] - */ - fun foo(i: Int = 21) = i * 2 - - /** - * magic - */ - open fun bar() = foo() -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle deleted file mode 100644 index 7b8ff9f3..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -apply plugin: 'kotlin' - -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 - compile project(":subA") -} diff --git a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt b/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt deleted file mode 100644 index 8a87590a..00000000 --- a/runners/gradle-integration-tests/testData/multiProjectSingleOut/subB/src/main/kotlin/module.kt +++ /dev/null @@ -1,31 +0,0 @@ -package s2 - -import s1.Super -import s1.MyClass -import s1.someCoolThing - -/** - * Just an entry-point - */ -fun main(args: Array) { - -} - -/** - * Take a glass of hot water - */ -class Cooler { - val myClass = MyClass() - val a = myClass.otherworks() - val coolest = someCoolThing() -} - -/** - * Powerful - */ -class Superful : Super() { - /** - * Overriden magic - */ - override fun bar() = foo(20) * 2 -} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle b/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle deleted file mode 100644 index b5454c55..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://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' -} - -repositories { - jcenter() - mavenLocal() -} - -group 'org.test' -version '1.0-SNAPSHOT' - -apply plugin: "org.jetbrains.kotlin.multiplatform" - -kotlin { - jvm() // Create a JVM target with the default name 'jvm' - js() - sourceSets { - jsMain { - dependencies{ - implementation "org.jetbrains.kotlin:kotlin-stdlib-js" - } - } - jvmMain { - dependencies { - implementation kotlin('stdlib-jdk8') - } - } - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) -} - -apply plugin: 'org.jetbrains.dokka' - -dokka { - - multiplatform { - javascript { - targets = ["js"] - platform = "js" - kotlinTasks { [tasks.getByPath(":compileKotlinJs")] } - } - jvm {} - } -} diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt b/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt deleted file mode 100644 index e9cc847c..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/fileTree.txt +++ /dev/null @@ -1,18 +0,0 @@ -/ - multiplatform-project-root/ - alltypes/ - index.html - index-outline.html - index.html - org.kotlintestmpp/ - get-current-date.html - index.html - js.html - jvm.html - kotlin.-string/ - index.html - my-extension.html - main.html - shared.html - package-list - style.css diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle b/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle deleted file mode 100644 index 0bb1e91b..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "multiplatformProjectRoot" diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt b/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt deleted file mode 100644 index a77b50f9..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/src/jsMain/kotlin/org/kotlintestmpp/main.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.kotlintestmpp - -fun main(args : Array) { - console.log("Hello, world!") -} - -fun js(){} -fun shared(){} - -fun getCurrentDate(): String { - return "test" -} - -fun String.myExtension() = println("test") \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt b/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt deleted file mode 100644 index 96d725fc..00000000 --- a/runners/gradle-integration-tests/testData/multiplatformProject/src/jvmMain/kotlin/org/kotlintestmpp/main.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.kotlintestmpp - - -fun main(args : Array) { - println("Hello, world!") -} - -/** - * comment for this class - */ -fun jvm(){} -fun shared(){} - -fun getCurrentDate(): String { - return "test" -} - -fun String.myExtension() = println("test2") - - diff --git a/runners/gradle-integration-tests/testData/sourcesChange/build.gradle b/runners/gradle-integration-tests/testData/sourcesChange/build.gradle deleted file mode 100644 index a6270e23..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -buildscript { - repositories { - mavenCentral() - jcenter() - maven { url "https://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 "https://dl.bintray.com/kotlin/kotlin-eap-1.1" - } - maven { - url "https://dl.bintray.com/kotlin/kotlin-dev" - } -} - -dependencies { - dokkaRuntime files(dokka_fatjar) - compile group: 'org.jetbrains.kotlin', name: 'kotlin-runtime', version: test_kotlin_version - compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: test_kotlin_version -} \ 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 deleted file mode 100644 index 09f3724b..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/fileTree.txt +++ /dev/null @@ -1,10 +0,0 @@ -/ - 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 deleted file mode 100644 index eeb377f7..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/fileTree1.txt +++ /dev/null @@ -1,11 +0,0 @@ -/ - 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 deleted file mode 100644 index 3fb032bf..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c54dea50..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/src/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,6 +0,0 @@ -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 deleted file mode 100644 index 53f22ff5..00000000 --- a/runners/gradle-integration-tests/testData/sourcesChange/src1/main/kotlin/demo/HelloWorld.kt +++ /dev/null @@ -1,11 +0,0 @@ -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-integration-tests/testData/typeSafeConfiguration/build.gradle b/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle deleted file mode 100644 index 8688ae41..00000000 --- a/runners/gradle-integration-tests/testData/typeSafeConfiguration/build.gradle +++ /dev/null @@ -1,73 +0,0 @@ -import org.jetbrains.dokka.* -import org.jetbrains.dokka.gradle.* -import org.jetbrains.kotlin.gradle.tasks.* - -import groovy.transform.CompileStatic -import java.util.concurrent.Callable - -buildscript { - repositories { - jcenter() - mavenLocal() - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" - } -} - -plugins { - id 'org.jetbrains.dokka' -} - -apply plugin: 'kotlin' - -@CompileStatic -def configureDokkaTypeSafely(DokkaTask dokka) { - dokka.with { - outputFormat = "some String" - outputDirectory = "some String" - cacheRoot = null as String - impliedPlatforms = new ArrayList() - } - dokka.configuration.with { - moduleName = "some String" - classpath = Arrays.asList("someClassDir") - includes = Collections. emptyList() - samples = Collections. emptyList() - jdkVersion = 6 - sourceRoots = new ArrayList() as List - - includeNonPublic = false - skipDeprecated = false - skipEmptyPackages = true - reportUndocumented = true - perPackageOptions = new ArrayList() as List - externalDocumentationLinks = new ArrayList() - noStdlibLink = false - languageVersion = null as String - apiVersion = null as String - sourceRoot(new Action() { - @Override - void execute(GradleSourceRootImpl sourceRoot) { - sourceRoot.path = "some String" - } - }) - externalDocumentationLink(new Action() { - @Override - void execute(GradleExternalDocumentationLinkImpl link) { - link.url = uri("some URI").toURL() - link.packageListUrl = uri("some URI").toURL() - } - }) - kotlinTasks(new Callable>() { - @Override - List call() { - return defaultKotlinTasks() - } - }) - } -} - -project.tasks.withType(DokkaTask) { dokka -> - configureDokkaTypeSafely(dokka) -} diff --git a/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle b/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle deleted file mode 100644 index be82e328..00000000 --- a/runners/gradle-integration-tests/testData/typeSafeConfiguration/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "type-safe-configuration" \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 46c6e871..d41c4a04 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,14 +1,13 @@ rootProject.name = "dokka" include 'core', + 'core:testApi', + 'coreDependencies', 'integration', + 'integration-tests:gradle-integration-tests', 'runners:fatjar', 'runners:ant', 'runners:cli', 'runners:maven-plugin', 'runners:gradle-plugin', - 'runners:android-gradle-plugin', - 'runners:gradle-integration-tests', - 'coreDependencies', - 'plugins:javadoc8', - 'core:testApi' + 'plugins:javadoc8' -- cgit From e99be615ce7c2c2b5c3ee5e3f8941c41c1e7a944 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 31 Jan 2020 00:37:29 +0100 Subject: Bump Gradle version, migrate to Kotlin DSL, refactor publishing --- build.gradle | 120 --------------- build.gradle.kts | 43 ++++++ buildSrc/build.gradle | 10 -- buildSrc/build.gradle.kts | 14 ++ .../org/jetbrains/CorrectShadowPublishing.groovy | 40 ----- .../org/jetbrains/DependenciesVersionGetter.groovy | 14 -- .../org/jetbrains/PluginXmlTransformer.groovy | 71 --------- .../main/kotlin/org/jetbrains/BintrayPublishing.kt | 29 ++++ .../kotlin/org/jetbrains/DistMavenPublishing.kt | 28 ++++ .../src/main/kotlin/org/jetbrains/DokkaVersion.kt | 19 +++ core/build.gradle | 72 --------- core/build.gradle.kts | 49 +++++++ core/src/main/kotlin/DokkaBootstrap.kt | 10 ++ core/src/main/kotlin/Java/JavadocParser.kt | 4 - core/src/main/kotlin/configuration.kt | 98 +++++++++++++ core/src/main/kotlin/defaultConfiguration.kt | 74 ++++++++++ .../kotlin/multiplatform/BasicMultiplatformTest.kt | 2 +- coreDependencies/build.gradle | 45 ------ coreDependencies/build.gradle.kts | 43 ++++++ gradle.properties | 9 +- gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 58695 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 29 ++-- integration-tests/build.gradle | 7 - integration-tests/build.gradle.kts | 0 .../gradle-integration-tests/build.gradle | 60 -------- .../gradle-integration-tests/build.gradle.kts | 52 +++++++ integration/build.gradle | 25 ---- .../kotlin/org/jetbrains/dokka/DokkaBootstrap.kt | 10 -- .../main/kotlin/org/jetbrains/dokka/ReflectDsl.kt | 72 --------- .../kotlin/org/jetbrains/dokka/configuration.kt | 98 ------------- .../org/jetbrains/dokka/defaultConfiguration.kt | 74 ---------- plugins/build.gradle | 25 ---- plugins/build.gradle.kts | 11 ++ plugins/mathjax/build.gradle | 17 --- plugins/mathjax/build.gradle.kts | 8 + plugins/xml/build.gradle | 17 --- plugins/xml/build.gradle.kts | 8 + runners/build.gradle | 7 - runners/build.gradle.kts | 6 + runners/cli/build.gradle | 16 -- runners/cli/build.gradle.kts | 37 +++++ runners/fatjar/build.gradle | 78 ---------- runners/gradle-plugin/build.gradle | 108 -------------- runners/gradle-plugin/build.gradle.kts | 74 ++++++++++ .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 10 +- .../org/jetbrains/dokka/gradle/ReflectDsl.kt | 72 +++++++++ .../main/kotlin/org/jetbrains/dokka/gradle/main.kt | 2 +- runners/maven-plugin/build.gradle | 161 --------------------- runners/maven-plugin/build.gradle.kts | 115 +++++++++++++++ runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 3 +- .../src/main/kotlin/MavenDokkaLogger.kt | 6 +- settings.gradle | 16 -- settings.gradle.kts | 29 ++++ testApi/build.gradle | 12 -- testApi/build.gradle.kts | 29 ++++ 56 files changed, 873 insertions(+), 1219 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 buildSrc/build.gradle create mode 100644 buildSrc/build.gradle.kts delete mode 100644 buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy delete mode 100644 buildSrc/src/main/groovy/org/jetbrains/DependenciesVersionGetter.groovy delete mode 100644 buildSrc/src/main/groovy/org/jetbrains/PluginXmlTransformer.groovy create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/DistMavenPublishing.kt create mode 100644 buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt delete mode 100644 core/build.gradle create mode 100644 core/build.gradle.kts create mode 100644 core/src/main/kotlin/DokkaBootstrap.kt create mode 100644 core/src/main/kotlin/configuration.kt create mode 100644 core/src/main/kotlin/defaultConfiguration.kt delete mode 100644 coreDependencies/build.gradle create mode 100644 coreDependencies/build.gradle.kts delete mode 100644 integration-tests/build.gradle create mode 100644 integration-tests/build.gradle.kts delete mode 100644 integration-tests/gradle-integration-tests/build.gradle create mode 100644 integration-tests/gradle-integration-tests/build.gradle.kts delete mode 100644 integration/build.gradle delete mode 100644 integration/src/main/kotlin/org/jetbrains/dokka/DokkaBootstrap.kt delete mode 100644 integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt delete mode 100644 integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt delete mode 100644 integration/src/main/kotlin/org/jetbrains/dokka/defaultConfiguration.kt delete mode 100644 plugins/build.gradle create mode 100644 plugins/build.gradle.kts delete mode 100644 plugins/mathjax/build.gradle create mode 100644 plugins/mathjax/build.gradle.kts delete mode 100644 plugins/xml/build.gradle create mode 100644 plugins/xml/build.gradle.kts delete mode 100644 runners/build.gradle create mode 100644 runners/build.gradle.kts delete mode 100644 runners/cli/build.gradle create mode 100644 runners/cli/build.gradle.kts delete mode 100644 runners/fatjar/build.gradle delete mode 100644 runners/gradle-plugin/build.gradle create mode 100644 runners/gradle-plugin/build.gradle.kts create mode 100644 runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ReflectDsl.kt delete mode 100644 runners/maven-plugin/build.gradle create mode 100644 runners/maven-plugin/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts delete mode 100644 testApi/build.gradle create mode 100644 testApi/build.gradle.kts (limited to 'gradle/wrapper') diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 35fa8667..00000000 --- a/build.gradle +++ /dev/null @@ -1,120 +0,0 @@ -allprojects { - ext { - if (!project.findProperty("dokka_version")) { - final String buildNumber = System.getenv("BUILD_NUMBER") - dokka_version = dokka_version_base + (buildNumber == null || System.getenv("FORCE_SNAPSHOT") != null ? "-SNAPSHOT" : "-$buildNumber") - } - } - - if (project == rootProject) { - println "Publication version: $dokka_version" - } - - group 'org.jetbrains.dokka' - version dokka_version - - - buildscript { - repositories { - mavenCentral() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' - - classpath "com.gradle.publish:plugin-publish-plugin:0.9.10" - } - } - - repositories { - jcenter() - mavenCentral() - mavenLocal() - maven { url 'https://kotlin.bintray.com/kotlin-plugin' } - maven { url 'https://www.jetbrains.com/intellij-repository/releases' } - maven { url "https://dl.bintray.com/jetbrains/markdown" } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } - maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$bundled_kotlin_compiler_version/maven" } - maven { url "https://kotlin.bintray.com/kotlinx" } - maven { url "https://dl.bintray.com/kotlin/kotlinx" } - maven { url "https://dl.bintray.com/orangy/maven" } // TODO: remove this repository when kotlinx.cli is available in maven - } -} - - -def bintrayPublication(project, List _publications) { - configure(project, { - apply plugin: 'com.jfrog.bintray' - - bintray { - user = System.getenv('BINTRAY_USER') - key = System.getenv('BINTRAY_KEY') - - pkg { - repo = dokka_publication_channel - name = 'dokka' - userOrg = 'kotlin' - desc = 'Dokka, the Kotlin documentation tool' - vcsUrl = 'https://github.com/kotlin/dokka.git' - licenses = ['Apache-2.0'] - version { - name = dokka_version - } - } - - publications = _publications - } - }) -} - - -configurations { - ideaIC - intellijCore -} - -repositories { - maven { url 'https://kotlin.bintray.com/kotlin-plugin' } - 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:$idea_version" - ideaIC "com.jetbrains.intellij.idea:ideaIC:$idea_version" -} - -def ideaRT() { - return zipTree(project.configurations.ideaIC.singleFile).matching ({ - include("lib/idea_rt.jar") - }) -} - -def repoLocation = uri(file("$buildDir/dist-maven")) - -allprojects { - - task publishToDistMaven { - group "publishing" - description "Publishes all Maven publications to Maven repository 'distMaven'." - dependsOn tasks.withType(PublishToMavenRepository).matching { - it.repository == publishing.repositories.distMaven - } - } - - plugins.withType(MavenPublishPlugin) { - publishing { - repositories { - maven { - name 'distMaven' - url repoLocation - } - } - } - - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..5540184a --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,43 @@ +import org.jetbrains.configureDistMaven +import org.jetbrains.configureDokkaVersion + +plugins { + kotlin("jvm") apply false + id("com.jfrog.bintray") apply false +} + +allprojects { + configureDokkaVersion() + val dokka_version: String by this + + if (this == rootProject) { + println("Publication version: $dokka_version") + } + group = "org.jetbrains.dokka" + version = dokka_version + + val language_version: String by project + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).all { + kotlinOptions { + freeCompilerArgs += "-Xjsr305=strict" + languageVersion = language_version + apiVersion = language_version + jvmTarget = "1.8" + } + } + + repositories { + jcenter() + mavenCentral() + mavenLocal() + maven(url = "https://dl.bintray.com/jetbrains/markdown/") + } + + configureDistMaven() +} + +subprojects { + apply { + plugin("org.jetbrains.kotlin.jvm") + } +} \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index b62b4150..00000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'groovy' -repositories { - mavenCentral() - jcenter() - maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } -} -dependencies { - compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4' -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..aeec9540 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + `kotlin-dsl` + groovy +} + +repositories { + mavenCentral() + jcenter() +} + +dependencies { + implementation("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4") + implementation("com.github.jengelman.gradle.plugins:shadow:2.0.4") +} diff --git a/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy b/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy deleted file mode 100644 index 62cc3d3c..00000000 --- a/buildSrc/src/main/groovy/org/jetbrains/CorrectShadowPublishing.groovy +++ /dev/null @@ -1,40 +0,0 @@ -package org.jetbrains - -import org.gradle.api.Project -import org.gradle.api.artifacts.ModuleVersionIdentifier -import org.gradle.api.artifacts.ProjectDependency -import org.gradle.api.artifacts.SelfResolvingDependency -import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyPublicationResolver -import org.gradle.api.publish.maven.MavenPom -import org.gradle.api.publish.maven.MavenPublication - -//https://github.com/johnrengelman/shadow/issues/334 -static void configure(MavenPublication publication, Project project) { - publication.artifact(project.tasks.shadowJar) - - - publication.pom { MavenPom pom -> - pom.withXml { xml -> - def dependenciesNode = xml.asNode().appendNode('dependencies') - - project.configurations.shadow.allDependencies.each { - if (it instanceof ProjectDependency) { - final ProjectDependencyPublicationResolver projectDependencyResolver = project.gradle.services.get(ProjectDependencyPublicationResolver) - final ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(ModuleVersionIdentifier, it) - addDependency(dependenciesNode, identifier) - } else if (!(it instanceof SelfResolvingDependency)) { - addDependency(dependenciesNode, it) - } - - } - } - } -} - -private static void addDependency(Node dependenciesNode, dep) { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', dep.group) - dependencyNode.appendNode('artifactId', dep.name) - dependencyNode.appendNode('version', dep.version) - dependencyNode.appendNode('scope', 'compile') -} diff --git a/buildSrc/src/main/groovy/org/jetbrains/DependenciesVersionGetter.groovy b/buildSrc/src/main/groovy/org/jetbrains/DependenciesVersionGetter.groovy deleted file mode 100644 index 194f11af..00000000 --- a/buildSrc/src/main/groovy/org/jetbrains/DependenciesVersionGetter.groovy +++ /dev/null @@ -1,14 +0,0 @@ -package org.jetbrains - -import org.gradle.api.Project - -class DependenciesVersionGetter { - static Properties getVersions(Project project, String artifactVersionSelector) { - def dep = project.dependencies.create(group: 'teamcity', name: 'dependencies', version: artifactVersionSelector, ext: 'properties') - def file = project.configurations.detachedConfiguration(dep).resolve().first() - - def prop = new Properties() - prop.load(new FileReader(file)) - return prop - } -} diff --git a/buildSrc/src/main/groovy/org/jetbrains/PluginXmlTransformer.groovy b/buildSrc/src/main/groovy/org/jetbrains/PluginXmlTransformer.groovy deleted file mode 100644 index e711388f..00000000 --- a/buildSrc/src/main/groovy/org/jetbrains/PluginXmlTransformer.groovy +++ /dev/null @@ -1,71 +0,0 @@ -package org.jetbrains - -import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext -import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator -import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer -import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext -import groovy.xml.XmlUtil -import org.gradle.api.file.FileTreeElement -import shadow.org.apache.tools.zip.ZipEntry -import shadow.org.apache.tools.zip.ZipOutputStream - -public class PluginXmlTransformer implements Transformer { - private Map transformedPluginXmlFiles = new HashMap<>(); - - @Override - boolean canTransformResource(FileTreeElement fileTreeElement) { - return fileTreeElement.relativePath.segments.contains("META-INF") && fileTreeElement.name.endsWith(".xml") - } - - @Override - void transform(TransformerContext context) { - def path = context.path - def inputStream = context.is - System.out.println(path) - Node node = new XmlParser().parse(inputStream) - relocateXml(node, context) - transformedPluginXmlFiles.put(path, node) - } - - @Override - boolean hasTransformedResource() { - return !transformedPluginXmlFiles.isEmpty() - } - - @Override - void modifyOutputStream(ZipOutputStream zipOutputStream) { - for (Map.Entry entry : transformedPluginXmlFiles.entrySet()) { - zipOutputStream.putNextEntry(new ZipEntry(entry.key)) - XmlUtil.serialize(entry.value, zipOutputStream) - } - } - - private static void relocateXml(Node node, TransformerContext context) { - Map attributes = node.attributes() - RelocateClassContext relocateClassContext = new RelocateClassContext() - relocateClassContext.stats = context.stats - for (Map.Entry entry : attributes.entrySet()) { - relocateClassContext.setClassName((String) entry.getValue()) - entry.setValue(relocateClassName(relocateClassContext, context)) - } - List localText = node.localText() - if (localText.size() == 1) { - relocateClassContext.setClassName(localText[0]) - node.setValue(relocateClassName(relocateClassContext, context)) - } - node.children().each { - if (it instanceof Node) { - relocateXml((Node) it, context) - } - } - } - - private static String relocateClassName(RelocateClassContext relocateContext, TransformerContext context) { - for (Relocator relocator : context.relocators) { - if (relocator.canRelocateClass(relocateContext)) { - return relocator.relocateClass(relocateContext) - } - } - return relocateContext.className - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt b/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt new file mode 100644 index 00000000..19e032a8 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/BintrayPublishing.kt @@ -0,0 +1,29 @@ +package org.jetbrains + +import com.jfrog.bintray.gradle.BintrayExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.provideDelegate + +fun Project.configureBintrayPublication(publication: String) = configureBintrayPublication(listOf(publication)) + +fun Project.configureBintrayPublication(publications: List) { + val dokka_version: String by this + val dokka_publication_channel: String by this + extensions.configure("bintray") { + user = System.getenv("BINTRAY_USER") + key = System.getenv("BINTRAY_KEY") + + pkg = PackageConfig().apply { + repo = dokka_publication_channel + name = "dokka" + userOrg = "kotlin" + desc = "Dokka, the Kotlin documentation tool" + vcsUrl = "https://github.com/kotlin/dokka.git" + setLicenses("Apache-2.0") + version = VersionConfig().apply { + name = dokka_version + } + } + setPublications(*publications.toTypedArray()) + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DistMavenPublishing.kt b/buildSrc/src/main/kotlin/org/jetbrains/DistMavenPublishing.kt new file mode 100644 index 00000000..ec536bd7 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/DistMavenPublishing.kt @@ -0,0 +1,28 @@ +package org.jetbrains + +import org.gradle.api.Project +import org.gradle.api.artifacts.repositories.MavenArtifactRepository +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.tasks.PublishToMavenRepository + +fun Project.configureDistMaven() { // TODO: This can probably be written cleaner + val repoLocation = uri(file("${rootProject.buildDir}/dist-maven")) + var distMaven: MavenArtifactRepository? = null + pluginManager.withPlugin("maven-publish") { + this@configureDistMaven.extensions.findByType(PublishingExtension::class.java)?.let { + it.repositories { + distMaven = maven { + name = "distMaven" + url = repoLocation + } + } + } + } + tasks.register("publishToDistMaven") { + group = "publishing" + description = "Publishes all Maven publications to Maven repository 'distMaven'" + dependsOn(tasks.withType(PublishToMavenRepository::class.java).matching { + it.repository == distMaven + }) + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt new file mode 100644 index 00000000..5bd35415 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt @@ -0,0 +1,19 @@ +package org.jetbrains + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.extra +import org.gradle.kotlin.dsl.provideDelegate + +fun Project.configureDokkaVersion(): String { + var dokka_version: String? by this.extra + if (dokka_version == null) { + val buildNumber = System.getenv("BUILD_NUMBER") + val dokka_version_base: String by this + dokka_version = dokka_version_base + if (buildNumber == null || System.getenv("FORCE_SNAPSHOT") != null) { + "-SNAPSHOT" + } else { + "-$buildNumber" + } + } + return dokka_version!! +} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100644 index a7379595..00000000 --- a/core/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -import javax.tools.ToolProvider - -buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - apply plugin: 'kotlin' - - sourceCompatibility = 1.8 - - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } - } -} - -dependencies { - testCompile project(':testApi') - compile project(":integration") - compile project(path: ":coreDependencies", configuration: "shadow") - - 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' - implementation "org.jsoup:jsoup:1.12.1" - - compile "org.jetbrains.kotlin:kotlin-compiler:$bundled_kotlin_compiler_version" - compile "org.jetbrains.kotlin:kotlin-script-runtime:$bundled_kotlin_compiler_version" - - compile "org.jetbrains:markdown:0.1.41" - - compile 'org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.10' - - - //tools.jar -// def toolsJar = files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs().findAll { it.path.endsWith("jar") }) -// compileOnly toolsJar -// testCompile toolsJar - - - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version - testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0" - implementation "com.google.code.gson:gson:$gson_version" - - testImplementation "org.jetbrains.kotlin:kotlin-stdlib-js:$bundled_kotlin_compiler_version" - testImplementation "org.jetbrains.kotlin:kotlin-stdlib-common:$bundled_kotlin_compiler_version" -// testImplementation project(":core:testApi") - - testCompile ideaRT() -} - -apply plugin: 'maven-publish' - -publishing { - publications { - dokkaCore(MavenPublication) { publication -> - artifactId = 'dokka-core' - - from components.java - } - } -} - -bintrayPublication(project, ["dokkaCore"]) diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 00000000..06610a38 --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,49 @@ +import org.jetbrains.configureBintrayPublication + +plugins { + id("com.github.johnrengelman.shadow") + `maven-publish` + id("com.jfrog.bintray") +} + +dependencies { + implementation(project(":coreDependencies", configuration = "shadow")) + + val kotlin_version: String by project + implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlin_version") + implementation("org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version") + implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") + implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") + implementation("org.jsoup:jsoup:1.12.1") + implementation("com.google.code.gson:gson:2.8.5") + implementation("org.jetbrains:markdown:0.1.40") + implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.10") + + testImplementation(project(":testApi")) + testImplementation("junit:junit:4.13") +} + +tasks { + shadowJar { + val dokka_version: String by project + archiveFileName.set("dokka-core-$dokka_version.jar") + archiveClassifier.set("") + } +} + +val sourceJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + +publishing { + publications { + register("dokkaCore") { + artifactId = "dokka-core" + project.shadow.component(this) + artifact(sourceJar.get()) + } + } +} + +configureBintrayPublication("dokkaCore") diff --git a/core/src/main/kotlin/DokkaBootstrap.kt b/core/src/main/kotlin/DokkaBootstrap.kt new file mode 100644 index 00000000..b78eb9c6 --- /dev/null +++ b/core/src/main/kotlin/DokkaBootstrap.kt @@ -0,0 +1,10 @@ +package org.jetbrains.dokka + +import java.util.function.BiConsumer + +interface DokkaBootstrap { + + fun configure(logger: BiConsumer, serializedConfigurationJSON: String) + + fun generate() +} \ No newline at end of file diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt index 5058634a..856cfa04 100644 --- a/core/src/main/kotlin/Java/JavadocParser.kt +++ b/core/src/main/kotlin/Java/JavadocParser.kt @@ -4,16 +4,12 @@ import com.intellij.psi.* import com.intellij.psi.impl.source.tree.JavaDocElementType import com.intellij.psi.javadoc.* import com.intellij.psi.util.PsiTreeUtil -import com.intellij.util.containers.isNullOrEmpty -import kotlinx.html.P import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.kotlin.utils.keysToMap import org.jsoup.Jsoup import org.jsoup.nodes.Element import org.jsoup.nodes.Node import org.jsoup.nodes.TextNode -import java.net.URI interface JavaDocumentationParser { fun parseDocumentation(element: PsiNamedElement): DocumentationNode diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt new file mode 100644 index 00000000..8c6d35e8 --- /dev/null +++ b/core/src/main/kotlin/configuration.kt @@ -0,0 +1,98 @@ +package org.jetbrains.dokka + +import java.io.File +import java.net.URL + +enum class Platform(val key: String) { + jvm("jvm"), + js("js"), + native("native"), + common("common"); + + companion object { + val DEFAULT = jvm + + fun fromString(key: String): Platform { + return when (key.toLowerCase()) { + jvm.key -> jvm + js.key -> js + native.key -> native + common.key -> common + else -> throw IllegalArgumentException("Unrecognized platform: $key") + } + } + } +} + +interface DokkaConfiguration { + val outputDir: String + val format: String + val generateIndexPages: Boolean + val cacheRoot: String? + val passesConfigurations: List + val impliedPlatforms: List + var pluginsClasspath: List + + interface PassConfiguration { + val moduleName: String + val classpath: List + val sourceRoots: List + val samples: List + val includes: List + val includeNonPublic: Boolean + val includeRootPackage: Boolean + val reportUndocumented: Boolean + val skipEmptyPackages: Boolean + val skipDeprecated: Boolean + val jdkVersion: Int + val sourceLinks: List + val perPackageOptions: List + val externalDocumentationLinks: List + val languageVersion: String? + val apiVersion: String? + val noStdlibLink: Boolean + val noJdkLink: Boolean + val suppressedFiles: List + val collectInheritedExtensionsFromLibraries: Boolean + val analysisPlatform: Platform + val targets: List + val sinceKotlin: String? + } + + interface SourceRoot { + val path: String + } + + interface SourceLinkDefinition { + val path: String + val url: String + val lineSuffix: String? + } + + interface PackageOptions { + val prefix: String + val includeNonPublic: Boolean + val reportUndocumented: Boolean + val skipDeprecated: Boolean + val suppress: Boolean + } + + interface ExternalDocumentationLink { + val url: URL + val packageListUrl: URL + + open class Builder(open var url: URL? = null, + open var packageListUrl: URL? = null) { + + constructor(root: String, packageList: String? = null) : this(URL(root), packageList?.let { URL(it) }) + + fun build(): ExternalDocumentationLink = + if (packageListUrl != null && url != null) + ExternalDocumentationLinkImpl(url!!, packageListUrl!!) + else if (url != null) + ExternalDocumentationLinkImpl(url!!, URL(url!!, "package-list")) + else + throw IllegalArgumentException("url or url && packageListUrl must not be null for external documentation link") + } + } +} diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt new file mode 100644 index 00000000..6c797fcd --- /dev/null +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -0,0 +1,74 @@ +package org.jetbrains.dokka + +import java.io.File +import java.net.URL + +data class DokkaConfigurationImpl( + override val outputDir: String, + override val format: String, + override val generateIndexPages: Boolean, + override val cacheRoot: String?, + override val impliedPlatforms: List, + override val passesConfigurations: List, + override var pluginsClasspath: List +) : DokkaConfiguration + +data class PassConfigurationImpl ( + override val moduleName: String, + override val classpath: List, + override val sourceRoots: List, + override val samples: List, + override val includes: List, + 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 sourceLinks: List, + override val perPackageOptions: List, + override var externalDocumentationLinks: List, + override val languageVersion: String?, + override val apiVersion: String?, + override val noStdlibLink: Boolean, + override val noJdkLink: Boolean, + override val suppressedFiles: List, + override val collectInheritedExtensionsFromLibraries: Boolean, + override val analysisPlatform: Platform, + override val targets: List, + override val sinceKotlin: String? +) : DokkaConfiguration.PassConfiguration + + +data class SourceRootImpl( + override val path: String +): DokkaConfiguration.SourceRoot + +data class SourceLinkDefinitionImpl( + override val path: String, + override val url: String, + override val lineSuffix: String? +): DokkaConfiguration.SourceLinkDefinition { + companion object { + fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinitionImpl { + val (path, urlAndLine) = srcLink.split('=') + return SourceLinkDefinitionImpl( + File(path).canonicalPath, + urlAndLine.substringBefore("#"), + urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#$it" }) + } + } +} + +data class PackageOptionsImpl( + override val prefix: String, + override val includeNonPublic: Boolean, + override val reportUndocumented: Boolean, + override val skipDeprecated: Boolean, + override val suppress: Boolean +): DokkaConfiguration.PackageOptions + + +data class ExternalDocumentationLinkImpl(override val url: URL, + override val packageListUrl: URL +) : DokkaConfiguration.ExternalDocumentationLink \ No newline at end of file diff --git a/core/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt b/core/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt index ad165cdb..f9431bbb 100644 --- a/core/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt +++ b/core/src/test/kotlin/multiplatform/BasicMultiplatformTest.kt @@ -1,8 +1,8 @@ package multiplatform +import org.junit.Assert.assertEquals import org.junit.Test import testApi.testRunner.AbstractCoreTest -import kotlin.test.assertEquals class BasicMultiplatformTest : AbstractCoreTest() { diff --git a/coreDependencies/build.gradle b/coreDependencies/build.gradle deleted file mode 100644 index 2b166a93..00000000 --- a/coreDependencies/build.gradle +++ /dev/null @@ -1,45 +0,0 @@ -def intellijCoreAnalysis() { - return zipTree(project(":").configurations.intellijCore.singleFile).matching ({ - include("intellij-core-analysis.jar") - }) -} - -apply plugin: 'java' -apply plugin: 'com.github.johnrengelman.shadow' - -dependencies { - compile intellijCoreAnalysis() - compile "org.jetbrains.kotlin:kotlin-plugin-ij193:$kotlin_plugin_version" //TODO: parametrize ij version after 1.3.70 -} - -shadowJar { - baseName = 'dokka-dependencies' - classifier = '' - - configurations { - exclude compileOnly - } - - - exclude 'colorScheme/**' - exclude 'fileTemplates/**' - exclude 'inspectionDescriptions/**' - exclude 'intentionDescriptions/**' - exclude 'tips/**' - exclude 'messages/**' - - exclude 'src/**' -} - -apply plugin: 'maven-publish' - -publishing { - publications { - dokkaDependencies(MavenPublication) { publication -> - artifactId = 'dokka-dependencies' - project.shadow.component(publication) - } - } -} - -bintrayPublication(project, ["dokkaDependencies"]) \ No newline at end of file diff --git a/coreDependencies/build.gradle.kts b/coreDependencies/build.gradle.kts new file mode 100644 index 00000000..514c7ae1 --- /dev/null +++ b/coreDependencies/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + id("com.github.johnrengelman.shadow") + `maven-publish` +} + +val intellijCore: Configuration by configurations.creating + +repositories { + maven(url = "https://www.jetbrains.com/intellij-repository/snapshots") + maven(url = "https://www.jetbrains.com/intellij-repository/releases") + maven(url = "https://kotlin.bintray.com/kotlin-plugin") +} + +fun intellijCoreAnalysis() = zipTree(intellijCore.singleFile).matching { + include("intellij-core-analysis.jar") +} + +dependencies { + val idea_version: String by project + intellijCore("com.jetbrains.intellij.idea:intellij-core:$idea_version") + val kotlin_plugin_version: String by project + implementation(intellijCoreAnalysis()) + implementation("org.jetbrains.kotlin:kotlin-plugin-ij193:$kotlin_plugin_version") { + //TODO: parametrize ij version after 1.3.70 + isTransitive = false + } +} + +tasks { + shadowJar { + val dokka_version: String by project + archiveFileName.set("dokka-dependencies-$dokka_version.jar") + archiveClassifier.set("") + + exclude("colorScheme/**") + exclude("fileTemplates/**") + exclude("inspectionDescriptions/**") + exclude("intentionDescriptions/**") + exclude("tips/**") + exclude("messages/**") + exclude("src/**") + } +} diff --git a/gradle.properties b/gradle.properties index b0c74348..57ddc095 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,9 @@ dokka_version_base=0.11.0 dokka_publication_channel=dokka # Kotlin compiler and plugin -bundled_kotlin_compiler_version=1.3.61 kotlin_version=1.3.61 kotlin_plugin_version=1.3.61-release-180 idea_version=192.5728.98 -kotlin_for_gradle_runtime_version=1.3.61 language_version=1.3 ant_version=1.9.6 @@ -14,12 +12,7 @@ ant_version=1.9.6 # Maven plugin dependencies maven_version=3.5.0 maven_archiver_version=2.5 -plexus_utils_version=3.0.22 -plexus_archiver_version=3.4 maven_plugin_tools_version=3.5.2 # For CI -mvn=mvn - -# For serialization -gson_version=2.8.5 \ No newline at end of file +mvn=mvn \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf0..f3d88b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f9fe22d1..a869af2d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ -#Wed Sep 18 14:13:14 CEST 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip +#Wed Jan 29 14:26:26 CET 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 83f2acfd..2fe81a7d 100755 --- a/gradlew +++ b/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/integration-tests/build.gradle b/integration-tests/build.gradle deleted file mode 100644 index 23d232d2..00000000 --- a/integration-tests/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -subprojects { - buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } - } -} \ No newline at end of file diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts new file mode 100644 index 00000000..e69de29b diff --git a/integration-tests/gradle-integration-tests/build.gradle b/integration-tests/gradle-integration-tests/build.gradle deleted file mode 100644 index 70213d8b..00000000 --- a/integration-tests/gradle-integration-tests/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -apply plugin: 'kotlin' - -sourceCompatibility = 1.8 - -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict" - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -configurations { - dokkaPlugin - dokkaFatJar - kotlinGradle -} - -dependencies { - - testCompileOnly group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', 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') - dokkaFatJar project(path: ":runners:fatjar", configuration: 'shadow') - - kotlinGradle "org.jetbrains.kotlin:kotlin-gradle-plugin" - - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile gradleTestKit() -} - - - -task createClasspathManifest { - def outputDir = file("$buildDir/$name") - - inputs.files(configurations.dokkaPlugin + configurations.dokkaFatJar) - outputs.dir outputDir - - doLast { - outputDir.mkdirs() - file("$outputDir/dokka-plugin-classpath.txt").text = configurations.dokkaPlugin.join("\n") - file("$outputDir/fatjar.txt").text = configurations.dokkaFatJar.join("\n") - file("$outputDir/kotlin-gradle.txt").text = configurations.kotlinGradle.join("\n") - } -} - - -createClasspathManifest.mustRunAfter project(":runners:fatjar").getTasksByName("shadowJar", true) -testClasses.dependsOn project(":runners:fatjar").shadowJar -testClasses.dependsOn createClasspathManifest - -test { - systemProperty "android.licenses.overwrite", project.findProperty("android.licenses.overwrite") ?: "" - inputs.dir(file('testData')) - exclude '*' // TODO: Remove this exclude when tests are migrated -} \ No newline at end of file diff --git a/integration-tests/gradle-integration-tests/build.gradle.kts b/integration-tests/gradle-integration-tests/build.gradle.kts new file mode 100644 index 00000000..6a3fc690 --- /dev/null +++ b/integration-tests/gradle-integration-tests/build.gradle.kts @@ -0,0 +1,52 @@ +val dokkaPlugin by configurations.creating +val dokkaCore by configurations.creating +val kotlinGradle by configurations.creating + +dependencies { + val kotlin_version: String by project + testCompileOnly(group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version = kotlin_version) + testImplementation( + group = "org.jetbrains.kotlin", + name = "kotlin-test-junit", + version = kotlin_version + ) + testImplementation(project(":coreDependencies")) + dokkaPlugin(project(path = ":runners:gradle-plugin")) + dokkaCore(project(path = ":core", configuration = "shadow")) + + kotlinGradle("org.jetbrains.kotlin:kotlin-gradle-plugin") + + testImplementation(group = "junit", name = "junit", version = "4.13") + testImplementation(gradleTestKit()) +} + + +val createClasspathManifest by tasks.registering { + dependsOn(project(":core").getTasksByName("shadowJar", true)) + + val outputDir = file("$buildDir/$name") + inputs.files(dokkaPlugin + dokkaCore) + outputs.dir(outputDir) + + doLast { + outputDir.mkdirs() + file("$outputDir/dokka-plugin-classpath.txt").writeText(dokkaPlugin.joinToString("\n")) + file("$outputDir/fatjar.txt").writeText(dokkaCore.joinToString("\n")) + file("$outputDir/kotlin-gradle.txt").writeText(kotlinGradle.joinToString("\n")) + } +} + +val testClasses by tasks.getting + +testClasses.dependsOn(project(":core").getTasksByName("shadowJar", true)) +testClasses.dependsOn(createClasspathManifest) + +tasks { + test { + systemProperty("android.licenses.overwrite", project.findProperty("android.licenses.overwrite") ?: "") + inputs.dir(file("testData")) + exclude("*") // TODO: Remove this exclude when tests are migrated + } +} + +// TODO: see if this file makes any sense \ No newline at end of file diff --git a/integration/build.gradle b/integration/build.gradle deleted file mode 100644 index ce25d9bf..00000000 --- a/integration/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -buildscript { - repositories { jcenter() } - - dependencies { - 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 = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -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 - implementation "com.google.code.gson:gson:$gson_version" -} \ No newline at end of file diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/DokkaBootstrap.kt b/integration/src/main/kotlin/org/jetbrains/dokka/DokkaBootstrap.kt deleted file mode 100644 index b78eb9c6..00000000 --- a/integration/src/main/kotlin/org/jetbrains/dokka/DokkaBootstrap.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.jetbrains.dokka - -import java.util.function.BiConsumer - -interface DokkaBootstrap { - - fun configure(logger: BiConsumer, serializedConfigurationJSON: String) - - fun generate() -} \ No newline at end of file diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt b/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt deleted file mode 100644 index 1984a3e5..00000000 --- a/integration/src/main/kotlin/org/jetbrains/dokka/ReflectDsl.kt +++ /dev/null @@ -1,72 +0,0 @@ -package org.jetbrains.dokka - -import kotlin.reflect.* -import kotlin.reflect.full.memberFunctions -import kotlin.reflect.full.memberProperties -import kotlin.reflect.jvm.isAccessible - -object ReflectDsl { - - class CallOrPropAccess(private val receiver: Any?, - private val clz: KClass<*>, - private val selector: String) { - - @Suppress("UNCHECKED_CAST") - operator fun invoke(vararg a: Any?): T { - return func!!.call(receiver, *a) as T - } - - operator fun get(s: String): CallOrPropAccess { - return v()!![s] - } - - val func: KFunction<*>? by lazy { clz.memberFunctions.find { it.name == selector } } - val prop: KProperty<*>? by lazy { clz.memberProperties.find { it.name == selector } } - - fun takeIfIsFunc(): CallOrPropAccess? = if (func != null) this else null - - fun takeIfIsProp(): CallOrPropAccess? = if (prop != null) this else null - - @Suppress("UNCHECKED_CAST") - fun v(): T { - val prop = prop!! - return try { - prop.getter.apply { isAccessible = true }.call(receiver) as T - } catch (e: KotlinNullPointerException) { - // Hack around kotlin-reflect bug KT-18480 - val jclass = clz.java - val customGetterName = prop.getter.name - val getterName = if (customGetterName.startsWith("<")) "get" + prop.name.capitalize() else customGetterName - val getter = jclass.getDeclaredMethod(getterName) - getter.isAccessible = true - - getter.invoke(receiver) as T - - } - } - - @Suppress("UNCHECKED_CAST") - fun v(x: Any?) { - (prop as KMutableProperty).setter.apply { isAccessible = true }.call(receiver, x) - } - - - } - - operator fun Any.get(s: String): CallOrPropAccess { - val clz = this.javaClass.kotlin - return CallOrPropAccess(this, clz, s) - } - - operator fun Any.get(s: String, clz: Class<*>): CallOrPropAccess { - val kclz = clz.kotlin - return CallOrPropAccess(this, kclz, s) - } - - operator fun Any.get(s: String, clz: KClass<*>): CallOrPropAccess { - return CallOrPropAccess(this, clz, s) - } - - inline infix fun Any.isInstance(clz: Class<*>?): Boolean = clz != null && clz.isAssignableFrom(this.javaClass) - inline infix fun Any.isNotInstance(clz: Class<*>?): Boolean = !(this isInstance clz) -} \ No newline at end of file diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt deleted file mode 100644 index 8c6d35e8..00000000 --- a/integration/src/main/kotlin/org/jetbrains/dokka/configuration.kt +++ /dev/null @@ -1,98 +0,0 @@ -package org.jetbrains.dokka - -import java.io.File -import java.net.URL - -enum class Platform(val key: String) { - jvm("jvm"), - js("js"), - native("native"), - common("common"); - - companion object { - val DEFAULT = jvm - - fun fromString(key: String): Platform { - return when (key.toLowerCase()) { - jvm.key -> jvm - js.key -> js - native.key -> native - common.key -> common - else -> throw IllegalArgumentException("Unrecognized platform: $key") - } - } - } -} - -interface DokkaConfiguration { - val outputDir: String - val format: String - val generateIndexPages: Boolean - val cacheRoot: String? - val passesConfigurations: List - val impliedPlatforms: List - var pluginsClasspath: List - - interface PassConfiguration { - val moduleName: String - val classpath: List - val sourceRoots: List - val samples: List - val includes: List - val includeNonPublic: Boolean - val includeRootPackage: Boolean - val reportUndocumented: Boolean - val skipEmptyPackages: Boolean - val skipDeprecated: Boolean - val jdkVersion: Int - val sourceLinks: List - val perPackageOptions: List - val externalDocumentationLinks: List - val languageVersion: String? - val apiVersion: String? - val noStdlibLink: Boolean - val noJdkLink: Boolean - val suppressedFiles: List - val collectInheritedExtensionsFromLibraries: Boolean - val analysisPlatform: Platform - val targets: List - val sinceKotlin: String? - } - - interface SourceRoot { - val path: String - } - - interface SourceLinkDefinition { - val path: String - val url: String - val lineSuffix: String? - } - - interface PackageOptions { - val prefix: String - val includeNonPublic: Boolean - val reportUndocumented: Boolean - val skipDeprecated: Boolean - val suppress: Boolean - } - - interface ExternalDocumentationLink { - val url: URL - val packageListUrl: URL - - open class Builder(open var url: URL? = null, - open var packageListUrl: URL? = null) { - - constructor(root: String, packageList: String? = null) : this(URL(root), packageList?.let { URL(it) }) - - fun build(): ExternalDocumentationLink = - if (packageListUrl != null && url != null) - ExternalDocumentationLinkImpl(url!!, packageListUrl!!) - else if (url != null) - ExternalDocumentationLinkImpl(url!!, URL(url!!, "package-list")) - else - throw IllegalArgumentException("url or url && packageListUrl must not be null for external documentation link") - } - } -} diff --git a/integration/src/main/kotlin/org/jetbrains/dokka/defaultConfiguration.kt b/integration/src/main/kotlin/org/jetbrains/dokka/defaultConfiguration.kt deleted file mode 100644 index 6c797fcd..00000000 --- a/integration/src/main/kotlin/org/jetbrains/dokka/defaultConfiguration.kt +++ /dev/null @@ -1,74 +0,0 @@ -package org.jetbrains.dokka - -import java.io.File -import java.net.URL - -data class DokkaConfigurationImpl( - override val outputDir: String, - override val format: String, - override val generateIndexPages: Boolean, - override val cacheRoot: String?, - override val impliedPlatforms: List, - override val passesConfigurations: List, - override var pluginsClasspath: List -) : DokkaConfiguration - -data class PassConfigurationImpl ( - override val moduleName: String, - override val classpath: List, - override val sourceRoots: List, - override val samples: List, - override val includes: List, - 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 sourceLinks: List, - override val perPackageOptions: List, - override var externalDocumentationLinks: List, - override val languageVersion: String?, - override val apiVersion: String?, - override val noStdlibLink: Boolean, - override val noJdkLink: Boolean, - override val suppressedFiles: List, - override val collectInheritedExtensionsFromLibraries: Boolean, - override val analysisPlatform: Platform, - override val targets: List, - override val sinceKotlin: String? -) : DokkaConfiguration.PassConfiguration - - -data class SourceRootImpl( - override val path: String -): DokkaConfiguration.SourceRoot - -data class SourceLinkDefinitionImpl( - override val path: String, - override val url: String, - override val lineSuffix: String? -): DokkaConfiguration.SourceLinkDefinition { - companion object { - fun parseSourceLinkDefinition(srcLink: String): SourceLinkDefinitionImpl { - val (path, urlAndLine) = srcLink.split('=') - return SourceLinkDefinitionImpl( - File(path).canonicalPath, - urlAndLine.substringBefore("#"), - urlAndLine.substringAfter("#", "").let { if (it.isEmpty()) null else "#$it" }) - } - } -} - -data class PackageOptionsImpl( - override val prefix: String, - override val includeNonPublic: Boolean, - override val reportUndocumented: Boolean, - override val skipDeprecated: Boolean, - override val suppress: Boolean -): DokkaConfiguration.PackageOptions - - -data class ExternalDocumentationLinkImpl(override val url: URL, - override val packageListUrl: URL -) : DokkaConfiguration.ExternalDocumentationLink \ No newline at end of file diff --git a/plugins/build.gradle b/plugins/build.gradle deleted file mode 100644 index a0bc5ee1..00000000 --- a/plugins/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - apply plugin: 'kotlin' - - sourceCompatibility = 1.8 - - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } - } -} - -subprojects { - dependencies { - testCompile project(':testApi') - } -} \ No newline at end of file diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts new file mode 100644 index 00000000..5f2f6dcb --- /dev/null +++ b/plugins/build.gradle.kts @@ -0,0 +1,11 @@ +subprojects { + apply { + plugin("maven-publish") + } + + dependencies { + compileOnly(project(":core")) + compileOnly(kotlin("stdlib-jdk8")) + testImplementation(project(":testApi")) + } +} \ No newline at end of file diff --git a/plugins/mathjax/build.gradle b/plugins/mathjax/build.gradle deleted file mode 100644 index 6578ff45..00000000 --- a/plugins/mathjax/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -import javax.tools.ToolProvider - -apply plugin: 'maven-publish' - -dependencies { - compileOnly project(':core') -} - -publishing { - publications { - dokkaCore(MavenPublication) { publication -> - artifactId = 'mathjax-plugin' - - from components.java - } - } -} \ No newline at end of file diff --git a/plugins/mathjax/build.gradle.kts b/plugins/mathjax/build.gradle.kts new file mode 100644 index 00000000..0e9a16d0 --- /dev/null +++ b/plugins/mathjax/build.gradle.kts @@ -0,0 +1,8 @@ +publishing { + publications { + register("mathjaxPlugin") { + artifactId = "mathjax-plugin" + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/plugins/xml/build.gradle b/plugins/xml/build.gradle deleted file mode 100644 index ed4adb92..00000000 --- a/plugins/xml/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -import javax.tools.ToolProvider - -apply plugin: 'maven-publish' - -dependencies { - compileOnly project(':core') -} - -publishing { - publications { - dokkaCore(MavenPublication) { publication -> - artifactId = 'xml-plugin' - - from components.java - } - } -} \ No newline at end of file diff --git a/plugins/xml/build.gradle.kts b/plugins/xml/build.gradle.kts new file mode 100644 index 00000000..cd65cfe4 --- /dev/null +++ b/plugins/xml/build.gradle.kts @@ -0,0 +1,8 @@ +publishing { + publications { + register("xmlPlugin") { + artifactId = "xml-plugin" + from(components["java"]) + } + } +} \ No newline at end of file diff --git a/runners/build.gradle b/runners/build.gradle deleted file mode 100644 index 23d232d2..00000000 --- a/runners/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -subprojects { - buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } - } -} \ No newline at end of file diff --git a/runners/build.gradle.kts b/runners/build.gradle.kts new file mode 100644 index 00000000..57081149 --- /dev/null +++ b/runners/build.gradle.kts @@ -0,0 +1,6 @@ +subprojects { + apply { + plugin("maven-publish") + plugin("com.jfrog.bintray") + } +} \ No newline at end of file diff --git a/runners/cli/build.gradle b/runners/cli/build.gradle deleted file mode 100644 index 24db0b1e..00000000 --- a/runners/cli/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'kotlin' - -sourceCompatibility = 1.8 - -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-cli-jvm:0.1.0-dev-3" - implementation project(":core") -} diff --git a/runners/cli/build.gradle.kts b/runners/cli/build.gradle.kts new file mode 100644 index 00000000..4b39d64c --- /dev/null +++ b/runners/cli/build.gradle.kts @@ -0,0 +1,37 @@ +import org.jetbrains.configureBintrayPublication + +plugins { + id("com.github.johnrengelman.shadow") +} + +repositories { + maven(url = "https://dl.bintray.com/orangy/maven") +} + +dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-cli-jvm:0.1.0-dev-3") + implementation(project(":core")) +} + + +tasks { + shadowJar { + val dokka_version: String by project + archiveFileName.set("dokka-cli-$dokka_version.jar") + archiveClassifier.set("") + manifest { + attributes("Main-Class" to "org.jetbrains.dokka.MainKt") + } + } +} + +publishing { + publications { + register("dokkaCli") { + artifactId = "dokka-cli" + project.shadow.component(this) + } + } +} + +configureBintrayPublication("dokkaCli") \ No newline at end of file diff --git a/runners/fatjar/build.gradle b/runners/fatjar/build.gradle deleted file mode 100644 index cab64c0f..00000000 --- a/runners/fatjar/build.gradle +++ /dev/null @@ -1,78 +0,0 @@ -import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer -import org.jetbrains.PluginXmlTransformer -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - -apply plugin: 'java' -apply plugin: 'com.github.johnrengelman.shadow' - -dependencies { - compile project(":runners:cli") - compile project(":runners:ant") -} - -jar { - manifest { - attributes 'Main-Class': 'org.jetbrains.dokka.MainKt' - } -} - -shadowJar { - baseName = 'dokka-fatjar' - classifier = '' - configurations { - exclude compileOnly - } - - transform(ServiceFileTransformer) - transform(PluginXmlTransformer) - - exclude 'colorScheme/**' - exclude 'fileTemplates/**' - exclude 'inspectionDescriptions/**' - exclude 'intentionDescriptions/**' - - exclude 'src/**' - -// relocate('kotlin.reflect.full', 'kotlin.reflect') -} - -task apiShadow(type: ShadowJar) { - baseName = 'dokka-fatapi' - classifier = '' - - configurations = [project.configurations.compile] - configurations { - exclude compileOnly - } - - transform(ServiceFileTransformer) - transform(PluginXmlTransformer) - - exclude 'kotlin/**' - exclude 'colorScheme/**' - exclude 'fileTemplates/**' - exclude 'inspectionDescriptions/**' - exclude 'intentionDescriptions/**' - - exclude 'src/**' - -// relocate('kotlin.reflect.full', 'kotlin.reflect') -} - -apply plugin: 'maven-publish' - -publishing { - publications { - dokkaFatJar(MavenPublication) { publication -> - artifactId = 'dokka-fatjar' - project.shadow.component(publication) - } - - dokkaFatApi(MavenPublication) {publication -> - artifactId = 'dokka-fatapi' - publication.artifact(project.tasks.apiShadow) - } - } -} - -bintrayPublication(project, ["dokkaFatJar"]) \ No newline at end of file diff --git a/runners/gradle-plugin/build.gradle b/runners/gradle-plugin/build.gradle deleted file mode 100644 index ceb03bae..00000000 --- a/runners/gradle-plugin/build.gradle +++ /dev/null @@ -1,108 +0,0 @@ -import com.gradle.publish.DependenciesBuilder - -apply plugin: 'java' -apply plugin: 'kotlin' - - -apply plugin: 'com.github.johnrengelman.shadow' -apply plugin: "com.gradle.plugin-publish" - -sourceCompatibility = 1.8 - -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict" - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } -} - -repositories { - jcenter() - google() -} - -dependencies { - testCompile group: 'junit', name: 'junit', version: '4.12' - - 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") - - compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin" - compileOnly("com.android.tools.build:gradle:3.0.0") - compileOnly("com.android.tools.build:gradle-core:3.0.0") - compileOnly("com.android.tools.build:builder-model:3.0.0") - compileOnly gradleApi() - compileOnly localGroovy() - implementation "com.google.code.gson:gson:$gson_version" -} - -task sourceJar(type: Jar) { - from sourceSets.main.allSource -} - -processResources { - eachFile { - if (it.name == "org.jetbrains.dokka.properties") { - it.filter { line -> - line.replace("", dokka_version) - } - } - } -} - -shadowJar { - baseName = 'dokka-gradle-plugin' - classifier = '' -} - -apply plugin: 'maven-publish' - -publishing { - publications { - dokkaGradlePlugin(MavenPublication) { publication -> - artifactId = 'dokka-gradle-plugin' - - artifact sourceJar { - classifier "sources" - } - - project.shadow.component(publication) - } - } -} - -bintrayPublication(project, ['dokkaGradlePlugin']) - -configurations.archives.artifacts.clear() -artifacts { - archives shadowJar -} - -pluginBundle { - website = 'https://www.kotlinlang.org/' - vcsUrl = 'https://github.com/kotlin/dokka.git' - description = 'Dokka, the Kotlin documentation tool' - tags = ['dokka', 'kotlin', 'kdoc', 'android'] - - plugins { - dokkaGradlePlugin { - id = 'org.jetbrains.dokka' - displayName = 'Dokka plugin' - } - } - - withDependencies { List list -> - list.clear() - def builder = new DependenciesBuilder() - builder.addUniqueScopedDependencies(list, configurations.shadow, "compile") - } - - mavenCoordinates { - groupId = "org.jetbrains.dokka" - artifactId = "dokka-gradle-plugin" - } -} \ No newline at end of file diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts new file mode 100644 index 00000000..0d68a525 --- /dev/null +++ b/runners/gradle-plugin/build.gradle.kts @@ -0,0 +1,74 @@ +import org.jetbrains.configureBintrayPublication + +plugins { + id("com.gradle.plugin-publish") +} + +repositories { + google() +} + +dependencies { + implementation(project(":core")) + compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin") + compileOnly("com.android.tools.build:gradle:3.0.0") + compileOnly("com.android.tools.build:gradle-core:3.0.0") + compileOnly("com.android.tools.build:builder-model:3.0.0") + compileOnly(gradleApi()) + constraints { + val kotlin_version: String by project + compileOnly("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}") { + because("kotlin-gradle-plugin and :core both depend on this") + } + } +} + +tasks { + processResources { + val dokka_version: String by project + eachFile { + if (name == "org.jetbrains.dokka.properties") { + filter { line -> + line.replace("", dokka_version) + } + } + } + } +} + +val sourceJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + +publishing { + publications { + register("dokkaGradlePlugin") { + artifactId = "dokka-gradle-plugin" + from(components["java"]) + artifact(sourceJar.get()) + } + } +} + +configureBintrayPublication("dokkaGradlePlugin") // TODO check if this publishes correctly + +pluginBundle { + // TODO check if this publishes correctly + website = "https://www.kotlinlang.org/" + vcsUrl = "https://github.com/kotlin/dokka.git" + description = "Dokka, the Kotlin documentation tool" + tags = listOf("dokka", "kotlin", "kdoc", "android") + + plugins { + create("dokkaGradlePlugin") { + id = "org.jetbrains.dokka" + displayName = "Dokka plugin" + } + } + + mavenCoordinates { + groupId = "org.jetbrains.dokka" + artifactId = "dokka-gradle-plugin" + } +} \ No newline at end of file diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index 940c496e..65b0f4b3 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -89,17 +89,9 @@ open class DokkaTask : DefaultTask() { private var outputDiagnosticInfo: Boolean = false // Workaround for Gradle, which fires some methods (like collectConfigurations()) multiple times in its lifecycle - private fun tryResolveFatJar(configuration: Configuration?): Set { - return try { - configuration!!.resolve() - } catch (e: Exception) { - project.parent?.let { tryResolveFatJar(configuration) } ?: throw e - } - } - private fun loadFatJar() { if (ClassloaderContainer.fatJarClassLoader == null) { - val jars = tryResolveFatJar(dokkaRuntime).toList() + val jars = dokkaRuntime!!.resolve() ClassloaderContainer.fatJarClassLoader = URLClassLoader(jars.map { it.toURI().toURL() }.toTypedArray(), ClassLoader.getSystemClassLoader().parent) } } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ReflectDsl.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ReflectDsl.kt new file mode 100644 index 00000000..1984a3e5 --- /dev/null +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ReflectDsl.kt @@ -0,0 +1,72 @@ +package org.jetbrains.dokka + +import kotlin.reflect.* +import kotlin.reflect.full.memberFunctions +import kotlin.reflect.full.memberProperties +import kotlin.reflect.jvm.isAccessible + +object ReflectDsl { + + class CallOrPropAccess(private val receiver: Any?, + private val clz: KClass<*>, + private val selector: String) { + + @Suppress("UNCHECKED_CAST") + operator fun invoke(vararg a: Any?): T { + return func!!.call(receiver, *a) as T + } + + operator fun get(s: String): CallOrPropAccess { + return v()!![s] + } + + val func: KFunction<*>? by lazy { clz.memberFunctions.find { it.name == selector } } + val prop: KProperty<*>? by lazy { clz.memberProperties.find { it.name == selector } } + + fun takeIfIsFunc(): CallOrPropAccess? = if (func != null) this else null + + fun takeIfIsProp(): CallOrPropAccess? = if (prop != null) this else null + + @Suppress("UNCHECKED_CAST") + fun v(): T { + val prop = prop!! + return try { + prop.getter.apply { isAccessible = true }.call(receiver) as T + } catch (e: KotlinNullPointerException) { + // Hack around kotlin-reflect bug KT-18480 + val jclass = clz.java + val customGetterName = prop.getter.name + val getterName = if (customGetterName.startsWith("<")) "get" + prop.name.capitalize() else customGetterName + val getter = jclass.getDeclaredMethod(getterName) + getter.isAccessible = true + + getter.invoke(receiver) as T + + } + } + + @Suppress("UNCHECKED_CAST") + fun v(x: Any?) { + (prop as KMutableProperty).setter.apply { isAccessible = true }.call(receiver, x) + } + + + } + + operator fun Any.get(s: String): CallOrPropAccess { + val clz = this.javaClass.kotlin + return CallOrPropAccess(this, clz, s) + } + + operator fun Any.get(s: String, clz: Class<*>): CallOrPropAccess { + val kclz = clz.kotlin + return CallOrPropAccess(this, kclz, s) + } + + operator fun Any.get(s: String, clz: KClass<*>): CallOrPropAccess { + return CallOrPropAccess(this, clz, s) + } + + inline infix fun Any.isInstance(clz: Class<*>?): Boolean = clz != null && clz.isAssignableFrom(this.javaClass) + inline infix fun Any.isNotInstance(clz: Class<*>?): Boolean = !(this isInstance clz) +} \ No newline at end of file diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt index d75d3b21..71a02843 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt @@ -25,7 +25,7 @@ open class DokkaPlugin : Plugin { private fun addConfiguration(project: Project) = project.configurations.create("dokkaRuntime").apply { - defaultDependencies{ dependencies -> dependencies.add(project.dependencies.create("org.jetbrains.dokka:dokka-fatjar:${DokkaVersion.version}")) } + defaultDependencies{ dependencies -> dependencies.add(project.dependencies.create("org.jetbrains.dokka:dokka-core:${DokkaVersion.version}")) } } private fun addTasks( diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle deleted file mode 100644 index 76fab68d..00000000 --- a/runners/maven-plugin/build.gradle +++ /dev/null @@ -1,161 +0,0 @@ -import groovy.io.FileType -import org.jetbrains.CorrectShadowPublishing -import org.jetbrains.CrossPlatformExec - -import java.nio.file.Files -import java.nio.file.StandardCopyOption - -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" - } -} - -configurations { - maven -} - -dependencies { - maven group: "org.apache.maven", name: 'apache-maven', version: maven_version, classifier: 'bin', ext: 'zip' - - shadow project(":runners:fatjar") - shadow "org.apache.maven:maven-core:$maven_version" - shadow "org.apache.maven:maven-model:$maven_version" - shadow "org.apache.maven:maven-plugin-api:$maven_version" - shadow "org.apache.maven:maven-archiver:$maven_archiver_version" - shadow "org.codehaus.plexus:plexus-utils:$plexus_utils_version" - shadow "org.codehaus.plexus:plexus-archiver:$plexus_archiver_version" - shadow "org.apache.maven.plugin-tools:maven-plugin-annotations:$maven_plugin_tools_version" - shadow "com.github.olivergondza:maven-jdk-tools-wrapper:0.1" -} - -final File mavenHome = new File(buildDir, "maven-bin") -final File mvn = new File(mavenHome, "apache-maven-$maven_version/bin/mvn") - -tasks.clean.doLast { - delete mavenHome -} - -task setupMaven(type: Sync) { - from configurations.maven.collect{ zipTree(it) } - into "$buildDir/maven-bin" -} - -def mavenBuildDir = "$buildDir/maven" - - -sourceSets.main.resources { - srcDirs += "$mavenBuildDir/classes/java/main" - exclude "**/*.class" -} - -task generatePom() { - inputs.file(new File(projectDir, "pom.tpl.xml")) - outputs.file(new File(mavenBuildDir, "pom.xml")) - doLast { - final pomTemplate = new File(projectDir, "pom.tpl.xml") - final pom = new File(mavenBuildDir, "pom.xml") - pom.parentFile.mkdirs() - pom.text = pomTemplate.text.replace("dokka_version", "$dokka_version") - .replace("", "$maven_version") - .replace("maven-plugin-plugin", "$maven_plugin_tools_version") - } -} -// -//task mergeClassOutputs doLast { -// def sourceDir = new File(buildDir, "classes/kotlin") -// def targetDir = new File(buildDir, "classes/java") -// -// sourceDir.eachFileRecurse FileType.ANY, { -// def filePath = it.toPath() -// def targetFilePath = targetDir.toPath().resolve(sourceDir.toPath().relativize(filePath)) -// if (it.isFile()) { -// Files.move(filePath, targetFilePath, StandardCopyOption.REPLACE_EXISTING) -// } else if (it.isDirectory()) { -// targetFilePath.toFile().mkdirs() -// } -// } -//} - - - -task syncKotlinClasses(type: Sync, dependsOn: compileKotlin) { - from "$buildDir/classes/kotlin" - into "$mavenBuildDir/classes/java" - - preserve { - include '**/*.class' - } -} - -task syncJavaClasses(type: Sync, dependsOn: compileJava) { - from "$buildDir/classes/java" - into "$mavenBuildDir/classes/java" - - preserve { - include '**/*.class' - } -} - -task helpMojo(type: CrossPlatformExec, dependsOn: setupMaven) { - workingDir mavenBuildDir - commandLine mvn, '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:helpmojo' - - dependsOn syncKotlinClasses -} - - -task pluginDescriptor(type: CrossPlatformExec, dependsOn: setupMaven) { - workingDir mavenBuildDir - commandLine mvn, '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:descriptor' - - dependsOn syncJavaClasses -} - - -//mergeClassOutputs.dependsOn compileKotlin -//helpMojo.dependsOn mergeClassOutputs -helpMojo.dependsOn generatePom -sourceSets.main.java.srcDir("$buildDir/maven/generated-sources/plugin") -compileJava.dependsOn helpMojo -processResources.dependsOn pluginDescriptor - -pluginDescriptor.dependsOn generatePom - -shadowJar { - baseName = 'dokka-maven-plugin' - classifier = '' -} - -shadowJar.dependsOn pluginDescriptor - - -task sourceJar(type: Jar) { - from sourceSets.main.allSource -} - -apply plugin: 'maven-publish' - -publishing { - publications { - dokkaMavenPlugin(MavenPublication) { MavenPublication publication -> - artifactId = 'dokka-maven-plugin' - - artifact sourceJar { - classifier "sources" - } - - CorrectShadowPublishing.configure(publication, project) - } - } -} - -bintrayPublication(project, ['dokkaMavenPlugin']) diff --git a/runners/maven-plugin/build.gradle.kts b/runners/maven-plugin/build.gradle.kts new file mode 100644 index 00000000..2dffd71c --- /dev/null +++ b/runners/maven-plugin/build.gradle.kts @@ -0,0 +1,115 @@ +import org.jetbrains.configureBintrayPublication + +/** + * [mavenBin] configuration is used to download Maven Plugin Plugin + * for generating plugin-help.xml and plugin.xml files + */ +val mavenBin: Configuration by configurations.creating + +val maven_version: String by project + +dependencies { + implementation(project(":core")) + implementation("org.apache.maven:maven-core:$maven_version") + implementation("org.apache.maven:maven-plugin-api:$maven_version") + val maven_plugin_tools_version: String by project + implementation("org.apache.maven.plugin-tools:maven-plugin-annotations:$maven_plugin_tools_version") + val maven_archiver_version: String by project + implementation("org.apache.maven:maven-archiver:$maven_archiver_version") + + mavenBin(group = "org.apache.maven", name = "apache-maven", version = maven_version, classifier = "bin", ext = "zip") + compileOnly(kotlin("stdlib-jdk8")) +} + +val mavenBinDir = "$buildDir/maven-bin" +val mavenBuildDir = "$buildDir/maven" +val mvn = File(mavenBinDir, "apache-maven-$maven_version/bin/mvn") + +tasks.named("clean") { + delete(mavenBinDir) +} + +/** + * Copy Maven Plugin Plugin to [mavenBinDir] directory + */ +val setupMaven by tasks.registering(Sync::class) { + from(mavenBin.map { zipTree(it) }) + into(mavenBinDir) +} + +/** + * Generate pom.xml for Maven Plugin Plugin + */ +val generatePom by tasks.registering(Copy::class) { + val dokka_version: String by project + val maven_plugin_tools_version: String by project + + from("$projectDir/pom.tpl.xml") { + rename("(.*).tpl.xml", "$1.xml") + } + into(mavenBuildDir) + + eachFile { + filter { line -> + line.replace("", "$maven_version") + } + filter { line -> + line.replace("dokka_version", "$dokka_version") + } + filter { line -> + line.replace("maven-plugin-plugin", "$maven_plugin_tools_version") + } + } +} + +/** + * Copy compiled classes to [mavenBuildDir] for Maven Plugin Plugin + */ +val syncClasses by tasks.registering(Sync::class) { + dependsOn(tasks.compileKotlin, tasks.compileJava) + from("$buildDir/classes/kotlin", "$buildDir/classes/java") + into("$mavenBuildDir/classes/java") + + preserve { + include("**/*.class") + } +} + +val helpMojo by tasks.registering(org.jetbrains.CrossPlatformExec::class) { + dependsOn(setupMaven, generatePom, syncClasses) + workingDir(mavenBuildDir) + commandLine(mvn, "-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:helpmojo") +} + +val pluginDescriptor by tasks.registering(org.jetbrains.CrossPlatformExec::class) { + dependsOn(setupMaven, generatePom, syncClasses) + workingDir(mavenBuildDir) + commandLine(mvn, "-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:descriptor") +} + +val sourceJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + +tasks.named("jar") { + dependsOn(pluginDescriptor, helpMojo) + metaInf { + from("$mavenBuildDir/classes/java/main/META-INF") + } + manifest { + attributes("Class-Path" to configurations.runtimeClasspath.get().files.joinToString(" ") { it.name }) + } +} + +publishing { + publications { + register("dokkaMavenPlugin") { + artifactId = "dokka-maven-plugin" + from(components["java"]) + artifact(sourceJar.get()) + } + } +} + +configureBintrayPublication("dokkaMavenPlugin") diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index fb11ecac..67188325 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -189,7 +189,8 @@ abstract class AbstractDokkaMojo : AbstractMojo() { impliedPlatforms = impliedPlatforms, cacheRoot = cacheRoot, passesConfigurations = listOf(passConfiguration), - generateIndexPages = generateIndexPages + generateIndexPages = generateIndexPages, + pluginsClasspath = emptyList() //TODO fix this ) val gen = DokkaGenerator(configuration, MavenDokkaLogger(log)) diff --git a/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt b/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt index a535c807..950af3e0 100644 --- a/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt +++ b/runners/maven-plugin/src/main/kotlin/MavenDokkaLogger.kt @@ -1,17 +1,21 @@ package org.jetbrains.dokka.maven import org.apache.maven.plugin.logging.Log -import org.jetbrains.dokka.DokkaLogger +import org.jetbrains.dokka.utilities.DokkaLogger class MavenDokkaLogger(val log: Log) : DokkaLogger { override fun error(message: String) { log.error(message) } + override fun debug(message: String) = log.debug(message) + override fun info(message: String) { log.info(message) } + override fun progress(message: String) = log.info(message) + override fun warn(message: String) { log.warn(message) } diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 323af4b9..00000000 --- a/settings.gradle +++ /dev/null @@ -1,16 +0,0 @@ -rootProject.name = "dokka" - -include 'core', -// 'core:testApi', - 'coreDependencies', - 'integration', - 'runners:gradle-integration-tests', - 'runners:fatjar', - 'runners:ant', - 'runners:cli', -// 'runners:maven-plugin', - 'runners:gradle-plugin', -// 'plugins:javadoc8' - 'plugins:mathjax', - 'plugins:xml', - 'testApi' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..364a96ad --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,29 @@ +rootProject.name = "dokka" + +include("core") +include("coreDependencies") +include("testApi") +include("runners:gradle-plugin") +include("runners:cli") +include("runners:maven-plugin") +include("plugins:xml") +include("plugins:mathjax") +//include("integration-tests:gradle-integration-tests") + + +pluginManagement { + val kotlin_version: String by settings + plugins { + id("org.jetbrains.kotlin.jvm") version kotlin_version + id("com.github.johnrengelman.shadow") version "5.2.0" + id("com.jfrog.bintray") version "1.8.4" + id("com.gradle.plugin-publish") version "0.10.1" + } + + repositories { + mavenLocal() + mavenCentral() + jcenter() + gradlePluginPortal() + } +} \ No newline at end of file diff --git a/testApi/build.gradle b/testApi/build.gradle deleted file mode 100644 index 5425b7bc..00000000 --- a/testApi/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -buildscript { - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} -apply plugin: 'kotlin' - -dependencies { - implementation project(':core') - implementation group: 'junit', name: 'junit', version: '4.12' - implementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlin_version -} \ No newline at end of file diff --git a/testApi/build.gradle.kts b/testApi/build.gradle.kts new file mode 100644 index 00000000..db861b90 --- /dev/null +++ b/testApi/build.gradle.kts @@ -0,0 +1,29 @@ +import org.jetbrains.configureBintrayPublication + +plugins { + `maven-publish` + id("com.jfrog.bintray") +} + +dependencies { + implementation(project(":core")) + implementation("junit:junit:4.13") // TODO: remove dependency to junit + implementation(kotlin("stdlib")) +} + +val sourceJar by tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets["main"].allSource) +} + +publishing { + publications { + register("dokkaTestAPI") { + artifactId = "dokka-test-api" + components["java"] + artifact(sourceJar.get()) + } + } +} + +configureBintrayPublication("dokkaTestAPI") \ No newline at end of file -- cgit From 50e711d24b517bc93c37d89f258c9dafaa038ad1 Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Mon, 20 Jan 2020 14:55:42 +0100 Subject: kotlin-as-java plugin --- .idea/compiler.xml | 2 + core/src/main/kotlin/model/Documentable.kt | 52 ++++-- core/src/main/kotlin/pages/PageBuilder.kt | 12 +- core/src/main/kotlin/pages/PageContentBuilder.kt | 12 +- .../DefaultDescriptorToDocumentationTranslator.kt | 192 +++++++++++++++------ .../DefaultDocumentationNodeMerger.kt | 13 +- .../psi/DefaultPsiToDocumentationTranslator.kt | 46 ++++- gradle/wrapper/gradle-wrapper.properties | 5 +- plugins/kotlin-as-java/build.gradle.kts | 17 ++ ...linAsJavaDescriptorToDocumentationTranslator.kt | 75 ++++++++ .../src/main/kotlin/KotlinAsJavaPageBuilder.kt | 68 ++++++++ .../main/kotlin/KotlinAsJavaPageContentBuilder.kt | 65 +++++++ .../src/main/kotlin/KotlinAsJavaPlugin.kt | 39 +++++ .../src/main/kotlin/KotlinToJVMResolver.kt | 151 ++++++++++++++++ .../org.jetbrains.dokka.plugability.DokkaPlugin | 1 + .../src/test/kotlin/KotlinAsJavaPluginTest.kt | 98 +++++++++++ settings.gradle.kts | 2 +- 17 files changed, 751 insertions(+), 99 deletions(-) create mode 100644 plugins/kotlin-as-java/build.gradle.kts create mode 100644 plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt create mode 100644 plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt create mode 100644 plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt create mode 100644 plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt create mode 100644 plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt create mode 100644 plugins/kotlin-as-java/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin create mode 100644 plugins/kotlin-as-java/src/test/kotlin/KotlinAsJavaPluginTest.kt (limited to 'gradle/wrapper') diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 797b1d01..e9bdb9c1 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -38,6 +38,8 @@ + + diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 86ba24b7..1744e27f 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -4,7 +4,9 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.transformers.descriptors.KotlinClassKindTypes -import org.jetbrains.dokka.transformers.descriptors.KotlinTypeWrapper +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.descriptors.Visibility class Module(override val name: String, val packages: List) : Documentable() { override val dri: DRI = DRI.topLevel @@ -32,7 +34,8 @@ class Class( override val classlikes: List, override val expected: ClassPlatformInfo?, override val actual: List, - override val extra: MutableSet = mutableSetOf() + override val extra: MutableSet = mutableSetOf(), + override val visibility: Map ) : Classlike( name = name, dri = dri, @@ -43,7 +46,7 @@ class Class( expected = expected, actual = actual, extra = extra -) +), WithVisibility class Enum( override val dri: DRI, @@ -55,8 +58,9 @@ class Enum( override val classlikes: List = emptyList(), override val expected: ClassPlatformInfo? = null, override val actual: List, - override val extra: MutableSet = mutableSetOf() -) : Classlike(dri = dri, name = name, kind = KotlinClassKindTypes.ENUM_CLASS, actual = actual) { + override val extra: MutableSet = mutableSetOf(), + override val visibility: Map +) : Classlike(dri = dri, name = name, kind = KotlinClassKindTypes.ENUM_CLASS, actual = actual), WithVisibility { constructor(c: Classlike, entries: List, ctors: List) : this( dri = c.dri, name = c.name, @@ -67,7 +71,8 @@ class Enum( classlikes = c.classlikes, expected = c.expected, actual = c.actual, - extra = c.extra + extra = c.extra, + visibility = c.visibility ) override val children: List @@ -79,7 +84,8 @@ class EnumEntry( override val name: String, override val expected: ClassPlatformInfo? = null, override val actual: List, - override val extra: MutableSet = mutableSetOf() + override val extra: MutableSet = mutableSetOf(), + override val visibility: Map ) : Classlike( dri = dri, name = name, @@ -93,7 +99,8 @@ class EnumEntry( name = c.name, actual = c.actual, expected = c.expected, - extra = c.extra + extra = c.extra, + visibility = c.visibility ) override val children: List @@ -109,8 +116,9 @@ class Function( val parameters: List, override val expected: PlatformInfo?, override val actual: List, - override val extra: MutableSet = mutableSetOf() -) : CallableNode() { + override val extra: MutableSet = mutableSetOf(), + override val visibility: Map +) : CallableNode(), WithVisibility { override val children: List get() = listOfNotNull(receiver) + parameters } @@ -121,8 +129,10 @@ class Property( override val receiver: Parameter?, override val expected: PlatformInfo?, override val actual: List, - override val extra: MutableSet = mutableSetOf() -) : CallableNode() { + override val extra: MutableSet = mutableSetOf(), + val accessors: List, + override val visibility: Map +) : CallableNode(), WithVisibility { override val children: List get() = listOfNotNull(receiver) } @@ -208,7 +218,7 @@ abstract class Classlike( override val expected: ClassPlatformInfo? = null, override val actual: List, override val extra: MutableSet = mutableSetOf() -) : ScopeNode() { +) : ScopeNode(), WithVisibility { val inherited by lazy { platformInfo.mapNotNull { (it as? ClassPlatformInfo)?.inherited }.flatten() } } @@ -217,8 +227,12 @@ abstract class ScopeNode : Documentable() { abstract val properties: List abstract val classlikes: List - override val children: List - get() = functions + properties + classlikes + override val children: List // It is written so awkwardly because of type inference being lost here + get() = mutableListOf().apply { + addAll(functions) + addAll(properties) + addAll(classlikes) + } } abstract class CallableNode : Documentable() { @@ -235,6 +249,7 @@ interface TypeWrapper { val arguments: List val dri: DRI? } + interface ClassKind fun Documentable.dfs(predicate: (Documentable) -> Boolean): Documentable? = @@ -244,4 +259,9 @@ fun Documentable.dfs(predicate: (Documentable) -> Boolean): Documentable? = this.children.asSequence().mapNotNull { it.dfs(predicate) }.firstOrNull() } -interface Extra \ No newline at end of file +interface Extra +object STATIC : Extra + +interface WithVisibility { + val visibility: Map +} \ No newline at end of file diff --git a/core/src/main/kotlin/pages/PageBuilder.kt b/core/src/main/kotlin/pages/PageBuilder.kt index 7fe07ae4..df0c12c2 100644 --- a/core/src/main/kotlin/pages/PageBuilder.kt +++ b/core/src/main/kotlin/pages/PageBuilder.kt @@ -5,7 +5,7 @@ import org.jetbrains.dokka.model.Enum import org.jetbrains.dokka.model.Function import org.jetbrains.dokka.model.doc.TagWrapper -class DefaultPageBuilder( +open class DefaultPageBuilder( override val rootContentGroup: RootContentBuilder ) : PageBuilder { @@ -37,10 +37,10 @@ class DefaultPageBuilder( else -> throw IllegalStateException("$m should not be present here") } - private fun group(node: Documentable, content: PageContentBuilderFunction) = + protected open fun group(node: Documentable, content: PageContentBuilderFunction) = rootContentGroup(node, ContentKind.Main, content) - private fun contentForModule(m: Module) = group(m) { + protected open fun contentForModule(m: Module) = group(m) { header(1) { text("root") } block("Packages", 2, ContentKind.Packages, m.packages, m.platformData) { link(it.name, it.dri) @@ -49,7 +49,7 @@ class DefaultPageBuilder( text("Link to allpage here") } - private fun contentForPackage(p: Package) = group(p) { + protected open fun contentForPackage(p: Package) = group(p) { header(1) { text("Package ${p.name}") } block("Types", 2, ContentKind.Properties, p.classlikes, p.platformData) { link(it.name, it.dri) @@ -62,13 +62,13 @@ class DefaultPageBuilder( } } - private fun contentForClasslike(c: Classlike): ContentGroup = when (c) { + fun contentForClasslike(c: Classlike): ContentGroup = when (c) { is Class -> contentForClass(c) is Enum -> contentForEnum(c) else -> throw IllegalStateException("$c should not be present here") } - private fun contentForClass(c: Class) = group(c) { + protected fun contentForClass(c: Class) = group(c) { header(1) { text(c.name) } c.inherited.takeIf { it.isNotEmpty() }?.let { diff --git a/core/src/main/kotlin/pages/PageContentBuilder.kt b/core/src/main/kotlin/pages/PageContentBuilder.kt index d5ffe27a..bc01b03e 100644 --- a/core/src/main/kotlin/pages/PageContentBuilder.kt +++ b/core/src/main/kotlin/pages/PageContentBuilder.kt @@ -8,21 +8,21 @@ import org.jetbrains.dokka.model.TypeWrapper import org.jetbrains.dokka.model.doc.DocTag import org.jetbrains.dokka.utilities.DokkaLogger -class DefaultPageContentBuilder( +open class DefaultPageContentBuilder( private val dri: Set, private val platformData: Set, private val kind: Kind, private val commentsConverter: CommentsToContentConverter, - val logger: DokkaLogger, + open val logger: DokkaLogger, private val styles: Set