KDoc: drop "-docOutput" CLI argument
It was never supported in kdoc-cli. It is still supported as an argument in kdoc-maven-plugin
This commit is contained in:
@@ -34,7 +34,7 @@ class KDocCompiler() : K2JVMCompiler() {
|
||||
}
|
||||
|
||||
protected override fun usage(target: PrintStream, extraHelp: Boolean) {
|
||||
target.println("Usage: KDocCompiler -docOutput <docOutputDir> -d [<directory>|<jar>] [-stdlib <path to runtime.jar>] [<path>|-module <module file>] [-include-runtime]");
|
||||
target.println("Usage: KDocCompiler -d [<directory>|<jar>] [-stdlib <path to runtime.jar>] [<path>|-module <module file>] [-include-runtime]");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@ package test.kotlin.kdoc
|
||||
import java.io.File
|
||||
import kotlin.test.assertTrue
|
||||
import org.jetbrains.jet.cli.jvm.K2JVMCompiler
|
||||
import org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments;
|
||||
import org.jetbrains.kotlin.doc.highlighter.HtmlCompilerPlugin
|
||||
import org.junit.Test
|
||||
|
||||
class HtmlVisitorTest {
|
||||
|
||||
Test fun generateHtmlFromSource() {
|
||||
val src = "src/test/sample"
|
||||
var dir = File(".")
|
||||
@@ -20,13 +18,13 @@ class HtmlVisitorTest {
|
||||
val outDir = File(dir, "target/htmldocs")
|
||||
println("Generating source HTML to $outDir")
|
||||
|
||||
val args = K2JVMCompilerArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
args.freeArgs = listOf(srcDir.toString())
|
||||
args.destination = File(dir, "target/classes-htmldocs").toString()
|
||||
|
||||
val compiler = K2JVMCompiler()
|
||||
compiler.getCompilerPlugins().add(HtmlCompilerPlugin())
|
||||
compiler.exec(System.out, args)
|
||||
compiler.exec(
|
||||
System.out,
|
||||
"-kotlin-home", "../../../dist/kotlinc",
|
||||
"-d", File(dir, "target/classes-htmldocs").toString(),
|
||||
srcDir.toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package test.kotlin.kdoc
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import org.jetbrains.jet.cli.common.ExitCode
|
||||
import org.jetbrains.kotlin.doc.KDocArguments
|
||||
import org.jetbrains.kotlin.doc.KDocCompiler
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
@@ -32,30 +31,20 @@ fun File.mkdirsProperly() {
|
||||
|
||||
|
||||
class KDocSampleTest {
|
||||
|
||||
[Test]
|
||||
fun generateKDocForSample() {
|
||||
val compiler = KDocCompiler()
|
||||
|
||||
val args = KDocArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
|
||||
args.freeArgs = listOf("src/test/sample")
|
||||
|
||||
val outputDir = File("target/apidocs-sample")
|
||||
outputDir.rmrf()
|
||||
outputDir.mkdirsProperly()
|
||||
|
||||
val classesOutputDir = File("target/classes-sample")
|
||||
classesOutputDir.rmrf()
|
||||
classesOutputDir.mkdirsProperly()
|
||||
|
||||
args.destination = classesOutputDir.getPath()
|
||||
|
||||
args.docConfig.docOutputDir = outputDir.getPath()
|
||||
args.docConfig.title = "Sample"
|
||||
|
||||
val exitCode = compiler.exec(System.err, args)
|
||||
val exitCode = compiler.exec(
|
||||
System.err,
|
||||
"-kotlin-home", "../../../dist/kotlinc",
|
||||
"-d", classesOutputDir.getPath(),
|
||||
"src/test/sample"
|
||||
)
|
||||
Assert.assertEquals(ExitCode.OK, exitCode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package test.kotlin.kdoc
|
||||
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
import kotlin.test.assertTrue
|
||||
import org.jetbrains.jet.cli.common.ExitCode
|
||||
import org.jetbrains.kotlin.doc.KDocArguments
|
||||
import org.jetbrains.kotlin.doc.KDocCompiler
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
|
||||
/**
|
||||
*/
|
||||
class KDocTest {
|
||||
Test fun generateKDocForStandardLibrary() {
|
||||
var moduleName = "ApiDocsModule.kt"
|
||||
@@ -24,29 +19,15 @@ class KDocTest {
|
||||
val outDir = File(dir, "target/apidocs")
|
||||
println("Generating library KDocs to $outDir")
|
||||
|
||||
val args = KDocArguments()
|
||||
//args.module = moduleName
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
args.freeArgs = listOf("../../stdlib/src",
|
||||
"../../kunit/src/main/kotlin",
|
||||
"../../kotlin-jdbc/src/main/kotlin")
|
||||
args.destination = "target/classes-stdlib"
|
||||
args.noStdlib = true
|
||||
args.classpath = "../runtime/target/kotlin-runtime-0.1-SNAPSHOT.jar${File.pathSeparator}../../lib/junit-4.9.jar"
|
||||
|
||||
val config = args.docConfig
|
||||
config.docOutputDir = outDir.toString()
|
||||
config.title = "Kotlin API"
|
||||
|
||||
val ignorePackages = config.ignorePackages
|
||||
ignorePackages.add("org.jetbrains.kotlin")
|
||||
ignorePackages.add("java")
|
||||
ignorePackages.add("junit")
|
||||
ignorePackages.add("sun")
|
||||
ignorePackages.add("org")
|
||||
|
||||
val compiler = KDocCompiler()
|
||||
val r = compiler.exec(System.out, args)
|
||||
val r = compiler.exec(
|
||||
System.out,
|
||||
"-kotlin-home", "../../../dist/kotlinc",
|
||||
"-d", "target/classes-stdlib",
|
||||
"-no-stdlib",
|
||||
"-classpath", "../runtime/target/kotlin-runtime-0.1-SNAPSHOT.jar${File.pathSeparator}../../lib/junit-4.9.jar",
|
||||
"../../stdlib/src", "../../kunit/src/main/kotlin", "../../kotlin-jdbc/src/main/kotlin"
|
||||
)
|
||||
Assert.assertEquals(ExitCode.OK, r)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user