diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 20:49:04 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-11 20:49:04 +0400 |
commit | 044308ba60a0d4462ccb7388f16ad17a31d7450d (patch) | |
tree | c93411f0670e29fe333962789c0df97b1602f7be /src/CompilerAPI.kt | |
parent | 8a4dad46b171c55dabc5f9be29e1261e1cc5928e (diff) | |
download | dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.gz dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.bz2 dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.zip |
Complete package migration and move files into folders.
Diffstat (limited to 'src/CompilerAPI.kt')
-rw-r--r-- | src/CompilerAPI.kt | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/CompilerAPI.kt b/src/CompilerAPI.kt deleted file mode 100644 index f3c801a7..00000000 --- a/src/CompilerAPI.kt +++ /dev/null @@ -1,62 +0,0 @@ -package org.jetbrains.dokka - -import org.jetbrains.jet.cli.common.arguments.* -import org.jetbrains.jet.cli.common.messages.* -import org.jetbrains.jet.cli.jvm.* -import org.jetbrains.jet.cli.jvm.compiler.* -import org.jetbrains.jet.utils.* -import java.io.* -import org.jetbrains.jet.lang.resolve.java.* -import com.google.common.base.* -import com.intellij.psi.* -import org.jetbrains.jet.lang.resolve.* -import org.jetbrains.jet.lang.psi.* -import org.jetbrains.jet.analyzer.* -import org.jetbrains.jet.lang.descriptors.* - -private fun getAnnotationsPath(paths: KotlinPaths, arguments: K2JVMCompilerArguments): MutableList<File> { - val annotationsPath = arrayListOf<File>() - annotationsPath.add(paths.getJdkAnnotationsPath()) - val annotationPaths = arguments.annotations - if (annotationPaths != null) { - for (element in annotationPaths.split(File.pathSeparatorChar)) { - annotationsPath.add(File(element)) - } - } - return annotationsPath -} - -private fun JetCoreEnvironment.analyze(messageCollector: MessageCollector): BindingContext { - val project = getProject() - val sourceFiles = getSourceFiles() - - val analyzerWithCompilerReport = AnalyzerWithCompilerReport(messageCollector) - analyzerWithCompilerReport.analyzeAndReport(sourceFiles) { - val support = CliLightClassGenerationSupport.getInstanceForCli(project)!! - val sharedTrace = support.getTrace() - val sharedModule = support.getModule() - val compilerConfiguration = getConfiguration()!! - AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, sourceFiles, sharedTrace, - Predicates.alwaysTrue<PsiFile>(), - sharedModule, - compilerConfiguration.get(JVMConfigurationKeys.MODULE_IDS), - compilerConfiguration.get(JVMConfigurationKeys.INCREMENTAL_CACHE_BASE_DIR)) - } - - val exhaust = analyzerWithCompilerReport.getAnalyzeExhaust() - assert(exhaust != null) { "AnalyzeExhaust should be non-null, compiling: " + sourceFiles } - - return exhaust!!.getBindingContext() -} - -fun AnalyzerWithCompilerReport.analyzeAndReport(files: List<JetFile>, analyser: () -> AnalyzeExhaust) = analyzeAndReport(analyser, files) - -fun BindingContext.getPackageFragment(file: JetFile) = get(BindingContext.FILE_TO_PACKAGE_FRAGMENT, file) - -fun DeclarationDescriptor.isUserCode() = - when (this) { - is PackageFragmentDescriptor -> false - is PropertyAccessorDescriptor -> !isDefault() - is CallableMemberDescriptor -> getKind() == CallableMemberDescriptor.Kind.DECLARATION - else -> true - } |