Search in sources :

Example 1 with JpsFlexBuildConfigurationManager

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

the class FlexBuildTargetType method computeAllTargets.

@NotNull
public List<FlexBuildTarget> computeAllTargets(@NotNull final JpsModel model) {
    final List<FlexBuildTarget> result = new ArrayList<>();
    final JpsProject project = model.getProject();
    for (JpsTypedRunConfiguration<JpsFlashRunnerParameters> runConfig : project.getRunConfigurations(JpsFlashRunConfigurationType.INSTANCE)) {
        ContainerUtilRt.addIfNotNull(result, FlexBuildTarget.create(project, runConfig.getType(), runConfig.getName()));
    }
    for (JpsTypedRunConfiguration<JpsFlexUnitRunnerParameters> runConfig : project.getRunConfigurations(JpsFlexUnitRunConfigurationType.INSTANCE)) {
        ContainerUtilRt.addIfNotNull(result, FlexBuildTarget.create(project, runConfig.getType(), runConfig.getName()));
    }
    for (JpsTypedModule<JpsFlexBuildConfigurationManager> module : project.getModules(JpsFlexModuleType.INSTANCE)) {
        for (JpsFlexBuildConfiguration bc : module.getProperties().getBuildConfigurations()) {
            result.add(FlexBuildTarget.create(bc, null));
            final BuildConfigurationNature nature = bc.getNature();
            if (nature.isApp() && (nature.isDesktopPlatform() || nature.isMobilePlatform())) {
                result.add(FlexBuildTarget.create(bc, Boolean.TRUE));
                result.add(FlexBuildTarget.create(bc, Boolean.FALSE));
            }
        }
    }
    return result;
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature) JpsFlashRunnerParameters(com.intellij.flex.model.run.JpsFlashRunnerParameters) JpsFlexUnitRunnerParameters(com.intellij.flex.model.run.JpsFlexUnitRunnerParameters) JpsProject(org.jetbrains.jps.model.JpsProject) ArrayList(java.util.ArrayList) JpsFlexBuildConfiguration(com.intellij.flex.model.bc.JpsFlexBuildConfiguration) JpsFlexBuildConfigurationManager(com.intellij.flex.model.bc.JpsFlexBuildConfigurationManager) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with JpsFlexBuildConfigurationManager

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

the class JpsFlexModuleType method createModulePropertiesSerializer.

public static JpsModulePropertiesSerializer<JpsFlexBuildConfigurationManager> createModulePropertiesSerializer() {
    return new JpsModulePropertiesSerializer<JpsFlexBuildConfigurationManager>(INSTANCE, ID, "FlexBuildConfigurationManager") {

        @Override
        public JpsFlexBuildConfigurationManager loadProperties(@Nullable final Element componentElement) {
            final JpsFlexBuildConfigurationManagerImpl manager = new JpsFlexBuildConfigurationManagerImpl();
            manager.loadState(XmlSerializer.deserialize(componentElement, JpsFlexBuildConfigurationManagerImpl.State.class));
            return manager;
        }

        @Override
        public void saveProperties(@NotNull final JpsFlexBuildConfigurationManager manager, @NotNull final Element componentElement) {
            final JpsFlexBuildConfigurationManagerImpl.State state = ((JpsFlexBuildConfigurationManagerImpl) manager).getState();
            XmlSerializer.serializeInto(state, componentElement);
        }
    };
}
Also used : Element(org.jdom.Element) JpsFlexBuildConfigurationManagerImpl(com.intellij.flex.model.bc.impl.JpsFlexBuildConfigurationManagerImpl) JpsFlexBuildConfigurationManager(com.intellij.flex.model.bc.JpsFlexBuildConfigurationManager) JpsModulePropertiesSerializer(org.jetbrains.jps.model.serialization.module.JpsModulePropertiesSerializer) NotNull(org.jetbrains.annotations.NotNull) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

JpsFlexBuildConfigurationManager (com.intellij.flex.model.bc.JpsFlexBuildConfigurationManager)2 NotNull (org.jetbrains.annotations.NotNull)2 BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)1 JpsFlexBuildConfiguration (com.intellij.flex.model.bc.JpsFlexBuildConfiguration)1 JpsFlexBuildConfigurationManagerImpl (com.intellij.flex.model.bc.impl.JpsFlexBuildConfigurationManagerImpl)1 JpsFlashRunnerParameters (com.intellij.flex.model.run.JpsFlashRunnerParameters)1 JpsFlexUnitRunnerParameters (com.intellij.flex.model.run.JpsFlexUnitRunnerParameters)1 ArrayList (java.util.ArrayList)1 Element (org.jdom.Element)1 Nullable (org.jetbrains.annotations.Nullable)1 JpsProject (org.jetbrains.jps.model.JpsProject)1 JpsModulePropertiesSerializer (org.jetbrains.jps.model.serialization.module.JpsModulePropertiesSerializer)1