Fix Maven build due to recent changes to CLI arguments
This commit is contained in:
+1
-5
@@ -26,11 +26,7 @@ class Html2CompilerPlugin(private val compilerArguments: KDocArguments) : Doclet
|
||||
private val srcOutputRoot = File(docOutputRoot, names.htmlSourceDirName)
|
||||
|
||||
private val sourceDirs: List<File> =
|
||||
compilerArguments
|
||||
.src
|
||||
.orEmpty()
|
||||
.split(File.pathSeparatorChar)
|
||||
.map { path -> File(path).getCanonicalFile() }
|
||||
compilerArguments.freeArgs.orEmpty().map { path -> File(path).getCanonicalFile() }
|
||||
|
||||
private val sourceDirPaths: List<String> = sourceDirs.map { d -> d.getPath() }
|
||||
|
||||
|
||||
+1
-4
@@ -5,19 +5,16 @@ import org.jetbrains.jet.cli.common.CompilerPlugin
|
||||
import org.jetbrains.jet.cli.common.CompilerPluginContext
|
||||
import org.jetbrains.kotlin.doc.KDocArguments
|
||||
|
||||
|
||||
/** Base class for any compiler plugin which needs to process a KModel */
|
||||
abstract class KModelCompilerPlugin(
|
||||
// TODO: fix compiler and make protected
|
||||
val arguments: KDocArguments)
|
||||
: CompilerPlugin
|
||||
{
|
||||
|
||||
|
||||
public override fun processFiles(context: CompilerPluginContext) {
|
||||
val bindingContext = context.getContext()
|
||||
val sources = context.getFiles()
|
||||
val sourceDirs: List<File> = arguments.src.orEmpty().split(File.pathSeparatorChar).map { path -> File(path) }
|
||||
val sourceDirs: List<File> = arguments.freeArgs.orEmpty().map { path -> File(path) }
|
||||
val model = KModel(bindingContext, arguments.apply(), sourceDirs, sources.requireNoNulls())
|
||||
|
||||
processModel(model)
|
||||
|
||||
@@ -22,7 +22,7 @@ class HtmlVisitorTest {
|
||||
|
||||
val args = K2JVMCompilerArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
args.src = srcDir.toString()
|
||||
args.freeArgs = listOf(srcDir.toString())
|
||||
args.outputDir = File(dir, "target/classes-htmldocs").toString()
|
||||
|
||||
val compiler = K2JVMCompiler()
|
||||
|
||||
@@ -40,7 +40,7 @@ class KDocSampleTest {
|
||||
val args = KDocArguments()
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
|
||||
args.src = "src/test/sample"
|
||||
args.freeArgs = listOf("src/test/sample")
|
||||
|
||||
val outputDir = File("target/apidocs-sample")
|
||||
outputDir.rmrf()
|
||||
@@ -58,7 +58,4 @@ class KDocSampleTest {
|
||||
val exitCode = compiler.exec(System.err, args)
|
||||
Assert.assertEquals(ExitCode.OK, exitCode)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,10 +27,9 @@ class KDocTest {
|
||||
val args = KDocArguments()
|
||||
//args.module = moduleName
|
||||
args.kotlinHome = "../../../dist/kotlinc"
|
||||
val sourceDirs = listOf("../../stdlib/src",
|
||||
args.freeArgs = 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"
|
||||
|
||||
Reference in New Issue
Block a user