use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexSdkStep method selectSdkUsedByOtherModules.
private static void selectSdkUsedByOtherModules(@Nullable final Project project, final FlexSdkComboBoxWithBrowseButton combo) {
if (project == null) {
return;
}
final FlexProjectConfigurationEditor currentEditor = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getConfigEditor();
if (currentEditor != null) {
final Module[] modules = ModuleStructureConfigurable.getInstance(project).getModules();
for (Module module : modules) {
if (ModuleType.get(module) != FlexModuleType.getInstance()) {
continue;
}
for (ModifiableFlexBuildConfiguration c : currentEditor.getConfigurations(module)) {
SdkEntry sdkEntry = c.getDependencies().getSdkEntry();
Sdk sdk;
if (sdkEntry != null && (sdk = FlexSdkUtils.findFlexOrFlexmojosSdk(sdkEntry.getName())) != null && sdk.getSdkType() == FlexSdkType2.getInstance()) {
combo.setSelectedSdkRaw(sdk.getName());
return;
}
}
}
} else {
for (final Module module : ModuleManager.getInstance(project).getModules()) {
if (ModuleType.get(module) == FlexModuleType.getInstance()) {
for (FlexBuildConfiguration bc : FlexBuildConfigurationManager.getInstance(module).getBuildConfigurations()) {
Sdk sdk = bc.getSdk();
if (sdk != null) {
combo.setSelectedSdkRaw(sdk.getName());
return;
}
}
}
}
}
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashBuilderModuleImporter method setupOtherAppsAndModules.
private void setupOtherAppsAndModules(final ModuleRootModel rootModel, final ModifiableFlexBuildConfiguration mainBC, final FlashBuilderProject fbProject) {
final Collection<ModifiableFlexBuildConfiguration> allApps = new ArrayList<>();
allApps.add(mainBC);
for (String mainClass : fbProject.getApplicationClassNames()) {
final ModifiableFlexBuildConfiguration bc = myFlexConfigEditor.copyConfiguration(mainBC, mainBC.getNature());
final String shortClassName = StringUtil.getShortName(mainClass);
bc.setName(shortClassName);
bc.setMainClass(mainClass);
bc.setOutputFileName(shortClassName + ".swf");
if (bc.getTargetPlatform() == TargetPlatform.Desktop) {
setupAirDescriptor(bc, rootModel);
bc.getAirDesktopPackagingOptions().setPackageFileName(shortClassName);
}
if (bc.getTargetPlatform() == TargetPlatform.Mobile) {
setupAirDescriptor(bc, rootModel);
bc.getAndroidPackagingOptions().setPackageFileName(shortClassName);
bc.getIosPackagingOptions().setPackageFileName(shortClassName);
}
FlexModuleBuilder.createRunConfiguration(rootModel.getModule(), bc);
allApps.add(bc);
}
if (BCUtils.canHaveRLMsAndRuntimeStylesheets(mainBC)) {
setupModules(rootModel, allApps, fbProject);
}
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexHighlightingTest method testBadResolveOfSuperClass.
public void testBadResolveOfSuperClass() throws Exception {
final Sdk sdk = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
WriteAction.run(() -> FlexTestUtils.modifyConfigs(myProject, editor -> {
final ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk);
final ModifiableFlexBuildConfiguration bc2 = editor.createConfiguration(myModule);
bc2.setNature(new BuildConfigurationNature(TargetPlatform.Desktop, false, OutputType.Application));
bc2.setName("2");
FlexTestUtils.setSdk(bc2, sdk);
}));
doTestFor(true, getTestName(false) + ".mxml");
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testCorrectScopeForSuperclassCheck5.
public void testCorrectScopeForSuperclassCheck5() throws Exception {
// same fqn in SDK and library:
// Module depends on an swc that has SDK classes compiled in.
// Library classes (swc compiled with SDK 4.6) have newer timestamp than classes of SDK that module depends on (SDK 4.5)
// SDK should have no sources attached (otherwise getNavigationElement() for both classes will bring us to the same file)
// see testData\js2_highlighting\CorrectScopeForSuperclassCheck5_src.zip
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, false);
FlexTestUtils.addFlexLibrary(false, myModule, "foobar", true, getTestDataPath(), BASE_PATH + getTestName(false) + ".swc", null, null, LinkageType.Merged);
FlexTestUtils.modifyConfigs(myProject, e -> {
ModifiableFlexBuildConfiguration bc1 = e.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk45);
});
doTestFor(true, getTestName(false) + ".js2");
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testSuperclassResolveMixedRoots.
public void testSuperclassResolveMixedRoots() throws Exception {
// we need two SDKs so that flash.net.FileReference from SDK 4.6/playerglobal.swc
// has more recent timestamp than its brother from SDK 4.5/airglobal.swc
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
final Sdk sdk46 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.6"), null, false);
FlexTestUtils.modifyConfigs(myProject, e -> {
ModifiableFlexBuildConfiguration bc1 = e.getConfigurations(myModule)[0];
bc1.setTargetPlatform(TargetPlatform.Desktop);
FlexTestUtils.setSdk(bc1, sdk45);
ModifiableFlexBuildConfiguration bc2 = e.createConfiguration(myModule);
bc2.setName("2");
bc1.setTargetPlatform(TargetPlatform.Mobile);
FlexTestUtils.setSdk(bc2, sdk46);
});
defaultTest();
}
Aggregations