Search in sources :

Example 1 with JpsFlexDependencyEntry

use of com.intellij.flex.model.bc.JpsFlexDependencyEntry in project intellij-plugins by JetBrains.

the class JpsFlexDependenciesImpl method loadState.

void loadState(@NotNull State state) {
    if (state.SDK != null && !StringUtil.isEmpty(state.SDK.mySdkName)) {
        //if (JpsFlexSdkType.ID.equals(state.SDK.mySdkType)) {
        //  myContainer.setChild(FLEX_SDK_REF_ROLE,
        //                       JpsElementFactory.getInstance().createSdkReference(state.SDK.mySdkName, JpsFlexSdkType.INSTANCE));
        //}
        //else if (JpsFlexmojosSdkType.ID.equals(state.SDK.mySdkType)) {
        //  myContainer.setChild(FLEXMOJOS_SDK_REF_ROLE,
        //                       JpsElementFactory.getInstance().createSdkReference(state.SDK.mySdkName, JpsFlexmojosSdkType.INSTANCE));
        //}
        //else {
        myContainer.setChild(FLEX_SDK_REF_ROLE, JpsElementFactory.getInstance().createSdkReference(state.SDK.mySdkName, JpsFlexSdkType.INSTANCE));
        myContainer.setChild(FLEXMOJOS_SDK_REF_ROLE, JpsElementFactory.getInstance().createSdkReference(state.SDK.mySdkName, JpsFlexmojosSdkType.INSTANCE));
    //}
    }
    myTargetPlayer = state.TARGET_PLAYER;
    myComponentSet = state.COMPONENT_SET;
    myFrameworkLinkage = LinkageType.valueOf(state.FRAMEWORK_LINKAGE, DEFAULT_FRAMEWORK_LINKAGE);
    final JpsElementCollection<JpsFlexDependencyEntry> entries = myContainer.getChild(ENTRIES_ROLE);
    assert entries.getElements().size() == 0;
    for (State.EntryState entryState : state.ENTRIES) {
        final LinkageType linkageType = LinkageType.valueOf(entryState.DEPENDENCY_TYPE.LINKAGE_TYPE, DEFAULT_FRAMEWORK_LINKAGE);
        if (entryState.LIBRARY_ID != null) {
            entries.addChild(new JpsModuleLibraryDependencyEntryImpl(entryState.LIBRARY_ID, linkageType));
        } else if (entryState.LIBRARY_NAME != null) {
            entries.addChild(new JpsSharedLibraryDependencyEntryImpl(entryState.LIBRARY_NAME, entryState.LIBRARY_LEVEL, linkageType));
        } else if (entryState.BC_NAME != null) {
            entries.addChild(new JpsFlexBCDependencyEntryImpl(entryState.MODULE_NAME, entryState.BC_NAME, linkageType));
        } else {
            assert false : "unknown entry " + entryState;
        }
    }
}
Also used : JpsFlexDependencyEntry(com.intellij.flex.model.bc.JpsFlexDependencyEntry) LinkageType(com.intellij.flex.model.bc.LinkageType)

Example 2 with JpsFlexDependencyEntry

use of com.intellij.flex.model.bc.JpsFlexDependencyEntry in project intellij-plugins by JetBrains.

the class JpsFlexUnitRunnerParameters method getBC.

@Nullable
public JpsFlexBuildConfiguration getBC(final JpsProject project) {
    final JpsFlexBuildConfiguration bc = super.getBC(project);
    if (bc == null)
        return null;
    final JpsFlexBuildConfiguration overriddenBC = bc.getModule().getProperties().createTemporaryCopyForCompilation(bc);
    overriddenBC.setOutputType(OutputType.Application);
    overriddenBC.setMainClass(FlexCommonUtils.FLEX_UNIT_LAUNCHER);
    overriddenBC.setOutputFileName("_flexunit.swf");
    final String testOutputUrl = StringUtil.notNullize(JpsJavaExtensionService.getInstance().getOutputUrl(bc.getModule(), true));
    overriddenBC.setOutputFolder(JpsPathUtil.urlToPath(testOutputUrl));
    overriddenBC.setUseHtmlWrapper(false);
    overriddenBC.setRLMs(Collections.emptyList());
    overriddenBC.setCssFilesToCompile(Collections.emptyList());
    overriddenBC.setSkipCompile(false);
    overriddenBC.getDependencies().setFrameworkLinkage(LinkageType.Merged);
    for (JpsFlexDependencyEntry entry : overriddenBC.getDependencies().getEntries()) {
        if (entry.getLinkageType() == LinkageType.External) {
            entry.setLinkageType(LinkageType.Merged);
        }
    }
    return overriddenBC;
}
Also used : JpsFlexDependencyEntry(com.intellij.flex.model.bc.JpsFlexDependencyEntry) JpsFlexBuildConfiguration(com.intellij.flex.model.bc.JpsFlexBuildConfiguration) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

JpsFlexDependencyEntry (com.intellij.flex.model.bc.JpsFlexDependencyEntry)2 JpsFlexBuildConfiguration (com.intellij.flex.model.bc.JpsFlexBuildConfiguration)1 LinkageType (com.intellij.flex.model.bc.LinkageType)1 Nullable (org.jetbrains.annotations.Nullable)1