Search in sources :

Example 1 with FlexmojosSdkAdditionalData

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

the class Flexmojos3ImporterTest method checkFlexmojosSdkClasspath.

private static void checkFlexmojosSdkClasspath(final String sdkVersion, final String[] expectedPaths) {
    final Sdk sdk = ProjectJdkTable.getInstance().findJdk("Flexmojos SDK " + sdkVersion);
    assertNotNull(sdk);
    assertInstanceOf(sdk.getSdkType(), FlexmojosSdkType.class);
    final SdkAdditionalData additionalData = sdk.getSdkAdditionalData();
    assertInstanceOf(additionalData, FlexmojosSdkAdditionalData.class);
    final Collection<String> classpath = ((FlexmojosSdkAdditionalData) additionalData).getFlexCompilerClasspath();
    assertSameElements(classpath, expectedPaths);
}
Also used : FlexmojosSdkAdditionalData(com.intellij.lang.javascript.flex.sdk.FlexmojosSdkAdditionalData) Sdk(com.intellij.openapi.projectRoots.Sdk) FlexmojosSdkAdditionalData(com.intellij.lang.javascript.flex.sdk.FlexmojosSdkAdditionalData) SdkAdditionalData(com.intellij.openapi.projectRoots.SdkAdditionalData)

Example 2 with FlexmojosSdkAdditionalData

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

the class Flexmojos3Configurator method ensureSdkHasRequiredAdditionalJarPaths.

private void ensureSdkHasRequiredAdditionalJarPaths(@NotNull final Sdk sdk) {
    assert sdk.getSdkType() instanceof FlexmojosSdkType;
    final FlexmojosSdkAdditionalData additionalData = ((FlexmojosSdkAdditionalData) sdk.getSdkAdditionalData());
    assert additionalData != null;
    for (MavenId dependency : myFlexmojosPlugin.getDependencies()) {
        if (StringUtil.isEmpty(dependency.getArtifactId()))
            continue;
        for (Pattern jarNamePattern : ADDITIONAL_JAR_NAME_PATTERNS_TO_INCLUDE_IN_FLEXMOJOS_SDK_CLASSPATH) {
            if (jarNamePattern.matcher(dependency.getArtifactId()).matches()) {
                final String jarFilePath = getArtifactFilePath(myMavenProject, dependency, MavenConstants.TYPE_JAR);
                additionalData.addFlexCompilerClasspathEntryIfNotPresentAndRemoveDifferentVersionOfThisJar(jarNamePattern, jarFilePath);
                break;
            }
        }
    }
}
Also used : Pattern(java.util.regex.Pattern) MavenId(org.jetbrains.idea.maven.model.MavenId) FlexmojosSdkAdditionalData(com.intellij.lang.javascript.flex.sdk.FlexmojosSdkAdditionalData) FlexmojosSdkType(com.intellij.lang.javascript.flex.sdk.FlexmojosSdkType)

Aggregations

FlexmojosSdkAdditionalData (com.intellij.lang.javascript.flex.sdk.FlexmojosSdkAdditionalData)2 FlexmojosSdkType (com.intellij.lang.javascript.flex.sdk.FlexmojosSdkType)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 SdkAdditionalData (com.intellij.openapi.projectRoots.SdkAdditionalData)1 Pattern (java.util.regex.Pattern)1 MavenId (org.jetbrains.idea.maven.model.MavenId)1