refactored out the KDocLoader stuff from the KotlinCompiler; also introduced CompilerPluginContext to wrap up the Project, BindingContext and List<JetFiles> in case a plugin were to need any of those things (or we added extra stuff later like the environment)
This commit is contained in:
@@ -468,14 +468,20 @@
|
|||||||
<include name="maven/src"/>
|
<include name="maven/src"/>
|
||||||
<include name="gradle/src"/>
|
<include name="gradle/src"/>
|
||||||
</dirset>
|
</dirset>
|
||||||
|
<dirset dir="${basedir}/js">
|
||||||
|
<include name="js.translator/src"/>
|
||||||
|
</dirset>
|
||||||
|
<!--
|
||||||
<dirset dir="${basedir}/j2k">
|
<dirset dir="${basedir}/j2k">
|
||||||
<include name="src"/>
|
<include name="src"/>
|
||||||
</dirset>
|
</dirset>
|
||||||
|
-->
|
||||||
</src>
|
</src>
|
||||||
<compilerarg value="-Xlint:all"/>
|
<compilerarg value="-Xlint:all"/>
|
||||||
<classpath>
|
<classpath>
|
||||||
<path refid = "classpath.kotlin"/>
|
<path refid = "classpath.kotlin"/>
|
||||||
<fileset dir = "${ant.home}/lib" includes="*.jar"/>
|
<fileset dir = "${ant.home}/lib" includes="*.jar"/>
|
||||||
|
<fileset dir = "${basedir}/js/js.translator/lib" includes="*.jar"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<jar destfile="${kotlin-home}/lib/kotlin-build-tools.jar">
|
<jar destfile="${kotlin-home}/lib/kotlin-build-tools.jar">
|
||||||
|
|||||||
@@ -170,6 +170,9 @@
|
|||||||
<fileset dir="${idea.sdk}/core" includes="*.jar"/>
|
<fileset dir="${idea.sdk}/core" includes="*.jar"/>
|
||||||
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
|
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
<copy todir="${kotlin-home}/lib/js">
|
||||||
|
<fileset dir="${basedir}/js/js.translator/lib" includes="**/*.jar"/>
|
||||||
|
</copy>
|
||||||
<copy todir="${kotlin-home}/bin">
|
<copy todir="${kotlin-home}/bin">
|
||||||
<fileset dir="${basedir}/compiler/cli/bin"/>
|
<fileset dir="${basedir}/compiler/cli/bin"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ public class CompilerArguments {
|
|||||||
@Argument(value = "output", description = "output directory")
|
@Argument(value = "output", description = "output directory")
|
||||||
public String outputDir;
|
public String outputDir;
|
||||||
|
|
||||||
@Argument(value = "docOutput", description = "KDoc output directory")
|
|
||||||
public String docOutputDir;
|
|
||||||
|
|
||||||
@Argument(value = "jar", description = "jar file name")
|
@Argument(value = "jar", description = "jar file name")
|
||||||
public String jar;
|
public String jar;
|
||||||
|
|
||||||
@@ -77,14 +74,6 @@ public class CompilerArguments {
|
|||||||
this.classpath = classpath;
|
this.classpath = classpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDocOutputDir() {
|
|
||||||
return docOutputDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDocOutputDir(String docOutputDir) {
|
|
||||||
this.docOutputDir = docOutputDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isHelp() {
|
public boolean isHelp() {
|
||||||
return help;
|
return help;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,100 +0,0 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright ownership.
|
|
||||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
||||||
* (the "License"); you may not use this file except in compliance with
|
|
||||||
* the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.jetbrains.jet.cli;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.intellij.lang.ASTNode;
|
|
||||||
import com.intellij.openapi.Disposable;
|
|
||||||
import com.intellij.psi.PsiElement;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.jet.compiler.CompilerPlugin;
|
|
||||||
import org.jetbrains.jet.compiler.JetCoreEnvironment;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetPsiFactory;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
|
||||||
import org.jetbrains.jet.lexer.JetTokens;
|
|
||||||
import org.jetbrains.jet.resolve.DescriptorRenderer;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple facade to auto-detect the KDoc processor if its available on the classpath
|
|
||||||
*/
|
|
||||||
public class KDocLoader {
|
|
||||||
|
|
||||||
private final String outputDir;
|
|
||||||
|
|
||||||
public KDocLoader(String outputDir) {
|
|
||||||
this.outputDir = outputDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CompilerPlugin createCompilerPlugin() {
|
|
||||||
// lets see if we can see the KDoc class
|
|
||||||
String name = "org.jetbrains.kotlin.doc.KDoc";
|
|
||||||
Class<?> aClass = null;
|
|
||||||
try {
|
|
||||||
aClass = loadClass(name);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
System.out.println("Could not find class: " + name);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (aClass != null) {
|
|
||||||
try {
|
|
||||||
File dir = new File(outputDir);
|
|
||||||
Constructor<?> constructor = aClass.getConstructor(File.class);
|
|
||||||
if (constructor != null) {
|
|
||||||
return (CompilerPlugin) constructor.newInstance(dir);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.out.println("Failed to create Processor: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Class<?> loadClass(String name) throws ClassNotFoundException {
|
|
||||||
try {
|
|
||||||
return Class.forName(name);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
try {
|
|
||||||
return Thread.currentThread().getContextClassLoader().loadClass(name);
|
|
||||||
} catch (ClassNotFoundException e1) {
|
|
||||||
return KDocLoader.class.getClassLoader().loadClass(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Installs the KDoc compiler plugin if it can be created
|
|
||||||
*/
|
|
||||||
public static boolean install(String docOutputDir, JetCoreEnvironment environment) {
|
|
||||||
KDocLoader loader = new KDocLoader(docOutputDir);
|
|
||||||
CompilerPlugin processor = loader.createCompilerPlugin();
|
|
||||||
if (processor != null) {
|
|
||||||
environment.getCompilerPlugins().add(processor);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -166,13 +166,13 @@ public class KotlinCompiler {
|
|||||||
environment.setStubs(arguments.stubs);
|
environment.setStubs(arguments.stubs);
|
||||||
|
|
||||||
if (arguments.docOutputDir != null) {
|
if (arguments.docOutputDir != null) {
|
||||||
KDocLoader.install(arguments.docOutputDir, environment.getEnvironment());
|
KDocLoader.install(arguments.docOutputDir, environment.getMyEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
// install any compiler plugins
|
// install any compiler plugins
|
||||||
List<CompilerPlugin> plugins = arguments.getCompilerPlugins();
|
List<CompilerPlugin> plugins = arguments.getCompilerPlugins();
|
||||||
if (plugins != null) {
|
if (plugins != null) {
|
||||||
environment.getEnvironment().getCompilerPlugins().addAll(plugins);
|
environment.getMyEnvironment().getCompilerPlugins().addAll(plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arguments.stdlib != null) {
|
if (arguments.stdlib != null) {
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
/**
|
/*
|
||||||
|
* Copyright 2010-2012 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* you may not use this file except in compliance with the License.
|
||||||
* this work for additional information regarding copyright ownership.
|
* You may obtain a copy of the License at
|
||||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
||||||
* (the "License"); you may not use this file except in compliance with
|
|
||||||
* the License. You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
@@ -15,17 +13,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.jet.compiler;
|
package org.jetbrains.jet.compiler;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple interface for compiler plugins to run after the compiler has finished such as for things like
|
* A simple interface for compiler plugins to run after the compiler has finished such as for things like
|
||||||
* generating documentation or code generation etc
|
* generating documentation or code generation etc
|
||||||
*/
|
*/
|
||||||
public interface CompilerPlugin {
|
public interface CompilerPlugin {
|
||||||
void processFiles(BindingContext context, List<JetFile> sources);
|
void processFiles(CompilerPluginContext context);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2012 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.jet.compiler;
|
||||||
|
|
||||||
|
import com.intellij.openapi.project.Project;
|
||||||
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the context of available state in which a {@link CompilerPlugin} runs such as
|
||||||
|
* the {@link Project}, the {@link BindingContext} and the underlying {@link JetFile} files.
|
||||||
|
*/
|
||||||
|
public class CompilerPluginContext {
|
||||||
|
private final Project project;
|
||||||
|
private final BindingContext context;
|
||||||
|
private final List<JetFile> files;
|
||||||
|
|
||||||
|
public CompilerPluginContext(Project project, BindingContext context, List<JetFile> files) {
|
||||||
|
this.project = project;
|
||||||
|
this.context = context;
|
||||||
|
this.files = files;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindingContext getContext() {
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JetFile> getFiles() {
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Project getProject() {
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,12 +32,13 @@ import org.jetbrains.jet.util.slicedmap.WritableSlice
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
||||||
|
|
||||||
/** Generates the Kotlin Documentation for the model */
|
/** Generates the Kotlin Documentation for the model */
|
||||||
class KDoc(val outputDir: File) : KModelCompilerPlugin() {
|
class KDoc() : KModelCompilerPlugin() {
|
||||||
|
|
||||||
override fun processModel(model: KModel) {
|
override fun processModel(model: KModel) {
|
||||||
// TODO allow this to be configured; maybe we use configuration on the KotlinModule
|
// TODO allow this to be configured; maybe we use configuration on the KotlinModule
|
||||||
// to define what doclets to use?
|
// to define what doclets to use?
|
||||||
val generator = JavadocStyleHtmlDoclet()
|
val generator = JavadocStyleHtmlDoclet()
|
||||||
|
val outputDir = File(config.docOutputDir)
|
||||||
generator.generate(model, outputDir)
|
generator.generate(model, outputDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ fun main(args: Array<String?>): Unit {
|
|||||||
KotlinCompiler.doMain(KDocCompiler(), args);
|
KotlinCompiler.doMain(KDocCompiler(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A version of the [[KotlinCompiler]] which includes the [[KDoc]] compiler plugin and allows
|
* A version of the [[KotlinCompiler]] which includes the [[KDoc]] compiler plugin and allows
|
||||||
* command line validation or for the configuration to be provided via [[KDocArguments]]
|
* command line validation or for the configuration to be provided via [[KDocArguments]]
|
||||||
@@ -22,20 +21,10 @@ fun main(args: Array<String?>): Unit {
|
|||||||
class KDocCompiler() : KotlinCompiler() {
|
class KDocCompiler() : KotlinCompiler() {
|
||||||
|
|
||||||
override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
||||||
// TODO lets clear the docOutput as a temporary hack while
|
|
||||||
// KotlinCompiler has a KDoc hook...
|
|
||||||
val docOutputDir = if (arguments != null) {
|
|
||||||
val answer = arguments.docOutputDir
|
|
||||||
arguments.docOutputDir = null
|
|
||||||
answer
|
|
||||||
} else null
|
|
||||||
|
|
||||||
super.configureEnvironment(environment, arguments, errStream)
|
super.configureEnvironment(environment, arguments, errStream)
|
||||||
val coreEnvironment = environment?.getMyEnvironment()
|
val coreEnvironment = environment?.getMyEnvironment()
|
||||||
if (coreEnvironment != null) {
|
if (coreEnvironment != null) {
|
||||||
// now lets add the KDoc plugin
|
val kdoc = KDoc()
|
||||||
val outDir = File(docOutputDir ?: "target/apidocs")
|
|
||||||
val kdoc = KDoc(outDir)
|
|
||||||
|
|
||||||
if (arguments is KDocArguments) {
|
if (arguments is KDocArguments) {
|
||||||
kdoc.config = arguments.apply()
|
kdoc.config = arguments.apply()
|
||||||
@@ -69,13 +58,4 @@ class KDocArguments() : CompilerArguments() {
|
|||||||
// TODO...
|
// TODO...
|
||||||
return docConfig
|
return docConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add more configurations here when value attributes supported
|
|
||||||
* see: KT-1522
|
|
||||||
|
|
||||||
@Argument(value = "docOutput", description = "KDoc output directory")
|
|
||||||
public String docOutputDir;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ import org.jetbrains.kotlin.doc.model.KPackage
|
|||||||
*/
|
*/
|
||||||
class KDocConfig() {
|
class KDocConfig() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the directory to use to output the API docs
|
||||||
|
*/
|
||||||
|
public var docOutputDir: String = "target/site/apidocs"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the documentation set
|
* Returns the name of the documentation set
|
||||||
*/
|
*/
|
||||||
|
|||||||
+15
-12
@@ -1,23 +1,26 @@
|
|||||||
package org.jetbrains.kotlin.doc.highlighter
|
package org.jetbrains.kotlin.doc.highlighter
|
||||||
|
|
||||||
import org.jetbrains.jet.compiler.CompilerPlugin
|
import org.jetbrains.jet.compiler.CompilerPlugin
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext
|
import org.jetbrains.jet.compiler.CompilerPluginContext
|
||||||
import java.util.List
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFile
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class HtmlCompilerPlugin : CompilerPlugin {
|
class HtmlCompilerPlugin: CompilerPlugin {
|
||||||
|
|
||||||
override fun processFiles(bindingContext: BindingContext?, files: List<JetFile?>?) {
|
override fun processFiles(context: CompilerPluginContext?) {
|
||||||
if (files != null && bindingContext != null) {
|
if (context != null) {
|
||||||
for (file in files) {
|
val bindingContext = context.getContext()
|
||||||
if (file != null) {
|
val files = context.getFiles()
|
||||||
val visitor = HtmlKotlinVisitor()
|
if (bindingContext != null && files != null) {
|
||||||
file.accept(visitor)
|
if (files != null && bindingContext != null) {
|
||||||
|
for (file in files) {
|
||||||
|
if (file != null) {
|
||||||
|
val visitor = HtmlKotlinVisitor()
|
||||||
|
file.accept(visitor)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+13
-36
@@ -1,48 +1,25 @@
|
|||||||
package org.jetbrains.kotlin.doc.model
|
package org.jetbrains.kotlin.doc.model
|
||||||
|
|
||||||
import kotlin.*
|
|
||||||
import kotlin.util.*
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.doc.KDocConfig
|
|
||||||
import org.jetbrains.kotlin.doc.templates.*
|
|
||||||
import org.jetbrains.kotlin.template.TextTemplate
|
|
||||||
|
|
||||||
import java.io.File
|
|
||||||
import java.util.List
|
|
||||||
import java.util.HashSet
|
|
||||||
import java.util.Collection
|
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext.*
|
|
||||||
import org.jetbrains.jet.compiler.CompilerPlugin
|
import org.jetbrains.jet.compiler.CompilerPlugin
|
||||||
import org.jetbrains.jet.lang.psi.JetFile
|
import org.jetbrains.jet.compiler.CompilerPluginContext
|
||||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor
|
import org.jetbrains.kotlin.doc.KDocConfig
|
||||||
import org.jetbrains.jet.lexer.JetTokens
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
|
||||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor
|
|
||||||
import org.jetbrains.jet.lang.types.JetType
|
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ModuleDescriptor
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaNamespaceDescriptor
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor
|
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope
|
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExtensionReceiver
|
|
||||||
import org.jetbrains.jet.util.slicedmap.WritableSlice
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
|
||||||
|
|
||||||
|
|
||||||
/** Base class for any compiler plugin which needs to process a KModel */
|
/** Base class for any compiler plugin which needs to process a KModel */
|
||||||
abstract class KModelCompilerPlugin : CompilerPlugin {
|
abstract class KModelCompilerPlugin: CompilerPlugin {
|
||||||
|
|
||||||
public open var config: KDocConfig = KDocConfig()
|
public open var config: KDocConfig = KDocConfig()
|
||||||
|
|
||||||
override fun processFiles(context: BindingContext?, sources: List<JetFile?>?) {
|
|
||||||
if (context != null && sources != null) {
|
|
||||||
val model = KModel(context, config)
|
|
||||||
model.load(sources)
|
|
||||||
|
|
||||||
processModel(model)
|
override fun processFiles(context: CompilerPluginContext?) {
|
||||||
|
if (context != null) {
|
||||||
|
val bindingContext = context.getContext()
|
||||||
|
val sources = context.getFiles()
|
||||||
|
if (bindingContext != null && sources != null) {
|
||||||
|
val model = KModel(bindingContext, config)
|
||||||
|
model.load(sources)
|
||||||
|
|
||||||
|
processModel(model)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ class KDocTest {
|
|||||||
|
|
||||||
val args = KDocArguments()
|
val args = KDocArguments()
|
||||||
args.setModule(moduleName)
|
args.setModule(moduleName)
|
||||||
args.setDocOutputDir(outDir.toString())
|
|
||||||
args.setOutputDir("target/classes-stdlib")
|
args.setOutputDir("target/classes-stdlib")
|
||||||
|
|
||||||
val config = args.docConfig
|
val config = args.docConfig
|
||||||
|
config.docOutputDir = outDir.toString()!!
|
||||||
config.title = "Kotlin API"
|
config.title = "Kotlin API"
|
||||||
config.ignorePackages.add("org.jetbrains.kotlin")
|
config.ignorePackages.add("org.jetbrains.kotlin")
|
||||||
config.ignorePackages.add("java")
|
config.ignorePackages.add("java")
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ class GenerateSiteTest : TestCase() {
|
|||||||
copyDocResources(outDir)
|
copyDocResources(outDir)
|
||||||
val args = KDocArguments()
|
val args = KDocArguments()
|
||||||
args.setModule("../kdoc/ApiDocsModule.kt")
|
args.setModule("../kdoc/ApiDocsModule.kt")
|
||||||
args.setDocOutputDir(outDir.toString())
|
|
||||||
args.setOutputDir("target/classes-stdlib")
|
args.setOutputDir("target/classes-stdlib")
|
||||||
|
|
||||||
val config = args.docConfig
|
val config = args.docConfig
|
||||||
|
config.docOutputDir = outDir.getPath()!!
|
||||||
config.title = "Kotlin API ($version)"
|
config.title = "Kotlin API ($version)"
|
||||||
config.version = version
|
config.version = version
|
||||||
config.ignorePackages.add("kotlin.support")
|
config.ignorePackages.add("kotlin.support")
|
||||||
@@ -49,10 +49,10 @@ class GenerateSiteTest : TestCase() {
|
|||||||
copyDocResources(outDir)
|
copyDocResources(outDir)
|
||||||
val args = KDocArguments()
|
val args = KDocArguments()
|
||||||
args.setModule("../../js/js.libraries/module.kt")
|
args.setModule("../../js/js.libraries/module.kt")
|
||||||
args.setDocOutputDir(outDir.toString())
|
|
||||||
args.setOutputDir("target/classes-js")
|
args.setOutputDir("target/classes-js")
|
||||||
|
|
||||||
val config = args.docConfig
|
val config = args.docConfig
|
||||||
|
config.docOutputDir = outDir.getPath()!!
|
||||||
config.title = "Kotlin JS API ($version)"
|
config.title = "Kotlin JS API ($version)"
|
||||||
config.version = version
|
config.version = version
|
||||||
config.ignorePackages.add("java")
|
config.ignorePackages.add("java")
|
||||||
|
|||||||
Reference in New Issue
Block a user