CLI: drop CompilerArguments and unnecessary methods from *CompilerArguments classes
This commit is contained in:
+2
-2
@@ -27,9 +27,9 @@ class Html2CompilerPlugin(private val compilerArguments: KDocArguments) : Doclet
|
||||
|
||||
private val sourceDirs: List<File> =
|
||||
compilerArguments
|
||||
.getSourceDirs()
|
||||
.src
|
||||
.orEmpty()
|
||||
.requireNoNulls()
|
||||
.split(File.pathSeparatorChar)
|
||||
.map { path -> File(path).getCanonicalFile()!! }
|
||||
|
||||
private val sourceDirPaths: List<String> = sourceDirs.map { d -> d.getPath()!! }
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ abstract class KModelCompilerPlugin(
|
||||
public override fun processFiles(context: CompilerPluginContext) {
|
||||
val bindingContext = context.getContext()
|
||||
val sources = context.getFiles()
|
||||
val sourceDirs: List<File> = arguments.getSourceDirs().orEmpty().requireNoNulls().map { path -> File(path) }
|
||||
val sourceDirs: List<File> = arguments.src.orEmpty().split(File.pathSeparatorChar).map { path -> File(path) }
|
||||
val model = KModel(bindingContext, arguments.apply(), sourceDirs, sources.requireNoNulls())
|
||||
|
||||
processModel(model)
|
||||
|
||||
@@ -22,8 +22,8 @@ class HtmlVisitorTest {
|
||||
|
||||
val args = K2JVMCompilerArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
args.setSrc(srcDir.toString())
|
||||
args.setOutputDir(File(dir, "target/classes-htmldocs").toString())
|
||||
args.src = srcDir.toString()
|
||||
args.outputDir = File(dir, "target/classes-htmldocs").toString()
|
||||
|
||||
val compiler = K2JVMCompiler()
|
||||
compiler.getCompilerPlugins().add(HtmlCompilerPlugin())
|
||||
|
||||
@@ -40,7 +40,7 @@ class KDocSampleTest {
|
||||
val args = KDocArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
|
||||
args.setSourceDirs(arrayList("src/test/sample"))
|
||||
args.src = "src/test/sample"
|
||||
|
||||
val outputDir = File("target/apidocs-sample")
|
||||
outputDir.rmrf()
|
||||
|
||||
@@ -8,6 +8,7 @@ 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
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -24,16 +25,15 @@ class KDocTest {
|
||||
println("Generating library KDocs to $outDir")
|
||||
|
||||
val args = KDocArguments()
|
||||
//args.setModule(moduleName)
|
||||
//args.module = moduleName
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
val sourceDirs = ArrayList<String>()
|
||||
sourceDirs.add("../../stdlib/src")
|
||||
sourceDirs.add("../../kunit/src/main/kotlin")
|
||||
sourceDirs.add("../../kotlin-jdbc/src/main/kotlin")
|
||||
args.setSourceDirs(sourceDirs)
|
||||
args.setOutputDir("target/classes-stdlib")
|
||||
args.setNoStdlib(true)
|
||||
args.setClasspath("../runtime/target/kotlin-runtime-0.1-SNAPSHOT.jar${File.pathSeparator}../../lib/junit-4.9.jar")
|
||||
val sourceDirs = listOf("../../stdlib/src",
|
||||
"../../kunit/src/main/kotlin",
|
||||
"../../kotlin-jdbc/src/main/kotlin")
|
||||
args.src = sourceDirs.makeString(File.pathSeparator)
|
||||
args.outputDir = "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()
|
||||
|
||||
Reference in New Issue
Block a user