Search in sources :

Example 6 with FlexBuildConfiguration

use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.

the class FlashPackagingSourceItemsProvider method createFlashBCOutputSourceItems.

private static Collection<? extends PackagingSourceItem> createFlashBCOutputSourceItems(final Module module) {
    final List<PackagingSourceItem> result = new ArrayList<>();
    int orderNumber = 0;
    final FlexProjectConfigurationEditor configEditor = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getConfigEditor();
    // because Project Structure is open
    assert configEditor != null;
    for (FlexBuildConfiguration bc : configEditor.getConfigurations(module)) {
        final String outputFilePath = bc.getActualOutputFilePath().toLowerCase();
        if (!outputFilePath.endsWith(".swf") && !outputFilePath.endsWith(".swc")) {
            // BC is not configured properly yet
            continue;
        }
        result.add(new FlashBCOutputSourceItem(bc, FlashBCOutputSourceItem.Type.OutputFile, orderNumber++));
        if (bc.getOutputType() == OutputType.Application && bc.getTargetPlatform() == TargetPlatform.Web && bc.isUseHtmlWrapper()) {
            result.add(new FlashBCOutputSourceItem(bc, FlashBCOutputSourceItem.Type.OutputFileAndHtmlWrapper, orderNumber++));
        }
        result.add(new FlashBCOutputSourceItem(bc, FlashBCOutputSourceItem.Type.OutputFolderContents, orderNumber++));
    }
    return result;
}
Also used : PackagingSourceItem(com.intellij.packaging.ui.PackagingSourceItem) FlexProjectConfigurationEditor(com.intellij.lang.javascript.flex.projectStructure.model.impl.FlexProjectConfigurationEditor) ArrayList(java.util.ArrayList) FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)

Example 7 with FlexBuildConfiguration

use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.

the class FlexBCTree method createRenderer.

private static CheckboxTreeCellRenderer createRenderer() {
    return new CheckboxTree.CheckboxTreeCellRenderer() {

        public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            if (!(value instanceof CheckedTreeNode))
                return;
            final CheckedTreeNode node = (CheckedTreeNode) value;
            final Object userObject = node.getUserObject();
            if (userObject instanceof Project) {
                getTextRenderer().append(((Project) userObject).getName());
            } else if (userObject instanceof Module) {
                getTextRenderer().setIcon(ModuleType.get((Module) userObject).getIcon());
                getTextRenderer().append(((Module) userObject).getName());
            } else if (userObject instanceof FlexBuildConfiguration) {
                BCUtils.renderBuildConfiguration((FlexBuildConfiguration) userObject, null, false).appendToComponent(getTextRenderer());
                getTextRenderer().setIcon(((FlexBuildConfiguration) userObject).getIcon());
            }
        }
    };
}
Also used : Project(com.intellij.openapi.project.Project) FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) Module(com.intellij.openapi.module.Module)

Example 8 with FlexBuildConfiguration

use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.

the class ActionScriptProfileRunner method detectSuitableAgentNameForSdkUsedToLaunch.

private static String detectSuitableAgentNameForSdkUsedToLaunch(Module module) {
    FlexBuildConfiguration bc = FlexBuildConfigurationManager.getInstance(module).getActiveConfiguration();
    boolean isPlayer9 = bc.getTargetPlatform() == TargetPlatform.Web && bc.getDependencies().getTargetPlayer().startsWith("9");
    return "profiler_agent" + (isPlayer9 ? "_9" : "_10") + ".swf";
}
Also used : FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)

Example 9 with FlexBuildConfiguration

use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.

the class ValidateFlashConfigurationsPrecompileTask method checkSimilarOutputFiles.

private static boolean checkSimilarOutputFiles(final Collection<Pair<Module, FlexBuildConfiguration>> modulesAndBCsToCompile, final Consumer<Trinity<Module, FlexBuildConfiguration, FlashProjectStructureProblem>> errorConsumer) {
    final Map<String, Pair<Module, FlexBuildConfiguration>> outputPathToModuleAndBC = new THashMap<>();
    for (Pair<Module, FlexBuildConfiguration> moduleAndBC : modulesAndBCsToCompile) {
        final FlexBuildConfiguration bc = moduleAndBC.second;
        final String outputFilePath = bc.getActualOutputFilePath();
        checkOutputPathUnique(outputFilePath, moduleAndBC, outputPathToModuleAndBC, errorConsumer);
    }
    return true;
}
Also used : THashMap(gnu.trove.THashMap) FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration) Module(com.intellij.openapi.module.Module) Pair(com.intellij.openapi.util.Pair)

Example 10 with FlexBuildConfiguration

use of com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration in project intellij-plugins by JetBrains.

the class CompilerConfigGenerator method addLibs.

private void addLibs(final Element rootElement) {
    for (final DependencyEntry entry : myBC.getDependencies().getEntries()) {
        LinkageType linkageType = entry.getDependencyType().getLinkageType();
        if (linkageType == LinkageType.Test) {
            if (myFlexUnit) {
                linkageType = LinkageType.Merged;
            } else {
                continue;
            }
        }
        if (myCSS && linkageType == LinkageType.Include)
            linkageType = LinkageType.Merged;
        if (entry instanceof BuildConfigurationEntry) {
            if (linkageType == LinkageType.LoadInRuntime)
                continue;
            final FlexBuildConfiguration dependencyBC = ((BuildConfigurationEntry) entry).findBuildConfiguration();
            if (dependencyBC != null && FlexCommonUtils.checkDependencyType(myBC.getOutputType(), dependencyBC.getOutputType(), linkageType)) {
                addLib(rootElement, dependencyBC.getActualOutputFilePath(), linkageType);
            }
        } else if (entry instanceof ModuleLibraryEntry) {
            final LibraryOrderEntry orderEntry = FlexProjectRootsUtil.findOrderEntry((ModuleLibraryEntry) entry, ModuleRootManager.getInstance(myModule));
            if (orderEntry != null) {
                addLibraryRoots(rootElement, orderEntry.getRootFiles(OrderRootType.CLASSES), linkageType);
            }
        } else if (entry instanceof SharedLibraryEntry) {
            final Library library = FlexProjectRootsUtil.findOrderEntry(myModule.getProject(), (SharedLibraryEntry) entry);
            if (library != null) {
                addLibraryRoots(rootElement, library.getFiles((OrderRootType.CLASSES)), linkageType);
            }
        }
    }
    if (myFlexUnit) {
        final Collection<String> flexUnitLibNames = FlexCommonUtils.getFlexUnitSupportLibNames(myBC.getNature(), myBC.getDependencies().getComponentSet(), getPathToFlexUnitMainClass(myModule.getProject(), myBC.getNature(), myBC.getMainClass()));
        for (String libName : flexUnitLibNames) {
            final String libPath = FlexCommonUtils.getPathToBundledJar(libName);
            final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(libPath);
            assert file != null;
            addLibraryRoots(rootElement, new VirtualFile[] { file }, LinkageType.Merged);
        }
    }
}
Also used : FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration) Library(com.intellij.openapi.roots.libraries.Library)

Aggregations

FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)52 Module (com.intellij.openapi.module.Module)30 Sdk (com.intellij.openapi.projectRoots.Sdk)9 Pair (com.intellij.openapi.util.Pair)7 ArrayList (java.util.ArrayList)7 BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)6 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)5 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)5 FlexBuildConfigurationManager (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager)5 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)4 Project (com.intellij.openapi.project.Project)4 FlexModuleType (com.intellij.lang.javascript.flex.FlexModuleType)3 FlexUnitRunConfiguration (com.intellij.lang.javascript.flex.flexunit.FlexUnitRunConfiguration)3 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)3 FlashRunConfiguration (com.intellij.lang.javascript.flex.run.FlashRunConfiguration)3 FlashRunnerParameters (com.intellij.lang.javascript.flex.run.FlashRunnerParameters)3 ConfigurationException (com.intellij.openapi.options.ConfigurationException)3 ProjectStructureConfigurable (com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)3 CheckedTreeNode (com.intellij.ui.CheckedTreeNode)3 Place (com.intellij.ui.navigation.Place)3