1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
|
/*
* A Mac OS X Jar Bundler Ant Task.
*
* Copyright (c) 2003, Seth J. Morabito <sethm@loomcom.com> All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package net.sourceforge.jarbundler;
// Java Utility
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.LinkedList;
// import java.util.Scanner;
// Java language imports
import java.lang.String;
public class AppBundleProperties {
// Required
private String mApplicationName;
private String mMainClass;
// Application short name
private String mCFBundleName = null;
// Finder version, with default
private String mCFBundleShortVersionString = "1.0";
// Get Info string, optional
private String mCFBundleGetInfoString = null;
// Build number, optional
private String mCFBundleVersion = null;
// Help Book folder, optional
private String mCFHelpBookFolder = null;
// Help Book name, optional
private String mCFHelpBookName = null;
// StartOnMainThread, optional
private Boolean mStartOnMainThread = null;
// StartAsAgent, optional (per Michael Bader <nufan_k@me.com>)
private Boolean mLSUIElement = null;
// Explicit default: false
private boolean mCFBundleAllowMixedLocalizations = false;
// Copyright, optional
private String mNSHumanReadableCopyright = null;
// Explicit default: JavaApplicationStub
private String mCFBundleExecutable = "JavaApplicationStub";
// Explicit default: English
private String mCFBundleDevelopmentRegion = "English";
// Explicit default: APPL
private final String mCFBundlePackageType = "APPL";
// Explicit default: ????
private String mCFBundleSignature = "????";
// Explicit default: 1.3+
private String mJVMVersion = "1.3+";
private double mJavaVersion = 1.3;
// Explicit default: 6.0
private final String mCFBundleInfoDictionaryVersion = "6.0";
// Optional keys, with no defaults.
private String mCFBundleIconFile = null;
private String mSplashFile = null;
private String mCFBundleIdentifier = null;
private String mVMOptions = null; // Java VM options
private String mWorkingDirectory = null; // Java Working Dir
private String mArguments = null; // Java command line arguments
// Class path and extra class path elements
private List mClassPath = new ArrayList();
private List mExtraClassPath = new ArrayList();
// New in JarBundler 2.2.0; Tobias Bley ----------------
private List mJVMArchs = new ArrayList();
private List mLSArchitecturePriority = new ArrayList();
private String mSUFeedURL = null;
// -----------------------------------------------------
// Java properties
private Hashtable mJavaProperties = new Hashtable();
// Document types
private List mDocumentTypes = new LinkedList();
// Services
private List mServices = new LinkedList();
// ================================================================================
/**
* Add a Java runtime property to the properties hashtable.
*/
public void addJavaProperty(String prop, String val) {
mJavaProperties.put(prop, val);
}
public Hashtable getJavaProperties() {
return mJavaProperties;
}
// New in JarBundler 2.2.0; Tobias Bley ----------------
public void addToJVMArchs(String s) {
mJVMArchs.add(s);
}
public List getJVMArchs() {
return mJVMArchs;
}
//------------------------------------------------------
public void addToClassPath(String s)
{
mClassPath.add("$JAVAROOT/" + s);
}
public void addToExtraClassPath(String s) {
mExtraClassPath.add(s);
}
public List getExtraClassPath() {
return mExtraClassPath;
}
public DocumentType createDocumentType() {
return new DocumentType();
}
public List getDocumentTypes() {
return mDocumentTypes;
}
/**
* Add a document type to the document type list.
*/
public void addDocumentType(DocumentType documentType) {
mDocumentTypes.add(documentType);
}
public Service createService() {
return new Service();
}
public List getServices() {
return mServices;
}
/**
* Add a service to the services list.
*/
public void addService(Service service) {
mServices.add(service);
}
// ================================================================================
public void setApplicationName(String s) {
mApplicationName = s;
}
public String getApplicationName() {
return mApplicationName;
}
// ================================================================================
//
// Bundle setters and getters
//
public void setCFBundleName(String s) {
if (s.length() > 16)
System.err
.println("WARNING: 'shortname' is recommeded to be no more than 16 "
+ "charaters long. See usage notes.");
mCFBundleName = s;
}
public String getCFBundleName() {
if (mCFBundleName == null)
return getApplicationName();
return mCFBundleName;
}
public void setCFBundleVersion(String s) {
mCFBundleVersion = s;
}
public String getCFBundleVersion() {
return mCFBundleVersion;
}
public void setCFBundleInfoDictionaryVersion(String s) {
// mCFBundleInfoDictionaryVersion = s;
}
public String getCFBundleInfoDictionaryVersion() {
return mCFBundleInfoDictionaryVersion;
}
public void setCFBundleIdentifier(String s) {
mCFBundleIdentifier = s;
}
public String getCFBundleIdentifier() {
return mCFBundleIdentifier;
}
public void setCFBundleGetInfoString(String s) {
mCFBundleGetInfoString = s;
}
public String getCFBundleGetInfoString() {
if (mCFBundleGetInfoString == null)
return getCFBundleShortVersionString();
return mCFBundleGetInfoString;
}
public void setCFBundleShortVersionString(String s) {
mCFBundleShortVersionString = s;
}
public String getCFBundleShortVersionString() {
return mCFBundleShortVersionString;
}
public void setCFBundleIconFile(String s) {
mCFBundleIconFile = s;
}
public String getCFBundleIconFile() {
return mCFBundleIconFile;
}
public void setSplashFile(String s) {
mSplashFile = s;
}
public String getSplashFile() {
return mSplashFile;
}
public void setCFBundleAllowMixedLocalizations(boolean b) {
mCFBundleAllowMixedLocalizations = b;
}
public boolean getCFBundleAllowMixedLocalizations() {
return mCFBundleAllowMixedLocalizations;
}
public void setNSHumanReadableCopyright(String s) {
mNSHumanReadableCopyright = s;
}
public String getNSHumanReadableCopyright() {
return mNSHumanReadableCopyright;
}
public void setCFBundleExecutable(String s) {
mCFBundleExecutable = s;
}
public String getCFBundleExecutable() {
return mCFBundleExecutable;
}
public void setCFBundleDevelopmentRegion(String s) {
mCFBundleDevelopmentRegion = s;
}
public String getCFBundleDevelopmentRegion() {
return mCFBundleDevelopmentRegion;
}
public void setCFBundlePackageType(String s) {
// mCFBundlePackageType = s;
}
public String getCFBundlePackageType() {
return mCFBundlePackageType;
}
public void setCFBundleSignature(String s) {
mCFBundleSignature = s;
}
public String getCFBundleSignature() {
return mCFBundleSignature;
}
public void setCFBundleHelpBookFolder(String s) {
mCFHelpBookFolder = s;
}
public String getCFBundleHelpBookFolder() {
return mCFHelpBookFolder;
}
public void setCFBundleHelpBookName(String s) {
mCFHelpBookName = s;
}
public String getCFBundleHelpBookName() {
return mCFHelpBookName;
}
public void setStartOnMainThread(Boolean b) {
mStartOnMainThread = b;
}
public Boolean getStartOnMainThread() {
return mStartOnMainThread;
}
public Boolean getLSUIElement() {
return mLSUIElement;
}
public void setLSUIElement( Boolean b ) {
this.mLSUIElement = b;
}
public void setMainClass( String s ) {
mMainClass = s;
}
public String getMainClass() {
return mMainClass;
}
public void setJVMVersion(String s) {
mJVMVersion = s;
mJavaVersion = Double.parseDouble(s.substring(0, 3));
}
public String getJVMVersion() {
return mJVMVersion;
}
public double getJavaVersion()
{
return mJavaVersion;
}
public void setVMOptions(String s) {
mVMOptions = s;
}
public String getVMOptions() {
return mVMOptions;
}
public void setWorkingDirectory(String s) {
mWorkingDirectory = s;
}
public String getWorkingDirectory() {
return mWorkingDirectory;
}
public void setArguments(String s) {
mArguments = s;
}
public String getArguments() {
return mArguments;
}
public List getClassPath() {
return mClassPath;
}
// New in JarBundler 2.2.0; Tobias Bley ----------------------------------------------------
/**
* @param archs space separated archs, e.g. i386 x64_64 ppc
*/
public void setJVMArchs(String archs) {
// Use for 1.4 backwards compatability
String[] tokens = archs.split("\\s+");
for (int i=0; i<tokens.length; i++)
mJVMArchs.add(tokens[i]);
// 'java.util.Scanner' is available in JDK 1.5
// Scanner s = new Scanner(archs);
// s = s.useDelimiter("\\s+");
// while (s.hasNext())
// mJVMArchs.add(s.next());
}
public List getLSArchitecturePriority() {
return mLSArchitecturePriority;
}
/**
* @param lsArchitecturePriority space separated LSArchitecturePriority, e.g. i386 x64_64 ppc
*/
public void setLSArchitecturePriority(String lsArchitecturePriority) {
// Use for 1.4 backwards compatability
String[] tokens = lsArchitecturePriority.split("\\s+");
for (int i=0; i<tokens.length; i++)
mLSArchitecturePriority.add(tokens[i]);
// 'java.util.Scanner' is available in JDK 1.5
// Scanner s = new Scanner(lsArchitecturePriority);
// s = s.useDelimiter("\\s+");
// while (s.hasNext())
// mLSArchitecturePriority.add(s.next());
}
public String getSUFeedURL() {
return mSUFeedURL;
}
public void setSUFeedURL(String suFeedURL) {
this.mSUFeedURL = suFeedURL;
}
//------------------------------------------------------------------------------------------
}
|