use of com.intellij.lang.javascript.flex.projectStructure.model.BuildConfigurationEntry in project intellij-plugins by JetBrains.
the class FlashPlayerTrustUtil method updateTrustedStatus.
public static void updateTrustedStatus(final Module module, final FlexBuildConfiguration bc, final boolean isDebug, final boolean isTrusted) {
final Collection<String> paths = new ArrayList<>();
try {
paths.add(new File(PathUtil.getParentPath(bc.getActualOutputFilePath())).getCanonicalPath());
} catch (IOException e) {
/**/
}
for (DependencyEntry entry : bc.getDependencies().getEntries()) {
if (entry instanceof BuildConfigurationEntry && entry.getDependencyType().getLinkageType() == LinkageType.LoadInRuntime) {
final FlexBuildConfiguration dependencyBC = ((BuildConfigurationEntry) entry).findBuildConfiguration();
if (dependencyBC != null) {
try {
paths.add(new File(PathUtil.getParentPath(dependencyBC.getActualOutputFilePath())).getCanonicalPath());
} catch (IOException e) {
/**/
}
}
}
}
updateTrustedStatus(module.getProject(), isTrusted, isDebug, paths.toArray(new String[paths.size()]));
}
use of com.intellij.lang.javascript.flex.projectStructure.model.BuildConfigurationEntry in project intellij-plugins by JetBrains.
the class FlexmojosImporter method process.
public void process(final IdeModifiableModelsProvider modelsProvider, final Module module, final MavenRootModelAdapter modelAdapter, final MavenProjectsTree mavenTree, final MavenProject mavenProject, final MavenProjectChanges changes, final Map<MavenProject, String> mavenProjectToModuleName, final List<MavenProjectsProcessorTask> postTasks) {
expireNotification();
final FlexProjectConfigurationEditor currentEditor = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getConfigEditor();
final boolean needToCommit = currentEditor == null;
final LibraryTable.ModifiableModel projectLibrariesModel = modelsProvider.getModifiableProjectLibrariesModel();
final Map<Module, ModifiableRootModel> moduleToModifiableModel = Collections.singletonMap(module, modelAdapter.getRootModel());
final FlexProjectConfigurationEditor flexEditor = currentEditor != null ? currentEditor : new FlexProjectConfigurationEditor(module.getProject(), FlexProjectConfigurationEditor.createModelProvider(moduleToModifiableModel, projectLibrariesModel, null)) {
@Nullable
protected Module findModuleWithBC(final BuildConfigurationEntry bcEntry) {
// don't check BC presence here because corresponding BC may appear later in next import cycle
return modelAdapter.findModuleByName(bcEntry.getModuleName());
}
};
final MavenPlugin flexmojosPlugin = getFlexmojosPlugin(mavenProject);
final Flexmojos3Configurator configurator = StringUtil.compareVersionNumbers(flexmojosPlugin.getVersion(), "5") >= 0 ? new Flexmojos5Configurator(module, modelsProvider, flexEditor, mavenTree, mavenProjectToModuleName, mavenProject, flexmojosPlugin, getCompiledLocales(mavenProject), getRuntimeLocales(mavenProject), this) : StringUtil.compareVersionNumbers(flexmojosPlugin.getVersion(), "4") >= 0 ? new Flexmojos4Configurator(module, modelsProvider, flexEditor, mavenTree, mavenProjectToModuleName, mavenProject, flexmojosPlugin, getCompiledLocales(mavenProject), getRuntimeLocales(mavenProject), this) : new Flexmojos3Configurator(module, modelsProvider, flexEditor, mavenTree, mavenProjectToModuleName, mavenProject, flexmojosPlugin, getCompiledLocales(mavenProject), getRuntimeLocales(mavenProject), this);
configurator.configureAndAppendTasks(postTasks);
if (needToCommit) {
try {
flexEditor.commit();
} catch (ConfigurationException e) {
// can't happen
MavenLog.LOG.error(e);
}
}
}
use of com.intellij.lang.javascript.flex.projectStructure.model.BuildConfigurationEntry in project intellij-plugins by JetBrains.
the class FlexOrderEnumerationHandler method processModuleWithBuildConfiguration.
// configuration is null for root module (one for which scope is being computed)
private static void processModuleWithBuildConfiguration(@NotNull Module module, @Nullable FlexBuildConfiguration bc, Map<Module, ModuleData> modules2activeConfigurations, Set<FlexBuildConfiguration> processedConfigurations, boolean productionDependency) {
if (ModuleType.get(module) != FlexModuleType.getInstance()) {
return;
}
final boolean isRootModule = bc == null;
if (isRootModule) {
bc = getActiveConfiguration(module);
}
if (bc == null || !processedConfigurations.add(bc)) {
return;
}
ModuleData moduleData = modules2activeConfigurations.get(module);
if (moduleData == null) {
modules2activeConfigurations.put(module, moduleData = new ModuleData());
}
moduleData.addBc(bc, productionDependency);
for (DependencyEntry entry : bc.getDependencies().getEntries()) {
if (!(entry instanceof BuildConfigurationEntry)) {
continue;
}
final LinkageType linkageType = entry.getDependencyType().getLinkageType();
if (linkageType == LinkageType.LoadInRuntime) {
continue;
}
FlexBuildConfiguration dependencyBc = ((BuildConfigurationEntry) entry).findBuildConfiguration();
if (dependencyBc == null || !FlexCommonUtils.checkDependencyType(bc.getOutputType(), dependencyBc.getOutputType(), linkageType)) {
continue;
}
if (!isRootModule && !BCUtils.isTransitiveDependency(linkageType)) {
continue;
}
Module dependencyModule = ((BuildConfigurationEntry) entry).findModule();
if (dependencyModule == null || dependencyModule == module) {
continue;
}
processModuleWithBuildConfiguration(dependencyModule, dependencyBc, modules2activeConfigurations, processedConfigurations, entry.getDependencyType().getLinkageType() != LinkageType.Test);
}
}
Aggregations