@@ -0,0 +1,1131 @@
+package org.jetbrains.kotlin.core.utils;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0A%0Aimport org.eclipse.core.resources.IFile;%0Aimport org.jetbrains.jet.lang.resolve.java.PackageClassUtils;%0Aimport org.jetbrains.jet.lang.resolve.name.FqName;%0Aimport org.jetbrains.jet.plugin.JetMainDetector;%0A%0Apublic class ProjectUtils %7B%0A    %0A    public static IFile getMainClass(Collection%3CIFile%3E files) %7B%0A        KotlinEnvironment kotlinEnvironment = new KotlinEnvironment();%0A        %0A        for (IFile file : files) %7B%0A            if (JetMainDetector.hasMain(kotlinEnvironment.getJetFile(file).getDeclarations())) %7B%0A                return file;%0A            %7D%0A        %7D%0A                %0A        return null;%0A    %7D%0A    %0A    public static boolean hasMain(IFile file) %7B%0A        return getMainClass(Arrays.asList(file)) != null;%0A    %7D%0A    %0A    public static String getPackageByFile(IFile file) %7B%0A        return new KotlinEnvironment().getJetFile(file).getPackageName();%0A    %7D%0A    %0A    public static FqName createPackageClassName(IFile file) %7B%0A        return PackageClassUtils.getPackageClassFqName(new FqName(getPackageByFile(file)));%0A    %7D%0A%7D

Add utility class to work with packages