Search in sources :

Example 6 with FlexmojosSdkType

use of com.intellij.lang.javascript.flex.sdk.FlexmojosSdkType in project intellij-plugins by JetBrains.

the class FlashRunnerParameters method checkAdlAndAirRuntime.

public static void checkAdlAndAirRuntime(@NotNull final Sdk sdk) throws RuntimeConfigurationError {
    final String adlPath = FlexSdkUtils.getAdlPath(sdk);
    if (StringUtil.isEmpty(adlPath)) {
        throw new RuntimeConfigurationError(FlexBundle.message("adl.not.set.check.sdk.settings", sdk.getName()));
    }
    final VirtualFile adlFile = LocalFileSystem.getInstance().findFileByPath(adlPath);
    if (adlFile == null || adlFile.isDirectory()) {
        throw new RuntimeConfigurationError(sdk.getSdkType() instanceof FlexmojosSdkType ? FlexBundle.message("adl.not.found.check.sdk.settings", adlPath, sdk.getName()) : FlexBundle.message("adl.not.found.check.sdk.installation", adlPath, sdk.getName()));
    }
    if (sdk.getSdkType() instanceof FlexmojosSdkType) {
        final String airRuntimePath = FlexSdkUtils.getAirRuntimePathForFlexmojosSdk(sdk);
        if (StringUtil.isEmpty(airRuntimePath)) {
            throw new RuntimeConfigurationError(FlexBundle.message("air.runtime.not.set.check.sdk.settings", sdk.getName()));
        }
        final VirtualFile airRuntimeDir = LocalFileSystem.getInstance().findFileByPath(airRuntimePath);
        if (airRuntimeDir == null) {
            throw new RuntimeConfigurationError(FlexBundle.message("air.runtime.not.found.check.sdk.settings", airRuntimePath, sdk.getName()));
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FlexmojosSdkType(com.intellij.lang.javascript.flex.sdk.FlexmojosSdkType) RuntimeConfigurationError(com.intellij.execution.configurations.RuntimeConfigurationError)

Aggregations

FlexmojosSdkType (com.intellij.lang.javascript.flex.sdk.FlexmojosSdkType)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 Sdk (com.intellij.openapi.projectRoots.Sdk)3 CantRunException (com.intellij.execution.CantRunException)1 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)1 FlexmojosSdkAdditionalData (com.intellij.lang.javascript.flex.sdk.FlexmojosSdkAdditionalData)1 SdkType (com.intellij.openapi.projectRoots.SdkType)1 LibraryOrderEntry (com.intellij.openapi.roots.LibraryOrderEntry)1 ModuleRootManager (com.intellij.openapi.roots.ModuleRootManager)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Pattern (java.util.regex.Pattern)1 MavenId (org.jetbrains.idea.maven.model.MavenId)1