Skip to content

Commit

Permalink
~get rid of test-util module
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Mar 23, 2023
1 parent 611e680 commit 8cd4007
Show file tree
Hide file tree
Showing 29 changed files with 31 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ plugins {

configureDokkaVersion()

val projectsWithoutOptInDependency = setOf("integration-tests",
":integration-tests:gradle",
":integration-tests:maven",
":integration-tests:cli")

tasks.withType<KotlinCompile>().configureEach {
if (project.name in projectsWithoutOptInDependency) return@configureEach
compilerOptions {
freeCompilerArgs.addAll(
listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=org.jetbrains.dokka.InternalDokkaApi",
"-Xjsr305=strict",
"-Xskip-metadata-version-check",
// need 1.4 support, otherwise there might be problems with Gradle 6.x (it's bundling Kotlin 1.4)
"-Xsuppress-version-warnings"
"-Xsuppress-version-warnings",
)
)
allWarningsAsErrors.set(true)
Expand Down
11 changes: 0 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ val dokkaPublish by tasks.registering {
}
}

// opt-in into internal API on the project level
subprojects {
tasks.withType(KotlinCompile::class).all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=org.jetbrains.dokka.InternalDokkaApi")
}
}
}

apiValidation {
// note that subprojects are ignored by their name, not their path https://github.com/Kotlin/binary-compatibility-validator/issues/16
ignoredProjects += setOf(
Expand All @@ -60,7 +51,5 @@ apiValidation {
"gradle", // :integration-tests:gradle
"cli", // :integration-tests:cli
"maven", // integration-tests:maven

"test-utils", // :test-utils
)
}
6 changes: 0 additions & 6 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ tasks {
}
}

tasks.withType(KotlinCompile::class).all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=org.jetbrains.dokka.InternalDokkaApi",)
}
}

registerDokkaArtifactPublication("dokkaCore") {
artifactId = "dokka-core"
}
2 changes: 1 addition & 1 deletion integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
api(projects.testUtils)
implementation(kotlin("test-junit"))
implementation(libs.kotlinx.coroutines.core)
implementation(libs.jsoup)
implementation(libs.eclipse.jgit)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
package org.jetbrains.dokka.it.gradle

import org.gradle.testkit.runner.TaskOutcome
import org.jetbrains.dokka.test.assumeAndroidSdkInstalled
import org.junit.*
import org.junit.runners.Parameterized.Parameters
import java.io.File
import kotlin.test.*
import kotlin.test.Test

class Android0GradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() {

companion object {
@get:JvmStatic
@get:Parameters(name = "{0}")
val versions = TestedVersions.ANDROID

/**
* Indicating whether or not the current machine executing the test is a CI
*/
private val isCI: Boolean get() = System.getenv("CI") == "true"

private val isAndroidSdkInstalled: Boolean = System.getenv("ANDROID_SDK_ROOT") != null ||
System.getenv("ANDROID_HOME") != null

fun assumeAndroidSdkInstalled() {
if (isCI) return
Assume.assumeTrue(isAndroidSdkInstalled)
}

}

@BeforeTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun AbstractIntegrationTest.applyGitDiffFromFile(diffFile: File) {
private fun removeGitFile(repository: Path) =
repository.toFile()
.listFiles().orEmpty()
.filter { it.name.toLowerCase() == ".git" }
.filter { it.name.lowercase() == ".git" }
.forEach { it.delete() }


1 change: 0 additions & 1 deletion plugins/all-modules-page/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies {
implementation(libs.kotlinx.html)
implementation(libs.jsoup)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
2 changes: 1 addition & 1 deletion plugins/android-documentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

testImplementation(projects.plugins.base)
testImplementation(projects.plugins.base.baseTestUtils)
testImplementation(projects.testUtils)
implementation(kotlin("test-junit"))
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/base/base-test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies {
implementation(libs.jsoup)
implementation(kotlin("test-junit"))

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
2 changes: 1 addition & 1 deletion plugins/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
implementation(libs.kotlinx.html)

testImplementation(projects.kotlinAnalysis)
testImplementation(projects.testUtils)
implementation(kotlin("test-junit"))
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/gfm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies {
testImplementation(projects.plugins.base)
testImplementation(projects.plugins.base.baseTestUtils)
implementation(libs.jackson.kotlin)
testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/gfm/gfm-template-processing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies {

implementation(libs.kotlinx.coroutines.core)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/javadoc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies {
implementation(libs.kotlinx.coroutines.core)

testImplementation(projects.plugins.base.baseTestUtils)
testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)

testImplementation(libs.jsoup)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.jetbrains.dokka.test
package org.jetbrains.dokka.javadoc

import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.contracts.*

// TODO replace with assertIs<T> from kotlin-test as part of #2924
@OptIn(ExperimentalContracts::class)
inline fun <reified T> assertIsInstance(obj: Any?): T {
contract {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.jetbrains.dokka.javadoc.pages.AllClassesPage
import org.jetbrains.dokka.javadoc.pages.LinkJavadocListEntry
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.pages.ContentKind
import org.jetbrains.dokka.test.assertIsInstance
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.jetbrains.dokka.javadoc
import org.jetbrains.dokka.javadoc.pages.JavadocClasslikePageNode
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.jetbrains.dokka.test.assertIsInstance

internal class JavadocClasslikeTemplateMapTest : AbstractJavadocTemplateMapTest() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package org.jetbrains.dokka.javadoc
import org.jetbrains.dokka.javadoc.pages.JavadocModulePageNode
import org.jetbrains.dokka.javadoc.pages.RowJavadocListEntry
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.test.assertIsInstance
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.jetbrains.dokka.javadoc.pages.JavadocContentKind
import org.jetbrains.dokka.javadoc.pages.JavadocPackagePageNode
import org.jetbrains.dokka.javadoc.pages.RowJavadocListEntry
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.test.assertIsInstance
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.io.File
Expand Down
1 change: 0 additions & 1 deletion plugins/jekyll/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
implementation(projects.plugins.base)
implementation(projects.plugins.gfm)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/jekyll/jekyll-template-processing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies {

implementation(libs.kotlinx.coroutines.core)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/kotlin-as-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies {
testImplementation(libs.jsoup)
testImplementation(projects.kotlinAnalysis)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/mathjax/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies {
testImplementation(kotlin("test-junit"))
testImplementation(projects.kotlinAnalysis)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/templating/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {
implementation(libs.jsoup)
testImplementation(projects.plugins.base.baseTestUtils)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion plugins/versioning/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {
implementation(libs.jsoup)
implementation(libs.apache.mavenArtifact)

testImplementation(projects.testUtils)
testImplementation(projects.core.testApi)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter)
Expand Down
1 change: 0 additions & 1 deletion runners/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies {
compileOnly(libs.gradlePlugin.kotlin)
compileOnly(libs.gradlePlugin.android)

testImplementation(projects.testUtils)
testImplementation(libs.gradlePlugin.kotlin)
testImplementation(libs.gradlePlugin.android)
}
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ include(
":integration-tests:cli",
":integration-tests:maven",

":test-utils",

":mkdocs",
)

Expand Down
7 changes: 0 additions & 7 deletions test-utils/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8cd4007

Please sign in to comment.