Search in sources :

Example 31 with BuildConfigurationNature

use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.

the class Flexmojos3ImporterTest method testAirPackaging.

public void testAirPackaging() throws Exception {
    importProject(mavenProjectDescription("project", "air") + "<build>" + "  <sourceDirectory>src/main/flex</sourceDirectory>" + "  <plugins>" + "    <plugin>" + flexmojosPlugin() + "      <configuration>\n" + "        <descriptorTemplate>d.xml</descriptorTemplate>\n" + "        <keystore>c.p12</keystore>" + "      </configuration>\n" + "      <dependencies>\n" + "        <dependency>\n" + "          <groupId>com.adobe.flex</groupId>\n" + "          <artifactId>compiler</artifactId>\n" + "          <version>3.5.0.12683</version>\n" + "          <type>pom</type>\n" + "        </dependency>\n" + "      </dependencies>\n" + "    </plugin>" + "  </plugins>" + "</build>" + flexFrameworkDependency("3.5.0.12683"));
    checkBCCount("project", 1);
    final FlexBuildConfiguration bc = checkBC("project", "project", new BuildConfigurationNature(Desktop, false, Application), "", "project-1.0.swf", "target", "3.5.0.12683", "en_US", "target/project-1.0-config-report.xml");
    assertFalse(bc.getAirDesktopPackagingOptions().isUseGeneratedDescriptor());
    assertEquals("d.xml", bc.getAirDesktopPackagingOptions().getCustomDescriptorPath());
    assertFalse(bc.getAirDesktopPackagingOptions().getSigningOptions().isUseTempCertificate());
    assertEquals("c.p12", bc.getAirDesktopPackagingOptions().getSigningOptions().getKeystorePath());
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature)

Example 32 with BuildConfigurationNature

use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.

the class Flexmojos3ImporterTest method testConfiguringCompiledLocalesSpecifiedBySpecifiedDefaultLocale.

public void testConfiguringCompiledLocalesSpecifiedBySpecifiedDefaultLocale() throws Exception {
    createProjectSubDirs("src/main/locales/ru_RU");
    importProject(mavenProjectDescription("project", "swf") + "<build>" + "  <plugins>" + "    <plugin>" + flexmojosPlugin() + "      <configuration>" + "        <defaultLocale>ru_RU</defaultLocale>" + "      </configuration>" + "    </plugin>" + "  </plugins>" + "</build>" + flexFrameworkDependency("3.2.0.3958"));
    assertSources("project", "src/main/locales/ru_RU");
    checkBCCount("project", 1);
    checkBC("project", "project", new BuildConfigurationNature(Web, false, Application), "", "project-1.0.swf", "target", "3.2.0.3958", "ru_RU", "target/project-1.0-config-report.xml");
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature)

Example 33 with BuildConfigurationNature

use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.

the class Flexmojos3ImporterTest method testConfiguringRuntimeAndCompiledLocalesAsSourceFolders.

public void testConfiguringRuntimeAndCompiledLocalesAsSourceFolders() throws Exception {
    createProjectSubDirs("src/main/locales/pt_BR", "src/main/locales/ru_RU", "src/main/locales/en_GB", "src/main/locales/fr_FR");
    importProject(mavenProjectDescription("project", "swc") + "<build>" + "  <plugins>" + "    <plugin>" + flexmojosPlugin() + "      <configuration>" + "        <compiledLocales>" + "          <locale>en_GB</locale>" + "          <locale>fr_FR</locale>" + "        </compiledLocales>" + "        <runtimeLocales>" + "          <locale>pt_BR</locale>" + "          <locale>ru_RU</locale>" + "        </runtimeLocales>" + "      </configuration>" + "    </plugin>" + "  </plugins>" + "</build>" + flexFrameworkDependency("3.2.0.3958"));
    assertSources("project", "src/main/locales/en_GB", "src/main/locales/fr_FR", "src/main/locales/pt_BR", "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_GB\nfr_FR", "target/project-1.0-config-report.xml");
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature)

Example 34 with BuildConfigurationNature

use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.

the class FlexModuleBuilder method setupBC.

private void setupBC(final ModifiableRootModel modifiableRootModel, final ModifiableFlexBuildConfiguration bc) {
    final Module module = modifiableRootModel.getModule();
    bc.setName(module.getName());
    bc.setTargetPlatform(myTargetPlatform);
    bc.setPureAs(isPureActionScript);
    bc.setOutputType(myOutputType);
    final BuildConfigurationNature nature = bc.getNature();
    if (myCreateSampleApp) {
        final String className = FileUtil.getNameWithoutExtension(mySampleAppName);
        bc.setMainClass(className);
        bc.setOutputFileName(className + (myOutputType == OutputType.Library ? ".swc" : ".swf"));
        if (nature.isApp()) {
            if (nature.isDesktopPlatform()) {
                bc.getAirDesktopPackagingOptions().setPackageFileName(className);
            } else if (nature.isMobilePlatform()) {
                bc.getAndroidPackagingOptions().setEnabled(myAndroidEnabled);
                bc.getAndroidPackagingOptions().setPackageFileName(className);
                bc.getIosPackagingOptions().setEnabled(myIOSEnabled);
                bc.getIosPackagingOptions().setPackageFileName(className);
            }
        }
    } else {
        final String fileName = PathUtil.suggestFileName(module.getName());
        bc.setOutputFileName(fileName + (myOutputType == OutputType.Library ? ".swc" : ".swf"));
        if (nature.isApp()) {
            if (nature.isDesktopPlatform()) {
                bc.getAirDesktopPackagingOptions().setPackageFileName(fileName);
            } else if (nature.isMobilePlatform()) {
                bc.getAndroidPackagingOptions().setEnabled(myAndroidEnabled);
                bc.getAndroidPackagingOptions().setPackageFileName(fileName);
                bc.getIosPackagingOptions().setEnabled(myIOSEnabled);
                bc.getIosPackagingOptions().setPackageFileName(fileName);
            }
        }
    }
    bc.setOutputFolder(VfsUtilCore.urlToPath(modifiableRootModel.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl()));
    bc.getDependencies().setSdkEntry(myFlexSdk != null ? Factory.createSdkEntry(myFlexSdk.getName()) : null);
    if (myTargetPlayer != null) {
        bc.getDependencies().setTargetPlayer(myTargetPlayer);
    }
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature) Module(com.intellij.openapi.module.Module) CompilerModuleExtension(com.intellij.openapi.roots.CompilerModuleExtension)

Example 35 with BuildConfigurationNature

use of com.intellij.flex.model.bc.BuildConfigurationNature in project intellij-plugins by JetBrains.

the class FlexBCConfigurable method createChildConfigurables.

public void createChildConfigurables() {
    final BuildConfigurationNature nature = myConfiguration.getNature();
    if (myDependenciesConfigurable != null) {
        myDependenciesConfigurable.removeUserActivityListeners();
        myDependenciesConfigurable.disposeUIResources();
    }
    if (myCompilerOptionsConfigurable != null) {
        myCompilerOptionsConfigurable.removeUserActivityListeners();
        myCompilerOptionsConfigurable.disposeUIResources();
    }
    if (myAirDesktopPackagingConfigurable != null) {
        myAirDesktopPackagingConfigurable.removeUserActivityListeners();
        myAirDesktopPackagingConfigurable.disposeUIResources();
    }
    if (myAndroidPackagingConfigurable != null) {
        myAndroidPackagingConfigurable.removeUserActivityListeners();
        myAndroidPackagingConfigurable.disposeUIResources();
    }
    if (myIOSPackagingConfigurable != null) {
        myIOSPackagingConfigurable.removeUserActivityListeners();
        myIOSPackagingConfigurable.disposeUIResources();
    }
    myDependenciesConfigurable = new DependenciesConfigurable(myConfiguration, myModule.getProject(), myConfigEditor, mySdksModel);
    myDependenciesConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    myCompilerOptionsConfigurable = new CompilerOptionsConfigurable(myModule, nature, myDependenciesConfigurable, myConfiguration.getCompilerOptions());
    myCompilerOptionsConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    myCompilerOptionsConfigurable.addAdditionalOptionsListener(new CompilerOptionsConfigurable.OptionsListener() {

        public void configFileChanged(final String additionalConfigFilePath) {
            checkIfConfigFileOverridesOptions(additionalConfigFilePath);
        }

        public void additionalOptionsChanged(final String additionalOptions) {
        // may be parse additionalOptions in the same way as config file
        }
    });
    final AirDescriptorInfoProvider airDescriptorInfoProvider = new AirDescriptorInfoProvider() {

        public String getMainClass() {
            return myMainClassComponent.getText().trim();
        }

        public String getAirVersion() {
            final Sdk sdk = myDependenciesConfigurable.getCurrentSdk();
            return sdk == null || sdk.getVersionString() == null ? "" : StringUtil.notNullize(FlexCommonUtils.getAirVersion(sdk.getHomePath(), sdk.getVersionString()));
        }

        public String[] getExtensionIDs() {
            return FlexCompilationUtils.getAirExtensionIDs(myConfigEditor.getModifiableRootModel(myModule), myDependenciesConfigurable.getEditableObject());
        }

        public boolean isAndroidPackagingEnabled() {
            return myAndroidPackagingConfigurable != null && myAndroidPackagingConfigurable.isPackagingEnabled();
        }

        public boolean isIOSPackagingEnabled() {
            return myIOSPackagingConfigurable != null && myIOSPackagingConfigurable.isPackagingEnabled();
        }

        public void setCustomDescriptorForAndroidAndIOS(final String descriptorPath) {
            assert myAndroidPackagingConfigurable != null && myIOSPackagingConfigurable != null;
            myAndroidPackagingConfigurable.setUseCustomDescriptor(descriptorPath);
            myIOSPackagingConfigurable.setUseCustomDescriptor(descriptorPath);
        }
    };
    myAirDesktopPackagingConfigurable = nature.isDesktopPlatform() && nature.isApp() ? new AirDesktopPackagingConfigurable(myModule, myConfiguration.getAirDesktopPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myAirDesktopPackagingConfigurable != null) {
        myAirDesktopPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
    myAndroidPackagingConfigurable = nature.isMobilePlatform() && nature.isApp() ? new AndroidPackagingConfigurable(myModule, myConfiguration.getAndroidPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myAndroidPackagingConfigurable != null) {
        myAndroidPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
    myIOSPackagingConfigurable = nature.isMobilePlatform() && nature.isApp() ? new IOSPackagingConfigurable(myModule, myConfiguration.getIosPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myIOSPackagingConfigurable != null) {
        myIOSPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature) AirDescriptorInfoProvider(com.intellij.lang.javascript.flex.projectStructure.ui.AirPackagingConfigurableBase.AirDescriptorInfoProvider) Sdk(com.intellij.openapi.projectRoots.Sdk)

Aggregations

BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)36 Module (com.intellij.openapi.module.Module)11 Sdk (com.intellij.openapi.projectRoots.Sdk)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)5 TargetPlatform (com.intellij.flex.model.bc.TargetPlatform)4 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)4 NotNull (org.jetbrains.annotations.NotNull)4 OutputType (com.intellij.flex.model.bc.OutputType)3 FlexModuleType (com.intellij.lang.javascript.flex.FlexModuleType)3 WriteAction (com.intellij.openapi.application.WriteAction)3 LocalFileSystem (com.intellij.openapi.vfs.LocalFileSystem)3 FlexTestUtils (com.intellij.flex.util.FlexTestUtils)2 FlexStylesIndexableSetContributor (com.intellij.javascript.flex.css.FlexStylesIndexableSetContributor)2 FlexSchemaHandler (com.intellij.javascript.flex.mxml.schema.FlexSchemaHandler)2 FlexBuildConfigurationManager (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager)2 ModuleType (com.intellij.openapi.module.ModuleType)2 Project (com.intellij.openapi.project.Project)2 SdkModificator (com.intellij.openapi.projectRoots.SdkModificator)2 ValidationInfo (com.intellij.openapi.ui.ValidationInfo)2