use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class Flexmojos3ImporterTest method testConfiguringCompiledLocalesAsSourceFolders.
public void testConfiguringCompiledLocalesAsSourceFolders() throws Exception {
createProjectSubDirs("src/main/locales/en_US", "src/main/locales/ru_RU", "src/main/locales/fr_FR");
importProject(mavenProjectDescription("project", "swc") + "<build>" + " <plugins>" + " <plugin>" + flexmojosPlugin() + " <configuration>" + " <compiledLocales>" + " <locale>en_US</locale>" + " <locale>ru_RU</locale>" + " </compiledLocales>" + " </configuration>" + " </plugin>" + " </plugins>" + "</build>" + flexFrameworkDependency("3.2.0.3958"));
assertSources("project", "src/main/locales/en_US", "src/main/locales/ru_RU");
checkBCCount("project", 1);
checkBC("project", "project", new BuildConfigurationNature(Web, false, Library), "", "project-1.0.swc", "target", "3.2.0.3958", "en_US\nru_RU", "target/project-1.0-config-report.xml");
}
use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class Flexmojos3ImporterTest method testConfiguringCompiledLocalesFromCustomDirAsSourceFolders.
public void testConfiguringCompiledLocalesFromCustomDirAsSourceFolders() throws Exception {
createProjectSubDirs("locales/en_US");
importProject(mavenProjectDescription("project", "swc") + "<build>" + " <plugins>" + " <plugin>" + flexmojosPlugin() + " <configuration>" + " <resourceBundlePath>${basedir}/locales/{locale}</resourceBundlePath>" + " <compiledLocales>" + " <locale>en_US</locale>" + " </compiledLocales>" + " </configuration>" + " </plugin>" + " </plugins>" + "</build>" + flexFrameworkDependency("3.2.0.3958"));
assertSources("project", "locales/en_US");
checkBCCount("project", 1);
checkBC("project", "project", new BuildConfigurationNature(Web, false, Library), "", "project-1.0.swc", "target", "3.2.0.3958", "en_US", "target/project-1.0-config-report.xml");
}
use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class AirPackageDialog method doValidate.
protected ValidationInfo doValidate() {
final Collection<Pair<Module, FlexBuildConfiguration>> modulesAndBCs = getSelectedBCs();
if (modulesAndBCs.isEmpty())
return new ValidationInfo("Please select one or more build configurations");
if (myApkDebugPortTextField.isVisible() && myApkDebugPortPanel.isEnabled()) {
try {
final String portValue = myApkDebugPortTextField.getText().trim();
final int port = portValue.isEmpty() ? AirPackageUtil.DEBUG_PORT_DEFAULT : Integer.parseInt(portValue);
if (port <= 0 || port > 65535)
return new ValidationInfo("Incorrect port", myApkDebugPortPanel);
} catch (NumberFormatException e) {
return new ValidationInfo("Incorrect port", myApkDebugPortTextField);
}
}
for (Pair<Module, FlexBuildConfiguration> moduleAndBC : modulesAndBCs) {
final FlexBuildConfiguration bc = moduleAndBC.second;
if (bc.isSkipCompile() && LocalFileSystem.getInstance().findFileByPath(bc.getActualOutputFilePath()) == null) {
return new ValidationInfo(FlexBundle.message("can.not.package.bc", bc.getName(), FlexBundle.message("compilation.is.switched.off")));
}
final BuildConfigurationNature nature = bc.getNature();
if (nature.isMobilePlatform()) {
if (!bc.getAndroidPackagingOptions().isEnabled() && !bc.getIosPackagingOptions().isEnabled()) {
return new ValidationInfo(FlexBundle.message("can.not.package.bc", bc.getName(), "both Android and iOS packaging disabled"));
}
if (bc.getAndroidPackagingOptions().isEnabled() && bc.getIosPackagingOptions().isEnabled()) {
final AndroidPackageType androidPackage = (AndroidPackageType) myAndroidTypeCombo.getSelectedItem();
final IOSPackageType iosPackage = (IOSPackageType) myIOSTypeCombo.getSelectedItem();
final boolean androidDebug = androidPackage != AndroidPackageType.Release;
final boolean iosDebug = iosPackage == IOSPackageType.DebugOverNetwork;
if (androidDebug != iosDebug) {
return new ValidationInfo(FlexBundle.message("can.not.package.bc", bc.getName(), FlexBundle.message("different.debug.settings", androidDebug ? 1 : 2)));
}
}
}
final Ref<String> firstErrorRef = new Ref<>();
ValidateFlashConfigurationsPrecompileTask.checkPackagingOptions(moduleAndBC.first, bc, problem -> {
if (problem.severity == ProjectStructureProblemType.Severity.ERROR && firstErrorRef.isNull()) {
firstErrorRef.set(problem.errorMessage);
}
});
// todo better error reporting. May be just mention that errors exist in some BC and provide link to Project Structure
if (!firstErrorRef.isNull()) {
return new ValidationInfo(FlexBundle.message("can.not.package.bc", bc.getName(), firstErrorRef.get()));
}
}
return null;
}
use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class AirPackageDialog method createUIComponents.
private void createUIComponents() {
myTree = new FlexBCTree(myProject, bc -> {
final BuildConfigurationNature nature = bc.getNature();
return nature.isApp() && !nature.isWebPlatform();
});
myTree.addToggleCheckBoxListener(new ChangeListener() {
public void stateChanged(final ChangeEvent e) {
updateControlsEnabledState();
}
});
}
use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.
the class AirPackageAction method update.
public void update(final AnActionEvent e) {
final Project project = e.getProject();
boolean flexModulePresent = false;
boolean airAppPresent = false;
if (project != null) {
final FlexModuleType flexModuleType = FlexModuleType.getInstance();
MODULES_LOOP: for (Module module : ModuleManager.getInstance(project).getModules()) {
if (ModuleType.get(module) == flexModuleType) {
flexModulePresent = true;
for (FlexBuildConfiguration bc : FlexBuildConfigurationManager.getInstance(module).getBuildConfigurations()) {
final BuildConfigurationNature nature = bc.getNature();
if (nature.isApp() && !nature.isWebPlatform()) {
airAppPresent = true;
break MODULES_LOOP;
}
}
}
}
}
e.getPresentation().setVisible(flexModulePresent);
e.getPresentation().setEnabled(airAppPresent && !CompilerManager.getInstance(project).isCompilationActive() && !AirPackageProjectParameters.getInstance(project).isPackagingInProgress());
}
Aggregations