[prev in list] [next in list] [prev in thread] [next in thread]
List: jedit-cvs
Subject: [ jEdit-commits ] SF.net SVN: jedit:[23559] jEdit/trunk
From: vampire0 () users ! sourceforge ! net
Date: 2014-05-23 1:42:59
Message-ID: E1WneVi-0004vP-V2 () sfs-ml-4 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 23559
http://sourceforge.net/p/jedit/svn/23559
Author: vampire0
Date: 2014-05-23 01:42:57 +0000 (Fri, 23 May 2014)
Log Message:
-----------
update JARBundler to the latest version, and add copyright tag and UTI for document \
type
Modified Paths:
--------------
jEdit/trunk/build.xml
jEdit/trunk/ivy.xml
jEdit/trunk/net/sourceforge/jarbundler/AppBundleProperties.java
jEdit/trunk/net/sourceforge/jarbundler/DocumentType.java
jEdit/trunk/net/sourceforge/jarbundler/HelpBook.java
jEdit/trunk/net/sourceforge/jarbundler/JarBundler.java
jEdit/trunk/net/sourceforge/jarbundler/JavaProperty.java
jEdit/trunk/net/sourceforge/jarbundler/PropertyListWriter.java
jEdit/trunk/net/sourceforge/jarbundler/Service.java
Modified: jEdit/trunk/build.xml
===================================================================
--- jEdit/trunk/build.xml 2014-05-22 06:13:44 UTC (rev 23558)
+++ jEdit/trunk/build.xml 2014-05-23 01:42:57 UTC (rev 23559)
@@ -1158,15 +1158,11 @@
debuglevel="${config.build.debuglevel}"
nowarn="${config.build.nowarn}"
deprecation="${config.build.deprecation}"
- source="1.4"
- target="1.4"
+ source="1.6"
+ target="1.6"
compiler="modern"
encoding="UTF-8"
includeAntRuntime="true">
- <classpath>
- <fileset dir="${lib.dir}/jarbundler"
- includes="*.jar"/>
- </classpath>
<compilerarg line="${config.build.compilerarg}"/>
</javac>
</target>
@@ -1185,10 +1181,6 @@
classname="net.sourceforge.jarbundler.JarBundler"
classpath="${dist.dir}/classes/jarbundler"
uri="antlib:net.sourceforge.jarbundler">
- <classpath>
- <fileset dir="${lib.dir}/jarbundler"
- includes="*.jar"/>
- </classpath>
</taskdef>
<tstamp>
<format property="current.year"
@@ -1206,6 +1198,7 @@
extraclasspath="/System/Library/Java"
icon="icons/icon.icns"
infostring="jEdit ${jedit.version}, Copyright © 1998-${current.year} \
Contributors" + copyright="Copyright © 1998-${current.year} Contributors"
jvmversion="${mac.target.java.version}"
shortname="jEdit"
signature="JESP"
@@ -1225,6 +1218,7 @@
<documenttype name="jEdit TEXT Document"
extensions="*"
ostypes="TEXT ****"
+ utis="public.text"
iconfile="icons/file.icns"
role="Editor"/>
</jarbundler:create>
Modified: jEdit/trunk/ivy.xml
===================================================================
--- jEdit/trunk/ivy.xml 2014-05-22 06:13:44 UTC (rev 23558)
+++ jEdit/trunk/ivy.xml 2014-05-23 01:42:57 UTC (rev 23559)
@@ -48,7 +48,6 @@
<conf name="ant-contrib" description="Dependencies for ant-contrib" \
visibility="private"/> <conf name="docbook" description="Dependencies for \
translating DocBook files" visibility="private"/> <conf name="fop" \
description="Dependencies for FOP" visibility="private"/>
- <conf name="jarbundler" description="Dependencies for JarBundler" \
visibility="private"/> <conf name="launch4j" description="Dependencies for Launch4j" \
visibility="private"/> <conf name="scripting" description="Dependencies for \
Scripting" visibility="private"/> <conf name="default-plugins" description="Shipped \
default plugins" visibility="private"/> @@ -67,7 +66,7 @@
<artifact name="docbook-xsl" e:classifier="resources" type="zip"/>
</dependency>
<dependency org="net.sf.docbook" name="docbook-xsl-saxon" rev="1.0.0" \
conf="docbook"/>
- <dependency org="xerces" name="xercesImpl" rev="2.10.0" \
conf="docbook,jarbundler"/> + <dependency org="xerces" name="xercesImpl" \
rev="2.10.0" conf="docbook"/>
<dependency org="org.apache.xmlgraphics" name="fop" rev="1.0" conf="fop"/>
Modified: jEdit/trunk/net/sourceforge/jarbundler/AppBundleProperties.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/AppBundleProperties.java 2014-05-22 \
06:13:44 UTC (rev 23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/AppBundleProperties.java 2014-05-23 \
01:42:57 UTC (rev 23559) @@ -3,19 +3,18 @@
*
* Copyright (c) 2003, Seth J. Morabito <sethm@loomcom.com> All rights reserved.
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * 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
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 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.
+ *
*/
@@ -26,6 +25,7 @@
import java.util.Hashtable;
import java.util.List;
import java.util.LinkedList;
+// import java.util.Scanner;
// Java language imports
import java.lang.String;
@@ -54,9 +54,19 @@
// 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";
@@ -78,6 +88,7 @@
// 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
@@ -87,6 +98,12 @@
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();
@@ -110,7 +127,20 @@
return mJavaProperties;
}
- public void addToClassPath(String s) {
+ // 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);
}
@@ -234,6 +264,14 @@
return mCFBundleIconFile;
}
+ public void setSplashFile(String s) {
+ mSplashFile = s;
+ }
+
+ public String getSplashFile() {
+ return mSplashFile;
+ }
+
public void setCFBundleAllowMixedLocalizations(boolean b) {
mCFBundleAllowMixedLocalizations = b;
}
@@ -242,6 +280,14 @@
return mCFBundleAllowMixedLocalizations;
}
+ public void setNSHumanReadableCopyright(String s) {
+ mNSHumanReadableCopyright = s;
+ }
+
+ public String getNSHumanReadableCopyright() {
+ return mNSHumanReadableCopyright;
+ }
+
public void setCFBundleExecutable(String s) {
mCFBundleExecutable = s;
}
@@ -290,7 +336,30 @@
return mCFHelpBookName;
}
- public void setMainClass(String s) {
+
+ 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;
}
@@ -334,4 +403,55 @@
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;
+ }
+
+ //------------------------------------------------------------------------------------------
}
Modified: jEdit/trunk/net/sourceforge/jarbundler/DocumentType.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/DocumentType.java 2014-05-22 06:13:44 UTC \
(rev 23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/DocumentType.java 2014-05-23 01:42:57 UTC \
(rev 23559) @@ -1,3 +1,19 @@
+/*
+ * 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;
import java.lang.String;
@@ -19,7 +35,14 @@
*
* Name - The name of the document type.
*
- *
+ * UTI - A list of Uniform Type Identifier (UTI) strings for the document. UTIs
+ * are strings that uniquely identify abstract types. They can be used to
+ * describe a file format or data type but can also be used to describe type
+ * information for other sorts of entities, such as directories, volumes, or
+ * packages. For more information on UTIs, see the header file UTType.h,
+ * available as part of LaunchServices.framework in Mac OS X v10.3 and later.
+ *
+ *
* Extensions - A list of the filename extensions for this document type. Don't
* include the period in the extension.
*
@@ -89,6 +112,17 @@
public String[] mimeTypes = null;
+ /**
+ * UTI. A list of Uniform Type Identifier (UTI) strings for the document.
+ * UTIs are strings that uniquely identify abstract types. They can be used
+ * to describe a file format or data type but can also be used to describe
+ * type information for other sorts of entities, such as directories,
+ * volumes, or packages. For more information on UTIs, see the header file
+ * UTType.h, available as part of LaunchServices.framework in Mac OS X v10.3
+ * and later.
+ */
+ public String[] UTIs = null;
+
/**
* Icon File. The name of the file that contains the document types icon.
*/
@@ -158,6 +192,15 @@
return (mimeTypes == null) ? EMPTYLIST : Arrays.asList(this.mimeTypes);
}
+ // Uniform Type Identifiers
+ public void setUTIs(String UTIs) {
+ this.UTIs = UTIs.split("[\\s,]");
+ }
+
+ public List getUTIs() {
+ return this.UTIs == null ? EMPTYLIST : Arrays.asList(this.UTIs);
+ }
+
// Document icon file
public void setIconFile(File iconFile) {
this.iconFile = iconFile;
Modified: jEdit/trunk/net/sourceforge/jarbundler/HelpBook.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/HelpBook.java 2014-05-22 06:13:44 UTC (rev \
23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/HelpBook.java 2014-05-23 01:42:57 UTC (rev \
23559) @@ -1,3 +1,19 @@
+/*
+ * 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;
import java.util.ArrayList;
Modified: jEdit/trunk/net/sourceforge/jarbundler/JarBundler.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/JarBundler.java 2014-05-22 06:13:44 UTC \
(rev 23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/JarBundler.java 2014-05-23 01:42:57 UTC \
(rev 23559) @@ -1,21 +1,20 @@
/*
* A Mac OS X Jar Bundler Ant Task.
*
+ *
* Copyright (c) 2003, Seth J. Morabito <sethm@loomcom.com> All rights reserved.
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * 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
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 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;
@@ -406,6 +405,16 @@
}
/**
+ * Setter for the "splashfile" attribute (optional). If it is somewhere
+ * in a jar file, which contains a Splash-Screen manifest entry,
+ * use "$JAVAROOT/myjar.jar"
+ */
+
+ public void setSplashFile(String s) {
+ bundleProperties.setSplashFile(s);
+ }
+
+ /**
* Setter for the "bundleid" attribute (optional) This key specifies a
* unique identifier string for the bundle. This identifier should be in the
* form of a Java-style package name, for example com.mycompany.myapp. The
@@ -419,16 +428,32 @@
}
/**
- * Setter for the "developmentregion" attribute(optional) Default "English".
+ * Setter for the "developmentregion" attribute (optional) Default "English".
*/
public void setDevelopmentregion(String s) {
bundleProperties.setCFBundleDevelopmentRegion(s);
}
+ /** Tobias Fischer, v2.3.0
+ * Setter for the "allowmixedlocalizations" attribute (optional) Default "false".
+ */
+ public void setAllowMixedLocalizations(boolean b) {
+ bundleProperties.setCFBundleAllowMixedLocalizations(b);
+ }
+
+ /** Tobias Fisher, v2.3.1
+ * Setter for the "NSHumanReadableCopyright" attribute (optional)
+ */
+
+ public void setCopyright(String s) {
+ bundleProperties.setNSHumanReadableCopyright(s);
+ }
+
/**
- * Setter for the "aboutmenuname" attribute (optional)
+ * Setter for the deprecated "aboutmenuname" attribute (optional)
*/
public void setAboutmenuname(String s) {
+ System.err.println("WARNING: 'aboutmenuname' is deprecated! Use JarBundler \
attribute 'shortname' instead!"); bundleProperties.setCFBundleName(s);
}
@@ -510,7 +535,41 @@
bundleProperties.setJVMVersion(s);
}
+ // New in JarBundler 2.2.0; Tobias Bley ----------------
+
/**
+ * Setter for the "JVMArchs" attribute (optional)
+ */
+ public void setJvmArchs(String s) {
+ bundleProperties.setJVMArchs(s);
+ }
+
+ /** Michael Bader <nufan_k@me.com> --------------------
+ * Setter for the "LSArchitecturePriority" attribute (optional)
+ */
+ public void setLSArchitecturePriority(String s) {
+ bundleProperties.setLSArchitecturePriority(s);
+ }
+
+ //-------------------------------------------------------
+
+ /**
+ * Setter for the "startonmainthread" attribute (optional)
+ */
+ public void setStartonmainthread(boolean b) {
+ bundleProperties.setStartOnMainThread(new Boolean(b));
+ }
+
+
+ /**
+ * Setter for the "startasagent" attribute (optional)
+ */
+ public void setIsAgent( boolean b ) {
+ bundleProperties.setLSUIElement( new Boolean( b ) );
+ }
+
+
+ /**
* Setter for the "infostring" attribute (optional) This key identifies a
* human-readable plain text string displaying the copyright information for
* the bundle. The Finder displays this information in the Info window of
@@ -540,6 +599,7 @@
* build.
*/
public void setShortInfoString(String s) {
+ System.err.println("WARNING: 'shortinfostring' is deprecated! Use JarBundler \
attribute 'infostring' instead!"); setVersion(s);
}
@@ -597,6 +657,7 @@
bundleProperties.setCFBundleHelpBookName(s);
}
+
/**
* Setter for the "jars" attribute (required if no "jarfileset" is present)
*/
@@ -636,6 +697,7 @@
* Setter for the "extraclasspath" attribute (optional)
*/
public void setExtraclasspath(String s) {
+ if (s == null || s.trim().equals("")) return;
PatternSet patset = new PatternSet();
patset.setIncludes(s);
@@ -1159,7 +1221,8 @@
for (Iterator jarIter = mExtraClassPathAttrs.iterator(); jarIter
.hasNext();) {
File src = (File) jarIter.next();
- bundleProperties.addToExtraClassPath(src.getPath());
+ String path = src.getPath().replace(File.separatorChar, '/');
+ bundleProperties.addToExtraClassPath(path);
}
}
@@ -1178,7 +1241,8 @@
for (int i = 0; i < files.length; i++) {
File f = new File(srcDir, files[i]);
- bundleProperties.addToExtraClassPath(f.getPath());
+ String path = f.getPath().replace(File.separatorChar, '/');
+ bundleProperties.addToExtraClassPath(path);
}
}
}
@@ -1194,7 +1258,8 @@
for (int i = 0; i < files.length; i++) {
File f = new File(srcDir, files[i]);
- bundleProperties.addToExtraClassPath(f.getPath());
+ String path = f.getPath().replace(File.separatorChar, '/');
+ bundleProperties.addToExtraClassPath(path);
}
}
}
Modified: jEdit/trunk/net/sourceforge/jarbundler/JavaProperty.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/JavaProperty.java 2014-05-22 06:13:44 UTC \
(rev 23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/JavaProperty.java 2014-05-23 01:42:57 UTC \
(rev 23559) @@ -1,3 +1,19 @@
+/*
+ * 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;
public class JavaProperty {
Modified: jEdit/trunk/net/sourceforge/jarbundler/PropertyListWriter.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/PropertyListWriter.java 2014-05-22 \
06:13:44 UTC (rev 23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/PropertyListWriter.java 2014-05-23 \
01:42:57 UTC (rev 23559) @@ -1,26 +1,32 @@
/*
* Write the application bundle file: Info.plist
*
- * Copyright (c) 2006, William A. Gilbert <gilbert@informagen.com> All rights \
reserved.
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Copyright (c) 2003, Seth J. Morabito <sethm@loomcom.com> All rights reserved.
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
+ * 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
*
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 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;
// This package's imports
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import net.sourceforge.jarbundler.AppBundleProperties;
// Java I/O
@@ -60,13 +66,7 @@
import org.w3c.dom.Attr;
-// Xerces serializer
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.apache.xml.serialize.LineSeparator;
-
-
/**
* Write out a Java application bundle property list file. For descriptions of
* the property list keys, see <a
@@ -114,31 +114,24 @@
this.document = createDOM();
buildDOM();
-
- // Serialize the DOM into the writer
- writer = new BufferedWriter(new OutputStreamWriter(
- new FileOutputStream(fileName), "UTF-8"));
- // Prettify the XML Two space indenting, no line wrapping
- OutputFormat outputFormat = new OutputFormat();
- outputFormat.setMethod("xml");
- outputFormat.setIndenting(true);
- outputFormat.setIndent(2);
- outputFormat.setLineWidth(0);
-
- // Create a DOM serlializer and write the XML
- XMLSerializer serializer = new XMLSerializer(writer, outputFormat);
- serializer.asDOMSerializer();
- serializer.serialize(this.document);
-
- } catch (ParserConfigurationException pce) {
+
+ TransformerFactory transFactory = TransformerFactory.newInstance(); \
+ Transformer trans = transFactory.newTransformer();
+ trans.setOutputProperty(OutputKeys.INDENT, "yes");
+ trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","2" \
); + writer = new BufferedWriter(new OutputStreamWriter(new \
FileOutputStream(fileName), "UTF-8")); + trans.transform(new \
DOMSource(document), new StreamResult(writer)); + } catch \
(TransformerConfigurationException tce) { + throw new BuildException(tce);
+ } catch (TransformerException te) {
+ throw new BuildException(te);
+ } catch (ParserConfigurationException pce) {
throw new BuildException(pce);
} catch (IOException ex) {
throw new BuildException("Unable to write \"" + fileName + "\"");
} finally {
fileUtils.close(writer);
}
-
-
}
private Document createDOM() throws ParserConfigurationException {
@@ -179,8 +172,7 @@
// Mac OS X required key, defaults to "false"
writeKeyStringPair("CFBundleAllowMixedLocalizations",
- (bundleProperties.getCFBundleAllowMixedLocalizations() ? "true" : "false"),
- dict);
+ (bundleProperties.getCFBundleAllowMixedLocalizations() ? "true" : "false"), \
dict);
// Mac OS X required, defaults to "6.0"
writeKeyStringPair("CFBundleInfoDictionaryVersion",
@@ -218,6 +210,14 @@
if (bundleProperties.getCFBundleHelpBookName() != null)
writeKeyStringPair("CFBundleHelpBookName", \
bundleProperties.getCFBundleHelpBookName(), dict);
+ // Copyright, optional
+ if(bundleProperties.getNSHumanReadableCopyright() != null)
+ writeKeyStringPair("NSHumanReadableCopyright", \
bundleProperties.getNSHumanReadableCopyright(), dict); +
+ // IsAgent, optional
+ if ( bundleProperties.getLSUIElement() != null )
+ writeKeyBooleanPair( "LSUIElement", bundleProperties.getLSUIElement(), dict );
+
// Document Types, optional
List documentTypes = bundleProperties.getDocumentTypes();
@@ -234,8 +234,24 @@
// Target JVM version, optional but recommended
if (bundleProperties.getJVMVersion() != null)
writeKeyStringPair("JVMVersion", bundleProperties.getJVMVersion(), javaDict);
+
+ // New in JarBundler 2.2.0; Tobias Bley ---------------------------------
+ // JVMArchs, optional
+ List jvmArchs = bundleProperties.getJVMArchs();
+
+ if (jvmArchs != null && !jvmArchs.isEmpty())
+ writeJVMArchs(jvmArchs, javaDict);
+ // lsArchitecturePriority, optional
+ List lsArchitecturePriority = bundleProperties.getLSArchitecturePriority();
+
+ if (lsArchitecturePriority != null && !lsArchitecturePriority.isEmpty())
+ writeLSArchitecturePriority(lsArchitecturePriority, javaDict);
+
+ //-----------------------------------------------------------------------
+
+
// Classpath is composed of two types, required
// 1: Jars bundled into the JAVA_ROOT of the application
// 2: External directories or files with an absolute path
@@ -255,6 +271,16 @@
if (bundleProperties.getWorkingDirectory() != null)
writeKeyStringPair("WorkingDirectory", bundleProperties.getWorkingDirectory(), \
javaDict);
+ // StartOnMainThread, optional
+ if (bundleProperties.getStartOnMainThread() != null) {
+ writeKey("StartOnMainThread", javaDict);
+ createNode(bundleProperties.getStartOnMainThread().toString(), javaDict);
+ }
+
+ // SplashFile, optional
+ if (bundleProperties.getSplashFile() != null)
+ writeKeyStringPair("SplashFile", bundleProperties.getSplashFile(), \
javaDict); +
// Main class arguments, optional
if (bundleProperties.getArguments() != null)
writeKeyStringPair("Arguments", bundleProperties.getArguments(), javaDict);
@@ -319,6 +345,13 @@
writeArray(mimeTypes, documentDict);
}
+ List UTIs = documentType.getUTIs();
+
+ if (UTIs.isEmpty() == false) {
+ writeKey("LSItemContentTypes", documentDict);
+ writeArray(UTIs, documentDict);
+ }
+
// Only write this key if true
if (documentType.isBundle())
writeKeyStringPair("LSTypeIsPackage", "true", documentDict);
@@ -400,7 +433,24 @@
}
}
- private Node createNode(String tag, Node appendTo) {
+ // New in JarBundler 2.2.0; Tobias Bley ---------------------------------
+
+ private void writeJVMArchs(List jvmArchs, Node appendTo)
+ {
+ writeKey("JVMArchs", appendTo);
+ writeArray(jvmArchs, appendTo);
+ }
+
+ private void writeLSArchitecturePriority(List lsArchitecturePriority, Node \
appendTo) + {
+ writeKey("LSArchitecturePriority", appendTo);
+ writeArray(lsArchitecturePriority, appendTo);
+ }
+
+ //----------------------------------------------------------------------
+
+ private Node createNode(String tag, Node appendTo)
+ {
Node node = this.document.createElement(tag);
appendTo.appendChild(node);
return node;
@@ -417,6 +467,16 @@
}
+ private void writeKeyBooleanPair(String key, Boolean b, Node appendTo) {
+
+ if ( b == null )
+ return;
+
+ writeKey( key, appendTo );
+ writeBoolean( b, appendTo );
+ }
+
+
private void writeKey(String key, Node appendTo) {
Element keyNode = this.document.createElement("key");
appendTo.appendChild(keyNode);
@@ -438,5 +498,17 @@
writeString((String)it.next(), arrayNode);
}
+
+ private void writeBoolean( Boolean b, Node appendTo ) {
+ Element booleanNode = null;
+ if ( b.booleanValue() ) {
+ booleanNode = this.document.createElement( "true" );
+ }
+ else {
+ booleanNode = this.document.createElement( "false" );
+
+ }
+ appendTo.appendChild( booleanNode );
+ }
}
Modified: jEdit/trunk/net/sourceforge/jarbundler/Service.java
===================================================================
--- jEdit/trunk/net/sourceforge/jarbundler/Service.java 2014-05-22 06:13:44 UTC (rev \
23558)
+++ jEdit/trunk/net/sourceforge/jarbundler/Service.java 2014-05-23 01:42:57 UTC (rev \
23559) @@ -1,3 +1,19 @@
+/*
+ * 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;
import java.util.ArrayList;
@@ -11,7 +27,7 @@
*
* Port Name - The name of the port the application monitors for incoming service \
requests.
*
-
+ *
* Message - The name of the instance method to invoke for the service.
* In Objective-C, the instance method must be of the form \
messageName:userData:error:.
* In Java, the instance method must be of the form \
messageName(NSPasteBoard,String). @@ -65,30 +81,30 @@
/**
-
+ *
* The name of the instance method to invoke for the service.
* In Objective-C, the instance method must be of the form \
messageName:userData:error:.
-
+ *
* In Java, the instance method must be of the form \
messageName(NSPasteBoard,String).
*/
private String message = null;
/**
-
+ *
* The text to add to the Services menu. The value must be unique.
-
+ *
* You can use a slash character "/" to specify a submenu. For example, Mail/Send
-
+ *
* would appear in the Services Menu as a menu named Mail with an item named Send.
*/
private String menuItem = null;
/**
* A list of the data type names that can be read by the service.
-
+ *
* The NSPasteboard class description lists several common data types.
-
+ *
* You must specify either Send Types, Return Types or both.
*/
private String[] sendTypes = null;
@@ -96,9 +112,9 @@
/**
* A list of the data type names that can be returned by the service.
-
+ *
* The NSPasteboard class description lists several common data types.
-
+ *
* You must specify either Return Types, Send Types or both.
*/
private String[] returnTypes = null;
@@ -106,33 +122,33 @@
/**
* This attribute is optional. The keyboard equivalent used to invoke
-
+ *
* the service menu command. The value has to be a single character. Users invoke \
this
-
+ *
* keyboard equivalent by pressing the Command and Shift key modifiers along with \
the character.
-
+ *
*/
private String keyEquivalent = null;
/**
-
+ *
* This attribute is optional. The value is free choosable and is passed
-
+ *
* to the method as second parameter.
-
+ *
*/
private String userData = null;
/**
-
+ *
* This attribute is optional. It indicates the number of milliseconds
-
+ *
* Services should wait for a response from the application providing
-
+ *
* a service when a respond is required.
-
+ *
*/
private String timeout = null;
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic