< prev index next >

modules/fxpackager/src/main/java/com/sun/javafx/tools/ant/DeployFXTask.java

Print this page
rev 9619 : imported patch 9-jake-fxpackager.patch
   1 /*
   2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  91     private String height = null;
  92     private String embeddedWidth = null;
  93     private String embeddedHeight = null;
  94     private String outfile = null;
  95     private String outdir = null;
  96     private boolean embedJNLP;
  97     private boolean isExtension = false;
  98     private Boolean signBundle;
  99 
 100     //Before FCS default is to include DT files with app
 101     // to ensure tests are using latest and compatible.
 102     //After FCS default is to use shared copy.
 103     private boolean includeDT = false;
 104 
 105     private String updateMode="background";
 106     private Info appInfo = null;
 107     private Application app = null;
 108     private Resources resources = null;
 109     private Preferences prefs = null;
 110     private String codebase = null;

 111 
 112     //container to embed application into
 113     //could be either string id or js code. If it is string id then it needs to
 114     //be escaped
 115     private String placeholder;
 116 
 117     private PackagerLib packager;
 118     private DeployParams deployParams;
 119 
 120     private Callbacks callbacks;
 121 
 122     boolean offlineAllowed = true;
 123 
 124     //default native bundle settings
 125     // use NONE to avoid large disk space and build time overhead
 126     BundleType nativeBundles = BundleType.NONE;
 127     String bundleFormat = null;
 128 
 129     private boolean verbose = false;
 130     public void setVerbose(boolean v) {
 131         verbose = v;
 132     }
 133 
 134     public void setCodebase(String str) {
 135         codebase = str;
 136     }
 137 




 138     public DeployFXTask() {
 139         packager = new PackagerLib();
 140         deployParams = new DeployParams();
 141     }
 142 
 143     @Override
 144     public void execute() {
 145         deployParams.setOutfile(outfile);
 146         deployParams.setOutdir(new File(outdir));
 147         deployParams.setOfflineAllowed(offlineAllowed);
 148         deployParams.setVerbose(verbose);
 149         deployParams.setCodebase(codebase);

 150         deployParams.setSignBundle(signBundle);
 151 
 152         if (width != null) {
 153             deployParams.setWidth(Integer.valueOf(width));
 154         }
 155 
 156         if (height != null) {
 157             deployParams.setHeight(Integer.valueOf(height));
 158         }
 159 
 160         if (embeddedWidth != null && embeddedHeight != null) {
 161             deployParams.setEmbeddedDimensions(embeddedWidth, embeddedHeight);
 162         }
 163 
 164         deployParams.setEmbedJNLP(embedJNLP);
 165         if (perms != null) {
 166            deployParams.setAllPermissions(perms.getElevated());
 167         }
 168 
 169         if (app != null) {
 170             deployParams.setApplicationClass(app.get().mainClass);
 171             deployParams.setPreloader(app.get().preloaderClass);
 172             deployParams.setAppId(app.get().id);
 173             deployParams.setAppName(app.get().name);
 174             deployParams.setParams(app.get().parameters);
 175             deployParams.setArguments(app.get().getArguments());
 176             deployParams.setHtmlParams(app.get().htmlParameters);
 177             deployParams.setFallback(app.get().fallbackApp);
 178             deployParams.setSwingAppWithEmbeddedJavaFX(
 179                     app.get().embeddedIntoSwing);
 180             deployParams.setVersion(app.get().version);
 181             deployParams.setId(app.get().id);
 182             deployParams.setServiceHint(app.get().daemon);









 183         }
 184 
 185         if (appInfo != null) {
 186             deployParams.setTitle(appInfo.title);
 187             deployParams.setVendor(appInfo.vendor);
 188             deployParams.setDescription(appInfo.appDescription);
 189             deployParams.setCategory(appInfo.category);
 190             deployParams.setLicenseType(appInfo.licenseType);
 191             deployParams.setCopyright(appInfo.copyright);
 192             deployParams.setEmail(appInfo.email);
 193 
 194             for (Info.Icon i: appInfo.icons) {
 195                 if (i instanceof Info.Splash) {
 196                    deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 197                         ((Info.Splash) i).mode);
 198                 } else {
 199                    deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 200                         DeployParams.RunMode.WEBSTART);
 201                 }
 202             }


   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  91     private String height = null;
  92     private String embeddedWidth = null;
  93     private String embeddedHeight = null;
  94     private String outfile = null;
  95     private String outdir = null;
  96     private boolean embedJNLP;
  97     private boolean isExtension = false;
  98     private Boolean signBundle;
  99 
 100     //Before FCS default is to include DT files with app
 101     // to ensure tests are using latest and compatible.
 102     //After FCS default is to use shared copy.
 103     private boolean includeDT = false;
 104 
 105     private String updateMode="background";
 106     private Info appInfo = null;
 107     private Application app = null;
 108     private Resources resources = null;
 109     private Preferences prefs = null;
 110     private String codebase = null;
 111     private String modulePath = null;
 112 
 113     //container to embed application into
 114     //could be either string id or js code. If it is string id then it needs to
 115     //be escaped
 116     private String placeholder;
 117 
 118     private PackagerLib packager;
 119     private DeployParams deployParams;
 120 
 121     private Callbacks callbacks;
 122 
 123     boolean offlineAllowed = true;
 124 
 125     //default native bundle settings
 126     // use NONE to avoid large disk space and build time overhead
 127     BundleType nativeBundles = BundleType.NONE;
 128     String bundleFormat = null;
 129 
 130     private boolean verbose = false;
 131     public void setVerbose(boolean v) {
 132         verbose = v;
 133     }
 134 
 135     public void setCodebase(String str) {
 136         codebase = str;
 137     }
 138 
 139     public void setLinkModulePath(String str) {
 140         modulePath = str;
 141     }
 142 
 143     public DeployFXTask() {
 144         packager = new PackagerLib();
 145         deployParams = new DeployParams();
 146     }
 147 
 148     @Override
 149     public void execute() {
 150         deployParams.setOutfile(outfile);
 151         deployParams.setOutdir(new File(outdir));
 152         deployParams.setOfflineAllowed(offlineAllowed);
 153         deployParams.setVerbose(verbose);
 154         deployParams.setCodebase(codebase);
 155         deployParams.setModulePath(modulePath);
 156         deployParams.setSignBundle(signBundle);
 157 
 158         if (width != null) {
 159             deployParams.setWidth(Integer.valueOf(width));
 160         }
 161 
 162         if (height != null) {
 163             deployParams.setHeight(Integer.valueOf(height));
 164         }
 165 
 166         if (embeddedWidth != null && embeddedHeight != null) {
 167             deployParams.setEmbeddedDimensions(embeddedWidth, embeddedHeight);
 168         }
 169 
 170         deployParams.setEmbedJNLP(embedJNLP);
 171         if (perms != null) {
 172            deployParams.setAllPermissions(perms.getElevated());
 173         }
 174 
 175         if (app != null) {
 176             deployParams.setApplicationClass(app.get().mainClass);
 177             deployParams.setPreloader(app.get().preloaderClass);
 178             deployParams.setAppId(app.get().id);
 179             deployParams.setAppName(app.get().name);
 180             deployParams.setParams(app.get().parameters);
 181             deployParams.setArguments(app.get().getArguments());
 182             deployParams.setHtmlParams(app.get().htmlParameters);
 183             deployParams.setFallback(app.get().fallbackApp);
 184             deployParams.setSwingAppWithEmbeddedJavaFX(
 185                     app.get().embeddedIntoSwing);
 186             deployParams.setVersion(app.get().version);
 187             deployParams.setId(app.get().id);
 188             deployParams.setServiceHint(app.get().daemon);
 189 
 190             for (String s : app.getAddModule()) {
 191                 deployParams.addAddModule(s);
 192             }
 193             for (String s : app.getLimitModule()) {
 194                 deployParams.addLimitModule(s);
 195             }
 196             deployParams.setDetectModules(app.getDetectModules());
 197             deployParams.setJdkModulePath(app.getJdkModulePath());
 198         }
 199 
 200         if (appInfo != null) {
 201             deployParams.setTitle(appInfo.title);
 202             deployParams.setVendor(appInfo.vendor);
 203             deployParams.setDescription(appInfo.appDescription);
 204             deployParams.setCategory(appInfo.category);
 205             deployParams.setLicenseType(appInfo.licenseType);
 206             deployParams.setCopyright(appInfo.copyright);
 207             deployParams.setEmail(appInfo.email);
 208 
 209             for (Info.Icon i: appInfo.icons) {
 210                 if (i instanceof Info.Splash) {
 211                    deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 212                         ((Info.Splash) i).mode);
 213                 } else {
 214                    deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 215                         DeployParams.RunMode.WEBSTART);
 216                 }
 217             }


< prev index next >