use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexExtractSuperTest method testInheritanceFromSdk.
@JSTestOptions(JSTestOption.WithGumboSdk)
public void testInheritanceFromSdk() throws Exception {
final Sdk sdk = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.6"), null, false);
doTest(new PerformAction() {
@Override
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
FlexTestUtils.modifyConfigs(myProject, editor -> {
ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
bc1.setName("1");
FlexTestUtils.setSdk(bc1, sdk);
});
FlexExtractSuperTest.this.performAction(false, "skins.MyNewSkin1", "skins.IMySkin", DocCommentPolicy.COPY, JSExtractSuperProcessor.Mode.ExtractSuperTurnRefs, new String[] { "updateDisplayList" }, ArrayUtil.EMPTY_STRING_ARRAY);
}
});
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashUmlTest method initSdk.
private void initSdk() {
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);
});
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashBuilderModuleImporter method setupBuildConfigs.
private void setupBuildConfigs(final ModuleRootModel rootModel, final FlashBuilderProject fbProject) {
final Sdk sdk = fbProject.isSdkUsed() ? mySdkFinder.findSdk(fbProject) : null;
final ModifiableFlexBuildConfiguration[] configurations = myFlexConfigEditor.getConfigurations(rootModel.getModule());
assert configurations.length == 1;
final ModifiableFlexBuildConfiguration mainBC = configurations[0];
final String bcName = suggestMainBCName(fbProject);
mainBC.setName(bcName);
final TargetPlatform targetPlatform = fbProject.getTargetPlatform();
mainBC.setTargetPlatform(targetPlatform);
mainBC.setPureAs(fbProject.isPureActionScript());
mainBC.setOutputType(fbProject.getOutputType());
final Map<String, String> compilerOptions = new THashMap<>();
if (fbProject.getOutputType() == OutputType.Application) {
mainBC.setMainClass(fbProject.getMainAppClassName());
final String shortClassName = StringUtil.getShortName(fbProject.getMainAppClassName());
mainBC.setOutputFileName(shortClassName + ".swf");
if (!mainBC.isPureAs() && fbProject.getThemeDirPathRaw() != null && sdk != null) {
setupTheme(fbProject.getThemeDirPathRaw(), mainBC.getNature(), sdk, mainBC.getDependencies().getComponentSet(), compilerOptions);
}
switch(targetPlatform) {
case Web:
if (fbProject.isUseHtmlWrapper()) {
mainBC.setUseHtmlWrapper(true);
mainBC.setWrapperTemplatePath(fbProject.getProjectRootPath() + "/" + CreateHtmlWrapperTemplateDialog.HTML_TEMPLATE_FOLDER_NAME);
}
break;
case Desktop:
setupAirDescriptor(mainBC, rootModel);
mainBC.getAirDesktopPackagingOptions().setPackageFileName(shortClassName);
if (!StringUtil.isEmpty(fbProject.getDesktopCertPath())) {
mainBC.getAirDesktopPackagingOptions().getSigningOptions().setUseTempCertificate(false);
mainBC.getAirDesktopPackagingOptions().getSigningOptions().setKeystorePath(fbProject.getDesktopCertPath());
}
FilesToPackageUtil.setupFilesToPackage(mainBC.getAirDesktopPackagingOptions(), fbProject.getPathsExcludedFromDesktopPackaging(), rootModel);
break;
case Mobile:
setupAirDescriptor(mainBC, rootModel);
mainBC.getAndroidPackagingOptions().setEnabled(fbProject.isAndroidSupported());
mainBC.getAndroidPackagingOptions().setPackageFileName(shortClassName);
if (!StringUtil.isEmpty(fbProject.getAndroidCertPath())) {
mainBC.getAndroidPackagingOptions().getSigningOptions().setUseTempCertificate(false);
mainBC.getAndroidPackagingOptions().getSigningOptions().setKeystorePath(fbProject.getAndroidCertPath());
}
FilesToPackageUtil.setupFilesToPackage(mainBC.getAndroidPackagingOptions(), fbProject.getPathsExcludedFromAndroidPackaging(), rootModel);
mainBC.getIosPackagingOptions().setEnabled(fbProject.isIosSupported());
mainBC.getIosPackagingOptions().setPackageFileName(shortClassName);
mainBC.getIosPackagingOptions().getSigningOptions().setProvisioningProfilePath(StringUtil.notNullize(fbProject.getIOSProvisioningPath()));
mainBC.getIosPackagingOptions().getSigningOptions().setKeystorePath(StringUtil.notNullize(fbProject.getIOSCertPath()));
FilesToPackageUtil.setupFilesToPackage(mainBC.getIosPackagingOptions(), fbProject.getPathsExcludedFromIOSPackaging(), rootModel);
break;
}
} else {
mainBC.setOutputFileName(fbProject.getName() + ".swc");
}
mainBC.setOutputFolder(getAbsolutePathWithLinksHandled(fbProject, fbProject.getOutputFolderPath()));
setupRLMsAndCSSFilesToCompile(mainBC, fbProject);
if (sdk != null) {
mainBC.getDependencies().setSdkEntry(Factory.createSdkEntry(sdk.getName()));
final String sdkHome = sdk.getHomePath();
if (targetPlatform == TargetPlatform.Web && sdkHome != null) {
mainBC.getDependencies().setTargetPlayer(FlexSdkUtils.getTargetPlayer(fbProject.getTargetPlayerVersion(), sdkHome));
}
}
// todo dependencies.setFrameworkLinkage();
setupDependencies(mainBC, fbProject);
final String fbOptions = fbProject.getAdditionalCompilerOptions();
setupLocales(fbOptions, compilerOptions);
setupNamespacesAndManifests(rootModel, fbProject, compilerOptions);
setupFilesToIncludeInSwc(rootModel, mainBC, fbProject.getFilesIncludedInSwc());
mainBC.getCompilerOptions().setAllOptions(compilerOptions);
// todo parse options, replace "-a b" to "-a=b", move some to dedicated fields
final String ideaOptions = FlexCommonUtils.removeOptions(fbOptions, "locale", "compiler.locale", "source-path", "compiler.source-path");
mainBC.getCompilerOptions().setAdditionalOptions(ideaOptions);
if (mainBC.getOutputType() == OutputType.Application) {
FlexModuleBuilder.createRunConfiguration(rootModel.getModule(), mainBC);
}
setupOtherAppsAndModules(rootModel, mainBC, fbProject);
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlashBuilderModuleImporter method setupModules.
private void setupModules(final ModuleRootModel rootModel, final Collection<ModifiableFlexBuildConfiguration> apps, final FlashBuilderProject fbProject) {
for (final FlashBuilderProject.FBRLMInfo rlm : fbProject.getModules()) {
ModifiableFlexBuildConfiguration hostApp = apps.iterator().next();
if (rlm.OPTIMIZE) {
final String hostAppMainClass = getMainClassFqn(fbProject, rlm.OPTIMIZE_FOR, rootModel.getSourceRootUrls());
for (ModifiableFlexBuildConfiguration appBC : apps) {
if (hostAppMainClass.equals(appBC.getMainClass())) {
hostApp = appBC;
break;
}
}
}
final Collection<FlexBuildConfiguration.RLMInfo> rlms = new ArrayList<>(hostApp.getRLMs());
final String rlmMainClass = getMainClassFqn(fbProject, rlm.MAIN_CLASS_PATH, rootModel.getSourceRootUrls());
rlms.add(new FlexBuildConfiguration.RLMInfo(rlmMainClass, rlm.OUTPUT_PATH, rlm.OPTIMIZE));
hostApp.setRLMs(rlms);
}
}
use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration in project intellij-plugins by JetBrains.
the class FlexProjectConfigTest method testModuleLibrary2.
public void testModuleLibrary2() throws ConfigurationException {
assertEquals(1, FlexBuildConfigurationManager.getInstance(myModule).getBuildConfigurations().length);
final String libraryId = createModuleLibrary();
FlexTestUtils.modifyConfigs(myProject, configEditor -> {
ModifiableFlexBuildConfiguration[] configurations = configEditor.getConfigurations(myModule);
assertEquals(1, configurations.length);
ModifiableFlexBuildConfiguration c = configurations[0];
final ModifiableModuleLibraryEntry e = configEditor.createModuleLibraryEntry(c.getDependencies(), libraryId);
c.getDependencies().getModifiableEntries().add(e);
});
OrderEntry libraryEntry = findLibraryEntry(myModule, libraryId);
assertNotNull(libraryEntry);
}
Aggregations