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;
}
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());
}
}
};
}
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";
}
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;
}
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);
}
}
}
Aggregations