diff --git a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/AbstractJavaFxPackager.java b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/AbstractJavaFxPackager.java index 3f3fff1fceb9..ac04a615fc4e 100644 --- a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/AbstractJavaFxPackager.java +++ b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/AbstractJavaFxPackager.java @@ -65,6 +65,10 @@ public abstract class AbstractJavaFxPackager { protected abstract String getHeight(); + protected abstract String getHtmlTemplateFile(); + + protected abstract String getHtmlPlaceholderId(); + protected abstract String getHtmlParamFile(); protected abstract String getParamFile(); @@ -106,7 +110,7 @@ public abstract class AbstractJavaFxPackager { buf.append(""); final String artifactFileName = getArtifactRootName(); final List tags = - JavaFxAntGenerator.createJarAndDeployTasks(this, artifactFileName, getArtifactName(), tempUnzippedArtifactOutput.getPath(), false); + JavaFxAntGenerator.createJarAndDeployTasks(this, artifactFileName, getArtifactName(), tempUnzippedArtifactOutput.getPath(), tempDirectory.getPath(), null); for (JavaFxAntGenerator.SimpleTag tag : tags) { tag.generate(buf); } diff --git a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxAntGenerator.java b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxAntGenerator.java index fd5194d57d57..e07ee73b0273 100644 --- a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxAntGenerator.java +++ b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxAntGenerator.java @@ -34,7 +34,8 @@ public class JavaFxAntGenerator { String artifactFileName, String artifactName, String tempDirPath, - boolean isRelativeIconPath) { + String tempDirDeployPath, + String relativeToBaseDirPath) { final String artifactFileNameWithoutExtension = FileUtil.getNameWithoutExtension(artifactFileName); final List topLevelTagsCollector = new ArrayList(); final String preloaderJar = packager.getPreloaderJar(); @@ -100,7 +101,7 @@ public class JavaFxAntGenerator { //create jar task final SimpleTag createJarTag = new SimpleTag("fx:jar", - Couple.of("destfile", tempDirPath + File.separator + artifactFileName)); + Couple.of("destfile", tempDirPath + "/" + artifactFileName)); createJarTag.add(new SimpleTag("fx:application", Couple.of("refid", appId))); final List fileset2Jar = new ArrayList(); @@ -124,18 +125,21 @@ public class JavaFxAntGenerator { topLevelTagsCollector.add(createJarTag); final JavaFxPackagerConstants.NativeBundles bundle = packager.getNativeBundle(); - final SimpleTag iconTag = appendApplicationIconPath(topLevelTagsCollector, bundle, packager.getIcons(), isRelativeIconPath); + final SimpleTag iconTag = appendApplicationIconPath(topLevelTagsCollector, bundle, packager.getIcons(), relativeToBaseDirPath); //deploy task final SimpleTag deployTag = new SimpleTag("fx:deploy", Couple.of("width", packager.getWidth()), Couple.of("height", packager.getHeight()), Couple.of("updatemode", packager.getUpdateMode()), - Couple.of("outdir", tempDirPath + File.separator + "deploy"), + Couple.of("outdir", tempDirDeployPath), Couple.of("outfile", artifactFileNameWithoutExtension)); - if (bundle != JavaFxPackagerConstants.NativeBundles.none) { + if (bundle != null && bundle != JavaFxPackagerConstants.NativeBundles.none) { deployTag.addAttribute(Couple.of("nativeBundles", bundle.name())); } + if (!StringUtil.isEmpty(packager.getHtmlPlaceholderId())) { + deployTag.addAttribute(Couple.of("placeholderId", packager.getHtmlPlaceholderId())); + } if (packager.isEnabledSigning()) { deployTag.add(new SimpleTag("fx:permissions", Couple.of("elevated", "true"))); @@ -153,6 +157,8 @@ public class JavaFxAntGenerator { if (iconTag != null) infoTag.add(iconTag); } deployTag.add(createResourcesTag(preloaderFiles, true, allButPreloader, allButSelf, all)); + final SimpleTag templateTag = createTemplateTag(packager, tempDirDeployPath, relativeToBaseDirPath); + if (templateTag != null) deployTag.add(templateTag); topLevelTagsCollector.add(deployTag); return topLevelTagsCollector; @@ -161,32 +167,32 @@ public class JavaFxAntGenerator { private static SimpleTag appendApplicationIconPath(List topLevelTagsCollector, JavaFxPackagerConstants.NativeBundles bundle, JavaFxApplicationIcons appIcons, - boolean isRelativeIconPath) { + String relativeToPath) { boolean haveAppIcon = false; if (appIcons == null || bundle == null || appIcons.isEmpty()) return null; if (bundle.isOnLinux()) { - String iconPath = appIcons.getLinuxIcon(isRelativeIconPath); + String iconPath = appIcons.getLinuxIcon(relativeToPath); if (!StringUtil.isEmpty(iconPath)) { final SimpleTag and = new SimpleTag("and"); and.add(new SimpleTag("os", Couple.of("family", "unix"))); final SimpleTag not = new SimpleTag("not"); not.add(new SimpleTag("os", Couple.of("family", "mac"))); and.add(not); - appendIconPropertyTag(topLevelTagsCollector, iconPath, isRelativeIconPath, and); + appendIconPropertyTag(topLevelTagsCollector, iconPath, relativeToPath != null, and); haveAppIcon = true; } } if (bundle.isOnMac()) { - String iconPath = appIcons.getMacIcon(isRelativeIconPath); + String iconPath = appIcons.getMacIcon(relativeToPath); if (!StringUtil.isEmpty(iconPath)) { - appendIconPropertyTag(topLevelTagsCollector, iconPath, isRelativeIconPath, new SimpleTag("os", Couple.of("family", "mac"))); + appendIconPropertyTag(topLevelTagsCollector, iconPath, relativeToPath != null, new SimpleTag("os", Couple.of("family", "mac"))); haveAppIcon = true; } } if (bundle.isOnWindows()) { - String iconPath = appIcons.getWindowsIcon(isRelativeIconPath); + String iconPath = appIcons.getWindowsIcon(relativeToPath); if (!StringUtil.isEmpty(iconPath)) { - appendIconPropertyTag(topLevelTagsCollector, iconPath, isRelativeIconPath, new SimpleTag("os", Couple.of("family", "windows"))); + appendIconPropertyTag(topLevelTagsCollector, iconPath, relativeToPath != null, new SimpleTag("os", Couple.of("family", "windows"))); haveAppIcon = true; } } @@ -221,6 +227,20 @@ public class JavaFxAntGenerator { return resourcesTag; } + private static SimpleTag createTemplateTag(AbstractJavaFxPackager packager, String deployOutDir, String relativeToBaseDirPath) { + String htmlTemplate = packager.getHtmlTemplateFile(); + if (!StringUtil.isEmpty(htmlTemplate)) { + final String shortName = new File(htmlTemplate).getName(); + if (!StringUtil.isEmpty(relativeToBaseDirPath)) { + htmlTemplate = "${basedir}/" + FileUtil.getRelativePath(relativeToBaseDirPath, htmlTemplate, '/'); + } + return new SimpleTag("fx:template", + Couple.of("file", htmlTemplate), + Couple.of("tofile", deployOutDir + "/" + shortName)); + } + return null; + } + private static void appendIfNotEmpty(final List pairs, final String propertyName, final String propValue) { if (!StringUtil.isEmptyOrSpaces(propValue)) { pairs.add(Couple.of(propertyName, propValue)); diff --git a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxApplicationIcons.java b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxApplicationIcons.java index 89f1d69c6f51..4b480be53bec 100644 --- a/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxApplicationIcons.java +++ b/plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/JavaFxApplicationIcons.java @@ -11,14 +11,13 @@ public class JavaFxApplicationIcons { private String myLinuxIcon; private String myMacIcon; private String myWindowsIcon; - private String myBaseDir; public String getLinuxIcon() { return myLinuxIcon; } - public String getLinuxIcon(boolean isRelative) { - return isRelative ? getRelativeIcon(myLinuxIcon) : myLinuxIcon; + public String getLinuxIcon(String relativeToPath) { + return getRelativeIcon(relativeToPath, myLinuxIcon); } public void setLinuxIcon(String linuxIcon) { @@ -29,8 +28,8 @@ public class JavaFxApplicationIcons { return myMacIcon; } - public String getMacIcon(boolean isRelative) { - return isRelative ? getRelativeIcon(myMacIcon) : myMacIcon; + public String getMacIcon(String relativeToPath) { + return getRelativeIcon(relativeToPath, myMacIcon); } public void setMacIcon(String macIcon) { @@ -41,22 +40,14 @@ public class JavaFxApplicationIcons { return myWindowsIcon; } - public String getWindowsIcon(boolean isRelative) { - return isRelative ? getRelativeIcon(myWindowsIcon) : myWindowsIcon; + public String getWindowsIcon(String relativeToPath) { + return getRelativeIcon(relativeToPath, myWindowsIcon); } public void setWindowsIcon(String windowsIcon) { myWindowsIcon = windowsIcon; } - public String getBaseDir() { - return myBaseDir; - } - - public void setBaseDir(String baseDir) { - myBaseDir = baseDir; - } - public boolean isEmpty() { return StringUtil.isEmpty(myLinuxIcon) && StringUtil.isEmpty(myMacIcon) && StringUtil.isEmpty(myWindowsIcon); } @@ -71,7 +62,6 @@ public class JavaFxApplicationIcons { if (myLinuxIcon != null ? !myLinuxIcon.equals(icons.myLinuxIcon) : icons.myLinuxIcon != null) return false; if (myMacIcon != null ? !myMacIcon.equals(icons.myMacIcon) : icons.myMacIcon != null) return false; if (myWindowsIcon != null ? !myWindowsIcon.equals(icons.myWindowsIcon) : icons.myWindowsIcon != null) return false; - if (myBaseDir != null ? !myBaseDir.equals(icons.myBaseDir) : icons.myBaseDir != null) return false; return true; } @@ -81,14 +71,13 @@ public class JavaFxApplicationIcons { int result = myLinuxIcon != null ? myLinuxIcon.hashCode() : 0; result = 31 * result + (myMacIcon != null ? myMacIcon.hashCode() : 0); result = 31 * result + (myWindowsIcon != null ? myWindowsIcon.hashCode() : 0); - result = 31 * result + (myBaseDir != null ? myBaseDir.hashCode() : 0); return result; } @Nullable - private String getRelativeIcon(String icon) { - if (!StringUtil.isEmpty(icon) && !StringUtil.isEmpty(myBaseDir)) { - return FileUtil.getRelativePath(myBaseDir, icon, '/'); + private static String getRelativeIcon(String relativeToPath, String icon) { + if (!StringUtil.isEmpty(icon) && !StringUtil.isEmpty(relativeToPath)) { + return FileUtil.getRelativePath(relativeToPath, icon, '/'); } return icon; } diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/packaging/JavaFxAntTaskTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/packaging/JavaFxAntTaskTest.java index 556a11faf674..1f865f70a812 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/packaging/JavaFxAntTaskTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/packaging/JavaFxAntTaskTest.java @@ -34,7 +34,9 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ private static final String TITLE = "title"; private static final String VERSION = "version"; private static final String ICONS = "icons"; - private static final String RELATIVE_PATH = "relativePath"; + private static final String BASE_DIR_PATH = "baseDirPath"; + private static final String TEMPLATE = "template"; + private static final String PLACEHOLDER = "placeholder"; private static final String PRELOADER_JAR = "preloaderJar"; private static final String SIGNED = "signed"; @@ -147,8 +149,8 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ "\n" + "\n" + "\n", new ContainerUtil.ImmutableMapBuilder() - .put(ICONS, "/project_dir/app_icon.png,/project_dir/app_icon.icns,/project_dir/app_icon.ico,/project_dir") - .put(RELATIVE_PATH, "true") + .put(ICONS, "/project_dir/app_icon.png,/project_dir/app_icon.icns,/project_dir/app_icon.ico") + .put(BASE_DIR_PATH, "/project_dir") .build()); } @@ -200,10 +202,8 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ "\n" + "\n" + "\n" + - "\n", new ContainerUtil.ImmutableMapBuilder() - .put(ICONS, "/project_dir/app_icon.png,/project_dir/app_icon.icns,/project_dir/app_icon.ico,/project_dir") - .put(RELATIVE_PATH, "false") - .build()); + "\n", + Collections.singletonMap(ICONS, "/project_dir/app_icon.png,/project_dir/app_icon.icns,/project_dir/app_icon.ico")); } public void testJarDeployVersion() throws Exception { @@ -235,6 +235,41 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ "\n", Collections.singletonMap(VERSION, "4.2")); } + public void testJarDeployTemplate() throws Exception { + doTest("\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n", new ContainerUtil.ImmutableMapBuilder() + .put(TEMPLATE, "/project_dir/app_template.html") + .put(PLACEHOLDER, "app-placeholder-id") + .put(BASE_DIR_PATH, "/project_dir") + .build()); + } + public void testJarDeploySigned() throws Exception { doTest("\n" + "\n" + @@ -323,7 +358,7 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ packager.setVersion(version); } - boolean isRelativeIconPath = Boolean.valueOf(options.get(RELATIVE_PATH)); + String relativeToBaseDirPath = options.get(BASE_DIR_PATH); final String icon = options.get(ICONS); if (icon != null) { final String[] icons = icon.split(","); @@ -331,11 +366,19 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ appIcons.setLinuxIcon(icons[0]); appIcons.setMacIcon(icons[1]); appIcons.setWindowsIcon(icons[2]); - appIcons.setBaseDir(icons[3]); packager.setIcons(appIcons); packager.setNativeBundle(JavaFxPackagerConstants.NativeBundles.all); } + final String template = options.get(TEMPLATE); + if (template != null) { + packager.setHtmlTemplate(template); + } + final String placeholder = options.get(PLACEHOLDER); + if (placeholder != null) { + packager.setHtmlPlaceholderId(placeholder); + } + final String preloaderClass = options.get(PRELOADER_CLASS); if (preloaderClass != null) { packager.setPreloaderClass(preloaderClass); @@ -351,7 +394,7 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ } final List temp = JavaFxAntGenerator - .createJarAndDeployTasks(packager, artifactFileName, artifactName, "temp", isRelativeIconPath); + .createJarAndDeployTasks(packager, artifactFileName, artifactName, "temp", "temp" + File.separator + "deploy", relativeToBaseDirPath); final StringBuilder buf = new StringBuilder(); for (JavaFxAntGenerator.SimpleTag tag : temp) { tag.generate(buf); @@ -369,6 +412,8 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ private String myVendor; private String myDescription; private String myVersion; + private String myHtmlTemplate; + private String myHtmlPlaceholderId; private String myHtmlParams; private String myParams; private String myPreloaderClass; @@ -400,6 +445,14 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ myVersion = version; } + private void setHtmlTemplate(String htmlTemplate) { + myHtmlTemplate = htmlTemplate; + } + + private void setHtmlPlaceholderId(String htmlPlaceholderId) { + myHtmlPlaceholderId = htmlPlaceholderId; + } + private void setHtmlParams(String htmlParams) { myHtmlParams = htmlParams; } @@ -478,6 +531,16 @@ public class JavaFxAntTaskTest extends UsefulTestCase{ return "400"; } + @Override + public String getHtmlTemplateFile() { + return myHtmlTemplate; + } + + @Override + public String getHtmlPlaceholderId() { + return myHtmlPlaceholderId; + } + @Override protected String getHtmlParamFile() { return myHtmlParams; diff --git a/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactBuildTaskProvider.java b/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactBuildTaskProvider.java index d7a31195c5a4..418693a5ae06 100644 --- a/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactBuildTaskProvider.java +++ b/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactBuildTaskProvider.java @@ -175,6 +175,16 @@ public class JpsJavaFxArtifactBuildTaskProvider extends ArtifactBuildTaskProvide myCompileContext.processMessage(new CompilerMessage(COMPILER_NAME, BuildMessage.Kind.ERROR, message)); } + @Override + protected String getHtmlTemplateFile() { + return myProperties.myState.getHtmlTemplateFile(); + } + + @Override + protected String getHtmlPlaceholderId() { + return myProperties.myState.getHtmlPlaceholderId(); + } + @Override protected String getHtmlParamFile() { return myProperties.myState.getHtmlParamFile(); diff --git a/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactProperties.java b/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactProperties.java index 3231a3c5e19e..da62bfa86d18 100644 --- a/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactProperties.java +++ b/plugins/javaFX/javaFX-jps-plugin/src/org/jetbrains/plugins/javaFX/JpsJavaFxArtifactProperties.java @@ -31,6 +31,8 @@ public class JpsJavaFxArtifactProperties extends JpsElementBase - + @@ -123,10 +123,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -134,13 +166,13 @@ - + - + @@ -149,13 +181,13 @@ - + - + @@ -163,7 +195,7 @@ - + @@ -172,7 +204,7 @@ - + @@ -194,7 +226,7 @@ - + @@ -202,7 +234,7 @@ - + @@ -211,13 +243,13 @@ - + - + @@ -226,7 +258,7 @@ - + @@ -236,7 +268,7 @@ - + @@ -249,7 +281,7 @@ - + @@ -259,7 +291,7 @@ - + @@ -271,7 +303,7 @@ - + @@ -283,7 +315,7 @@ - + diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxArtifactPropertiesEditor.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxArtifactPropertiesEditor.java index bb2663de7136..a721f3f3ba35 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxArtifactPropertiesEditor.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxArtifactPropertiesEditor.java @@ -23,6 +23,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.packaging.artifacts.Artifact; import com.intellij.packaging.ui.ArtifactPropertiesEditor; @@ -55,6 +56,8 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { private JTextField myVersionTF; private JTextField myWidthTF; private JTextField myHeightTF; + private TextFieldWithBrowseButton myHtmlTemplate; + private JTextField myHtmlPlaceholderIdTF; private TextFieldWithBrowseButton myHtmlParams; private TextFieldWithBrowseButton myParams; private JCheckBox myUpdateInBackgroundCB; @@ -75,6 +78,8 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor(StdFileTypes.PROPERTIES); myHtmlParams.addBrowseFolderListener("Choose Properties File", "Parameters for the resulting application to run standalone.", project, descriptor); myParams.addBrowseFolderListener("Choose Properties File", "Parameters for the resulting application to run in the browser.", project, descriptor); + myHtmlTemplate.addBrowseFolderListener("Choose HTML File", "HTML template for application entry point to run in browser", project, + FileChooserDescriptorFactory.createSingleFileDescriptor(StdFileTypes.HTML)); myEditSignCertificateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -130,8 +135,10 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { if (isModified(myProperties.getHeight(), myHeightTF)) return true; if (isModified(myProperties.getAppClass(), myAppClass)) return true; if (isModified(myProperties.getVersion(), myVersionTF)) return true; - if (isModified(myProperties.getHtmlParamFile(), myHtmlParams)) return true; - if (isModified(myProperties.getParamFile(), myParams)) return true; + if (isModified(myProperties.getHtmlTemplateFile(), getSystemIndependentPath(myHtmlTemplate))) return true; + if (isModified(myProperties.getHtmlPlaceholderId(), myHtmlPlaceholderIdTF)) return true; + if (isModified(myProperties.getHtmlParamFile(), getSystemIndependentPath(myHtmlParams))) return true; + if (isModified(myProperties.getParamFile(), getSystemIndependentPath(myParams))) return true; if (!Comparing.equal(myNativeBundleCB.getSelectedItem(), myProperties.getNativeBundle())) return true; final boolean inBackground = Comparing.strEqual(myProperties.getUpdateMode(), JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND); if (inBackground != myUpdateInBackgroundCB.isSelected()) return true; @@ -160,6 +167,10 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { return !Comparing.strEqual(title, tf.getText().trim()); } + private static boolean isModified(final String title, String value) { + return !Comparing.strEqual(title, value); + } + @Override public void apply() { myProperties.setTitle(myTitleTF.getText()); @@ -169,8 +180,10 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { myProperties.setVersion(myVersionTF.getText()); myProperties.setWidth(myWidthTF.getText()); myProperties.setHeight(myHeightTF.getText()); - myProperties.setHtmlParamFile(myHtmlParams.getText()); - myProperties.setParamFile(myParams.getText()); + myProperties.setHtmlTemplateFile(getSystemIndependentPath(myHtmlTemplate)); + myProperties.setHtmlPlaceholderId(myHtmlPlaceholderIdTF.getText()); + myProperties.setHtmlParamFile(getSystemIndependentPath(myHtmlParams)); + myProperties.setParamFile(getSystemIndependentPath(myParams)); myProperties.setUpdateMode(myUpdateInBackgroundCB.isSelected() ? JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND : JavaFxPackagerConstants.UPDATE_MODE_ALWAYS); myProperties.setEnabledSigning(myEnableSigningCB.isSelected()); @@ -205,8 +218,10 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { setText(myHeightTF, myProperties.getHeight()); setText(myAppClass, myProperties.getAppClass()); setText(myVersionTF, myProperties.getVersion()); - setText(myHtmlParams, myProperties.getHtmlParamFile()); - setText(myParams, myProperties.getParamFile()); + setSystemDependentPath(myHtmlTemplate, myProperties.getHtmlTemplateFile()); + setText(myHtmlPlaceholderIdTF, myProperties.getHtmlPlaceholderId()); + setSystemDependentPath(myHtmlParams, myProperties.getHtmlParamFile()); + setSystemDependentPath(myParams, myProperties.getParamFile()); myNativeBundleCB.setSelectedItem(myProperties.getNativeBundle()); myUpdateInBackgroundCB.setSelected(Comparing.strEqual(myProperties.getUpdateMode(), JavaFxPackagerConstants.UPDATE_MODE_BACKGROUND)); myEnableSigningCB.setSelected(myProperties.isEnabledSigning()); @@ -235,6 +250,16 @@ public class JavaFxArtifactPropertiesEditor extends ArtifactPropertiesEditor { } } + static String getSystemIndependentPath(TextFieldWithBrowseButton withBrowseButton) { + final String text = withBrowseButton.getText(); + if (StringUtil.isEmptyOrSpaces(text)) return null; + return FileUtil.toSystemIndependentName(text.trim()); + } + + static void setSystemDependentPath(TextFieldWithBrowseButton withBrowseButton, String path) { + withBrowseButton.setText(path != null ? FileUtil.toSystemDependentName(path.trim()) : ""); + } + private static class CustomManifestAttributesDialog extends DialogWrapper { private final JPanel myWholePanel = new JPanel(new BorderLayout()); private final AttributesTable myTable; diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/ant/JavaFxChunkBuildExtension.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/ant/JavaFxChunkBuildExtension.java index 19372ca07d19..cc556d911deb 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/ant/JavaFxChunkBuildExtension.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/ant/JavaFxChunkBuildExtension.java @@ -145,8 +145,9 @@ public class JavaFxChunkBuildExtension extends ChunkBuildExtension { @Override protected void registerJavaFxPackagerError(String message) {} }; - final List tags = - JavaFxAntGenerator.createJarAndDeployTasks(javaFxPackager, artifactFileName, artifact.getName(), tempDirPath, true); + final String tempDirDeployPath = tempDirPath + "/deploy"; + final List tags = + JavaFxAntGenerator.createJarAndDeployTasks(javaFxPackager, artifactFileName, artifact.getName(), tempDirPath, tempDirDeployPath, context.getProject().getBasePath()); for (JavaFxAntGenerator.SimpleTag tag : tags) { buildTags(generator, tag); } @@ -181,14 +182,14 @@ public class JavaFxChunkBuildExtension extends ChunkBuildExtension { } final Tag signjar = new Tag("signjar", keysDescriptions); - final Tag fileset = new Tag("fileset", Couple.of("dir", tempDirPath + "/deploy")); + final Tag fileset = new Tag("fileset", Couple.of("dir", tempDirDeployPath)); fileset.add(new Tag("include", Couple.of("name", "*.jar"))); signjar.add(fileset); generator.add(signjar); } final DirectoryAntCopyInstructionCreator creator = new DirectoryAntCopyInstructionCreator(BuildProperties.propertyRef(context.getConfiguredArtifactOutputProperty(artifact))); - generator.add(creator.createDirectoryContentCopyInstruction(tempDirPath + "/deploy")); + generator.add(creator.createDirectoryContentCopyInstruction(tempDirDeployPath)); final Tag deleteTag = new Tag("delete", Couple.of("includeemptydirs", "true")); deleteTag.add(new Tag("fileset", Couple.of("dir", tempDirPath))); generator.add(deleteTag);