Skip to content

Commit

Permalink
added DataFrameTest, updating java version to 11, gradle to 8.5, fixi…
Browse files Browse the repository at this point in the history
…ng test
  • Loading branch information
Jolanrensen committed Feb 22, 2024
1 parent 3c46eaf commit cb99d93
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ hs_err_pid*
/kdoc-include-gradle-plugin/build/
/build/
/.idea/
/doc-processor-gradle-plugin/src/functionalTest/resources/dataframe/
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.kotest.matchers.shouldBe
import nl.jolanrensen.docProcessor.defaultProcessors.IncludeDocProcessor
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.Test
import kotlin.test.Ignore

class TestInclude : DocProcessorTest("include") {

Expand All @@ -14,6 +15,7 @@ class TestInclude : DocProcessorTest("include") {
// TODO

@Test
@Ignore
fun `Include with and without package kotlin`() {

@Language("kt")
Expand Down
4 changes: 2 additions & 2 deletions doc-processor-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ tasks.check {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(11))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package nl.jolanrensen.docProcessor

import org.gradle.testkit.runner.GradleRunner
import org.junit.Ignore
import org.junit.Test
import java.io.File
import kotlin.io.path.Path
import kotlin.io.path.exists

class DataFrameTest : DocProcessorFunctionalTest("df") {

private val projectDirectory = File("src/functionalTest/resources/dataframe")
private val outputDirectory = File(projectDirectory, "core/build/generated-sources")

init {
require(projectDirectory.exists()) {
"The DataFrame directory does not exist. Please git clone the repository in the resources folder."
}
updateVersionInFiles()
}

private fun updateVersionInFiles() {
val tomlFile = projectDirectory.resolve("gradle/libs.versions.toml")
var txt = tomlFile.readText()
txt = txt.replace("docProcessor = \"[^\"]+\"".toRegex(), "docProcessor = \"$version\"")
tomlFile.write(txt)
}

@Test
// @Ignore
fun `build DataFrame`() {
GradleRunner.create()
.forwardOutput()
.withArguments("clean", "core:processKDocsMain")
.withProjectDir(projectDirectory)
.withDebug(true)
.build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ class TestInclude : DocProcessorFunctionalTest(name = "include") {
val expectedOutput = """
package com.example.plugin
/**
* Hello World!
* [Some aliased link][helloWorld2]
* [helloWorld\]
* [helloWorld]
*/
/**
* Hello World!
* [Some aliased link][helloWorld2]
* [helloWorld]
* [helloWorld]
*/
fun helloWorld() {}
/** Hello World!
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit cb99d93

Please sign in to comment.