use of com.intellij.flex.model.bc.JpsFlexCompilerOptions in project intellij-plugins by JetBrains.
the class FlexBuilder method createCssBC.
private static JpsFlexBuildConfiguration createCssBC(final JpsFlexBuildConfiguration mainBC, final String cssPath) {
final JpsFlexBuildConfiguration cssBC = mainBC.getModule().getProperties().createTemporaryCopyForCompilation(mainBC);
cssBC.setOutputType(OutputType.Application);
cssBC.setMainClass(cssPath);
cssBC.setOutputFileName(FileUtil.getNameWithoutExtension(PathUtilRt.getFileName(cssPath)) + ".swf");
final String cssDirPath = PathUtilRt.getParentPath(cssPath);
String relativeToRoot = FlexCommonUtils.getPathRelativeToSourceRoot(mainBC.getModule(), cssDirPath);
if (relativeToRoot == null) {
relativeToRoot = FlexCommonUtils.getPathRelativeToContentRoot(mainBC.getModule(), cssDirPath);
}
if (!StringUtil.isEmpty(relativeToRoot)) {
final String outputFolder = PathUtilRt.getParentPath(mainBC.getActualOutputFilePath());
cssBC.setOutputFolder(outputFolder + "/" + relativeToRoot);
}
cssBC.setUseHtmlWrapper(false);
cssBC.setRLMs(Collections.emptyList());
cssBC.setCssFilesToCompile(Collections.emptyList());
final JpsFlexCompilerOptions compilerOptions = cssBC.getCompilerOptions();
compilerOptions.setResourceFilesMode(JpsFlexCompilerOptions.ResourceFilesMode.None);
String additionalOptions = compilerOptions.getAdditionalOptions();
additionalOptions = FlexCommonUtils.removeOptions(additionalOptions, "link-report");
additionalOptions = FlexCommonUtils.fixSizeReportOption(additionalOptions, FileUtil.getNameWithoutExtension(PathUtilRt.getFileName(cssPath)));
compilerOptions.setAdditionalOptions(additionalOptions);
return cssBC;
}
use of com.intellij.flex.model.bc.JpsFlexCompilerOptions in project intellij-plugins by JetBrains.
the class FlexBuilder method createRlmBC.
private static JpsFlexBuildConfiguration createRlmBC(final JpsFlexBuildConfiguration mainBC, final JpsFlexBuildConfiguration.RLMInfo rlm) {
final JpsFlexBuildConfiguration rlmBC = mainBC.getModule().getProperties().createTemporaryCopyForCompilation(mainBC);
rlmBC.setOutputType(OutputType.RuntimeLoadedModule);
// any not empty string means that need to optimize
rlmBC.setOptimizeFor(rlm.OPTIMIZE ? mainBC.getName() : "");
final String subdir = PathUtilRt.getParentPath(rlm.OUTPUT_FILE);
final String outputFileName = PathUtilRt.getFileName(rlm.OUTPUT_FILE);
rlmBC.setMainClass(rlm.MAIN_CLASS);
rlmBC.setOutputFileName(outputFileName);
if (!subdir.isEmpty()) {
final String outputFolder = PathUtilRt.getParentPath(mainBC.getActualOutputFilePath());
rlmBC.setOutputFolder(outputFolder + "/" + subdir);
}
rlmBC.setUseHtmlWrapper(false);
rlmBC.setRLMs(Collections.emptyList());
rlmBC.setCssFilesToCompile(Collections.emptyList());
final JpsFlexCompilerOptions compilerOptions = rlmBC.getCompilerOptions();
compilerOptions.setResourceFilesMode(JpsFlexCompilerOptions.ResourceFilesMode.None);
String additionalOptions = compilerOptions.getAdditionalOptions();
additionalOptions = FlexCommonUtils.removeOptions(additionalOptions, "link-report");
additionalOptions = FlexCommonUtils.fixSizeReportOption(additionalOptions, StringUtil.getShortName(rlmBC.getMainClass()));
compilerOptions.setAdditionalOptions(additionalOptions);
return rlmBC;
}
Aggregations