use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testCorrectScopeForSuperclassCheck2.
public void testCorrectScopeForSuperclassCheck2() throws Exception {
//
final Sdk sdk46 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.6"), null, false);
FlexTestUtils.modifyConfigs(myProject, e -> {
ModifiableFlexBuildConfiguration bc1 = e.getConfigurations(myModule)[0];
bc1.setName("web");
bc1.setTargetPlatform(TargetPlatform.Web);
FlexTestUtils.setSdk(bc1, sdk46);
ModifiableFlexBuildConfiguration bc2 = e.createConfiguration(myModule);
bc2.setName("air");
bc1.setTargetPlatform(TargetPlatform.Desktop);
FlexTestUtils.setSdk(bc2, sdk46);
});
FlexBuildConfigurationManager m = FlexBuildConfigurationManager.getInstance(myModule);
m.setActiveBuildConfiguration(m.findConfigurationByName("air"));
defaultTest();
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexModuleBuilder method setupRootModel.
public void setupRootModel(final ModifiableRootModel modifiableRootModel) throws ConfigurationException {
final ContentEntry contentEntry = doAddContentEntry(modifiableRootModel);
if (contentEntry == null)
return;
final VirtualFile sourceRoot = createSourceRoot(contentEntry);
final Module module = modifiableRootModel.getModule();
final FlexProjectConfigurationEditor currentFlexEditor = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getConfigEditor();
final boolean needToCommitFlexEditor = currentFlexEditor == null;
final FlexProjectConfigurationEditor flexConfigEditor;
flexConfigEditor = currentFlexEditor != null ? currentFlexEditor : FlexProjectConfigurationEditor.createEditor(module.getProject(), Collections.singletonMap(module, modifiableRootModel), null, null);
final ModifiableFlexBuildConfiguration[] configurations = flexConfigEditor.getConfigurations(module);
assert configurations.length == 1;
final ModifiableFlexBuildConfiguration bc = configurations[0];
setupBC(modifiableRootModel, bc);
if (bc.getOutputType() == OutputType.Application) {
createRunConfiguration(module, bc);
}
if (sourceRoot != null && myCreateSampleApp && myFlexSdk != null) {
try {
final boolean flex4 = !FlexSdkUtils.isAirSdkWithoutFlex(myFlexSdk) && StringUtil.compareVersionNumbers(myFlexSdk.getVersionString(), "4") >= 0;
FlexUtils.createSampleApp(module.getProject(), sourceRoot, mySampleAppName, myTargetPlatform, flex4);
} catch (IOException ex) {
throw new ConfigurationException(ex.getMessage());
}
}
if (myCreateHtmlWrapperTemplate && myFlexSdk != null) {
final String path = VfsUtilCore.urlToPath(contentEntry.getUrl()) + "/" + CreateHtmlWrapperTemplateDialog.HTML_TEMPLATE_FOLDER_NAME;
if (CreateHtmlWrapperTemplateDialog.createHtmlWrapperTemplate(module.getProject(), myFlexSdk, path, myEnableHistory, myCheckPlayerVersion, myExpressInstall)) {
bc.setUseHtmlWrapper(true);
bc.setWrapperTemplatePath(path);
}
}
if (needToCommitFlexEditor) {
flexConfigEditor.commit();
}
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexCompletionTest method testVectorObject.
public void testVectorObject() throws Exception {
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk45);
});
final LookupElement[] elements = doTest("", "as");
assertStartsWith(elements, "concat", "every", "filter");
assertTrue(getBoldStatus(elements[0]));
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testFieldResolveMixedRoots.
public void testFieldResolveMixedRoots() throws Exception {
// same as testSuperclassResolveMixedRoots()
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();
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class ActionScriptHighlightingTest method testCorrectScopeForSuperclassCheck4.
public void testCorrectScopeForSuperclassCheck4() throws Exception {
// two dependent modules, different SDKs
final Module module2 = doCreateRealModuleIn("module2", myProject, FlexModuleType.getInstance());
final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, false);
final Sdk sdk46 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.6"), null, false);
FlexTestUtils.modifyConfigs(myProject, e -> {
ModifiableFlexBuildConfiguration bc1 = e.getConfigurations(myModule)[0];
FlexTestUtils.setSdk(bc1, sdk46);
ModifiableFlexBuildConfiguration bc2 = e.getConfigurations(module2)[0];
bc2.setOutputType(OutputType.Library);
FlexTestUtils.setSdk(bc2, sdk45);
bc1.getDependencies().getModifiableEntries().add(e.createBcEntry(bc1.getDependencies(), bc2, null));
});
myAfterCommitRunnable = () -> copyFileToModule(module2, getTestDataPath() + BASE_PATH + getTestName(false) + "_2.js2");
doTestFor(true, getTestName(false) + ".js2");
}
Aggregations