You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by kk...@apache.org on 2004/11/04 06:24:40 UTC
cvs commit: xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans XmlBeans.java
kkrouse 2004/11/03 21:24:40
Modified: v2 build.xml
v2/bin scomp
v2/docs/guide antXmlbean.html
v2/src/tools/org/apache/xmlbeans/impl/inst2xsd Inst2Xsd.java
v2/src/xmlcomp/org/apache/xmlbeans/impl/tool
CommandLine.java FactorImports.java
InstanceValidator.java PrettyPrinter.java
RunXQuery.java SchemaCompiler.java
SchemaResourceManager.java
StreamInstanceValidator.java
TypeHierarchyPrinter.java XSTCTester.java
v2/src/xmlpublic/org/apache/xmlbeans XmlBeans.java
Log:
- added XmlBeans.getVersion() api using package manifest entries
- changed url in ant docs
- increased initial memory for scomp
Revision Changes Path
1.91 +69 -18 xml-xmlbeans/v2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/build.xml,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- build.xml 3 Nov 2004 18:04:54 -0000 1.90
+++ build.xml 4 Nov 2004 05:24:40 -0000 1.91
@@ -3,9 +3,18 @@
<property name="build.compiler" value="javac1.4"/>
<property name="javac.source" value="1.4"/>
<property name="javac.target" value="1.4"/>
- <property name="product.version" value="1.0.0"/>
<property name="jam_root" value="jam"/>
+ <property name="product.version" value="2.0.0-beta1"/>
+
+ <!-- manifest entries -->
+ <property name="manifest.name" value="org/apache/xmlbeans/"/>
+ <property name="manifest.title" value="org.apache.xmlbeans"/>
+ <property name="manifest.version" value="2.0.0"/>
+ <property name="manifest.vendor" value="Apache Software Foundation"/>
+ <property name="manifest.url" value="http://xmlbeans.apache.org/"/>
+ <property name="manifest.comment" value="Apache XmlBeans version ${product.version}"/>
+
<!-- needs to be the same as 'classes_dir' in jam/build.xml -->
<property name="jam_classes_dir" value="${jam_root}/build/classes"/>
@@ -257,22 +266,22 @@
<target name="dist-src" depends="clean, dirs">
<delete file="build/private/incubating-xmlbeans-${product.version}-src.zip"/>
- <delete file="build/private/incubating-xmlbeans-${product.version}-src.tgz"/>
+ <delete file="build/private/incubating-xmlbeans-${product.version}-src.tgz"/>
- <zip destfile="build/private/incubating-xmlbeans-${product.version}-src.zip">
- <zipfileset
- dir="."
- includes="**"
- excludes="build/**"
- prefix="xmlbeans-${product.version}"/>
+ <zip destfile="build/private/incubating-xmlbeans-${product.version}-src.zip">
+ <zipfileset
+ dir="."
+ includes="**"
+ excludes="build/**"
+ prefix="xmlbeans-${product.version}"/>
</zip>
- <tar destfile="build/private/incubating-xmlbeans-${product.version}-src.tgz"
- compression="gzip">
- <tarfileset
- dir="."
- includes="**"
- excludes="build/**"
- prefix="xmlbeans-${product.version}"/>
+ <tar destfile="build/private/incubating-xmlbeans-${product.version}-src.tgz"
+ compression="gzip">
+ <tarfileset
+ dir="."
+ includes="**"
+ excludes="build/**"
+ prefix="xmlbeans-${product.version}"/>
</tar>
</target>
@@ -318,6 +327,15 @@
<fileset dir="build/classes/piccolo"/>
<fileset dir="build/classes/tools"/>
<fileset dir="src/license"/>
+ <manifest>
+ <section name="${manifest.name}">
+ <attribute name="Comment" value="${manifest.comment}"/>
+ <attribute name="Implementation-Title" value="${manifest.title}"/>
+ <attribute name="Implementation-Version" value="${manifest.version}"/>
+ <attribute name="Implementation-Vendor" value="${manifest.vendor}"/>
+ <attribute name="Implementation-URL" value="${manifest.url}"/>
+ </section>
+ </manifest>
</jar>
</target>
@@ -356,6 +374,15 @@
<fileset dir="build/classes/xmlpublic"/>
<fileset dir="build/classes/xmlschema"/>
<fileset dir="build/classes/xsdschema"/>
+ <manifest>
+ <section name="${manifest.name}">
+ <attribute name="Comment" value="${manifest.comment}"/>
+ <attribute name="Implementation-Title" value="${manifest.title}"/>
+ <attribute name="Implementation-Version" value="${manifest.version}"/>
+ <attribute name="Implementation-Vendor" value="${manifest.vendor}"/>
+ <attribute name="Implementation-URL" value="${manifest.url}"/>
+ </section>
+ </manifest>
</jar>
</target>
@@ -651,7 +678,7 @@
<!-- =========================== -->
<target name="edit_build_script">
- <echo message="editing repackage build file: ${token} -->${replacement}"/>
+ <echo message="editing repackage build file: ${token} --> ${replacement}"/>
<java classname="repackage.EditBuildScript" failonerror="true">
<arg value="${rp_target_dir}/build.xml"/>
@@ -709,6 +736,30 @@
</antcall>
+ <!-- apply the repachage_spec on old manifest.name and get the result in new_manifest.name property -->
+ <java classpath="build/classes/repackage" classname="repackage.Repackage" failonerror="true"
+ inputstring="${manifest.name}" outputproperty="new_manifest.name">
+ <arg line="${new_repackage_arg}"/>
+ </java>
+ <!-- modify the new build script with the new property -->
+ <antcall target="edit_build_script">
+ <param name="token" value="manifest.name"/>
+ <param name="replacement" value="${new_manifest.name}"/>
+ </antcall>
+
+
+ <!-- apply the repachage_spec on old manifest.title and get the result in new_manifest.title property -->
+ <java classpath="build/classes/repackage" classname="repackage.Repackage" failonerror="true"
+ inputstring="${manifest.title}" outputproperty="new_manifest.title">
+ <arg line="${new_repackage_arg}"/>
+ </java>
+ <!-- modify the new build script with the new property -->
+ <antcall target="edit_build_script">
+ <param name="token" value="manifest.title"/>
+ <param name="replacement" value="${new_manifest.title}"/>
+ </antcall>
+
+
<!-- apply the repachage_spec on old schema_compiler and get the result in new_schema_compiler property -->
<java classpath="build/classes/repackage" classname="repackage.Repackage" failonerror="true"
inputstring="${schema_compiler}" outputproperty="new_schema_compiler">
@@ -834,8 +885,8 @@
<path id="test.compile.path">
- <pathelement location="build/classes/marshal"/>
- <pathelement location="build/classes/common"/>
+ <pathelement location="build/classes/marshal"/>
+ <pathelement location="build/classes/common"/>
<pathelement location="external/lib/junit.jar"/>
<pathelement location="build/ar/xbean.jar"/>
<pathelement location="build/lib/jsr173_api.jar"/>
1.8 +1 -1 xml-xmlbeans/v2/bin/scomp
Index: scomp
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/bin/scomp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- scomp 6 Mar 2004 22:57:31 -0000 1.7
+++ scomp 4 Nov 2004 05:24:40 -0000 1.8
@@ -12,4 +12,4 @@
;;
esac
-java -classpath $cp org.apache.xmlbeans.impl.tool.SchemaCompiler $*
+java -Xmx256m -classpath $cp org.apache.xmlbeans.impl.tool.SchemaCompiler $*
1.3 +1 -1 xml-xmlbeans/v2/docs/guide/antXmlbean.html
Index: antXmlbean.html
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/docs/guide/antXmlbean.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- antXmlbean.html 24 Feb 2004 01:17:16 -0000 1.2
+++ antXmlbean.html 4 Nov 2004 05:24:40 -0000 1.3
@@ -36,7 +36,7 @@
<p class="notepara"><b>Note:</b> This task depends on an external library not
included in the Ant distribution called xbean.jar. It can be found in
the XMLBeans developer kit at <a
- href="http://xml.apache.org/xmlbeans/" target="_blank">http://xml.apache.org/xmlbeans/</a>.
+ href="http://xmlbeans.apache.org/" target="_blank">http://xml.apache.org/xmlbeans/</a>.
The build script will need to include a taskdef for xmlbean, which could look
like this:</p>
</div>
1.5 +8 -0 xml-xmlbeans/v2/src/tools/org/apache/xmlbeans/impl/inst2xsd/Inst2Xsd.java
Index: Inst2Xsd.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/tools/org/apache/xmlbeans/impl/inst2xsd/Inst2Xsd.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Inst2Xsd.java 30 Sep 2004 21:35:13 -0000 1.4
+++ Inst2Xsd.java 4 Nov 2004 05:24:40 -0000 1.5
@@ -58,6 +58,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("verbose");
flags.add("validate");
@@ -74,6 +75,13 @@
if (cl.getOpt("license") != null)
{
CommandLine.printLicense();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.7 +6 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/CommandLine.java
Index: CommandLine.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/CommandLine.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CommandLine.java 28 Oct 2004 04:08:58 -0000 1.6
+++ CommandLine.java 4 Nov 2004 05:24:40 -0000 1.7
@@ -15,6 +15,7 @@
package org.apache.xmlbeans.impl.tool;
+import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.impl.common.IOUtil;
import java.io.File;
@@ -81,6 +82,11 @@
{
System.out.println("License available in this JAR in LICENSE.txt");
}
+ }
+
+ public static void printVersion()
+ {
+ System.out.println(XmlBeans.getVendor() + ", " + XmlBeans.getTitle() + ".XmlBeans version " + XmlBeans.getVersion());
}
private Map _options;
1.4 +8 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java
Index: FactorImports.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/FactorImports.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FactorImports.java 30 Sep 2004 21:35:13 -0000 1.3
+++ FactorImports.java 4 Nov 2004 05:24:40 -0000 1.4
@@ -67,6 +67,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
CommandLine cl = new CommandLine(args, flags, Arrays.asList(new String[] {"import", "out"}));
if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null)
@@ -89,6 +90,13 @@
if (cl.getOpt("license") != null)
{
CommandLine.printLicense();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.4 +9 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
Index: InstanceValidator.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InstanceValidator.java 30 Sep 2004 21:35:13 -0000 1.3
+++ InstanceValidator.java 4 Nov 2004 05:24:40 -0000 1.4
@@ -50,6 +50,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("dl");
flags.add("noupa");
flags.add("nopvr");
@@ -79,6 +80,14 @@
System.exit(0);
return;
}
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
+ System.exit(0);
+ return;
+ }
+
if (cl.args().length == 0)
{
return;
1.5 +8 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/PrettyPrinter.java
Index: PrettyPrinter.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/PrettyPrinter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PrettyPrinter.java 30 Sep 2004 21:35:14 -0000 1.4
+++ PrettyPrinter.java 4 Nov 2004 05:24:40 -0000 1.5
@@ -46,6 +46,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
CommandLine cl = new CommandLine(args, flags, Collections.singleton("indent"));
@@ -73,6 +74,13 @@
return;
}
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
+ System.exit(0);
+ return;
+ }
+
if (cl.args().length == 0)
{
printUsage();
1.4 +8 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/RunXQuery.java
Index: RunXQuery.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/RunXQuery.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RunXQuery.java 30 Sep 2004 21:35:14 -0000 1.3
+++ RunXQuery.java 4 Nov 2004 05:24:40 -0000 1.4
@@ -41,6 +41,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("verbose");
flags.add("pretty");
@@ -69,6 +70,13 @@
if (cl.getOpt("license") != null)
{
CommandLine.printLicense();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.18 +9 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
Index: SchemaCompiler.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SchemaCompiler.java 1 Nov 2004 04:25:58 -0000 1.17
+++ SchemaCompiler.java 4 Nov 2004 05:24:40 -0000 1.18
@@ -73,6 +73,7 @@
System.out.println(" -debug - compile with debug symbols");
System.out.println(" -quiet - print fewer informational messages");
System.out.println(" -verbose - print more informational messages");
+ System.out.println(" -version - prints version information");
System.out.println(" -license - prints license information");
System.out.println(" -allowmdef \"[ns] [ns] [ns]\" - ignores multiple defs in given namespaces");
System.out.println(" -catalog [file] - catalog file for org.apache.xml.resolver.tools.CatalogResolver. (Note: needs resolver.jar from http://xml.apache.org/commons/components/resolver/index.html)");
@@ -102,6 +103,7 @@
flags.add("license");
flags.add("quiet");
flags.add("verbose");
+ flags.add("version");
flags.add("dl");
flags.add("noupa");
flags.add("nopvr");
@@ -147,6 +149,13 @@
if (cl.getOpt("license") != null)
{
CommandLine.printLicense();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.4 +8 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java
Index: SchemaResourceManager.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaResourceManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SchemaResourceManager.java 30 Sep 2004 21:35:14 -0000 1.3
+++ SchemaResourceManager.java 4 Nov 2004 05:24:40 -0000 1.4
@@ -60,6 +60,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("sync");
flags.add("refresh");
flags.add("recurse");
@@ -87,6 +88,13 @@
if (cl.getOpt("license") != null)
{
CommandLine.printLicense();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.6 +9 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java
Index: StreamInstanceValidator.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/StreamInstanceValidator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- StreamInstanceValidator.java 1 Nov 2004 04:25:58 -0000 1.5
+++ StreamInstanceValidator.java 4 Nov 2004 05:24:40 -0000 1.6
@@ -59,6 +59,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("dl");
flags.add("noupr");
flags.add("noupa");
@@ -86,6 +87,14 @@
System.exit(0);
return;
}
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
+ System.exit(0);
+ return;
+ }
+
if (cl.args().length == 0) {
printUsage();
return;
1.4 +9 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
Index: TypeHierarchyPrinter.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TypeHierarchyPrinter.java 30 Sep 2004 21:35:14 -0000 1.3
+++ TypeHierarchyPrinter.java 4 Nov 2004 05:24:40 -0000 1.4
@@ -52,6 +52,7 @@
flags.add("help");
flags.add("usage");
flags.add("license");
+ flags.add("version");
flags.add("noanon");
flags.add("noupr");
flags.add("noupa");
@@ -80,6 +81,14 @@
System.exit(0);
return;
}
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
+ System.exit(0);
+ return;
+ }
+
if (cl.args().length == 0)
{
printUsage();
1.5 +8 -0 xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java
Index: XSTCTester.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XSTCTester.java 30 Sep 2004 21:35:14 -0000 1.4
+++ XSTCTester.java 4 Nov 2004 05:24:40 -0000 1.5
@@ -49,6 +49,7 @@
flags.add("h");
flags.add("help");
flags.add("usage");
+ flags.add("version");
flags.add("showpass");
flags.add("errcode");
@@ -58,6 +59,13 @@
if (cl.getOpt("h") != null || cl.getOpt("help") != null || cl.getOpt("usage") != null)
{
printUsage();
+ System.exit(0);
+ return;
+ }
+
+ if (cl.getOpt("version") != null)
+ {
+ CommandLine.printVersion();
System.exit(0);
return;
}
1.5 +45 -0 xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java
Index: XmlBeans.java
===================================================================
RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlpublic/org/apache/xmlbeans/XmlBeans.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XmlBeans.java 14 Sep 2004 02:01:28 -0000 1.4
+++ XmlBeans.java 4 Nov 2004 05:24:40 -0000 1.5
@@ -31,6 +31,51 @@
*/
public final class XmlBeans
{
+ private static String XMLBEANS_TITLE;
+ private static String XMLBEANS_VERSION;
+ private static String XMLBEANS_VENDOR;
+
+ static
+ {
+ Package pkg = XmlBeans.class.getPackage();
+ XMLBEANS_TITLE = pkg.getImplementationTitle();
+ XMLBEANS_VERSION = pkg.getImplementationVersion();
+ XMLBEANS_VENDOR = pkg.getImplementationVendor();
+
+ if (XMLBEANS_TITLE == null || XMLBEANS_VERSION == null || XMLBEANS_VENDOR == null)
+ throw new RuntimeException("missing manifest information");
+ }
+
+ /**
+ * Returns the XmlBeans title, "org.apache.xmlbeans".
+ * The value of
+ * <code>XmlBeans.class.getPackage().getImplementationTitle()</code>.
+ */
+ public static final String getTitle()
+ {
+ return XMLBEANS_TITLE;
+ }
+
+ /**
+ * Returns the XmlBeans vendor, "Apache Software Foundation".
+ * The value of
+ * <code>XmlBeans.class.getPackage().getImplementationVendor()</code>.
+ */
+ public static final String getVendor()
+ {
+ return XMLBEANS_VENDOR;
+ }
+
+ /**
+ * Returns the XmlBeans version, "2.0.0".
+ * The value of
+ * <code>XmlBeans.class.getPackage().getImplementationVersion()</code>.
+ */
+ public static final String getVersion()
+ {
+ return XMLBEANS_VERSION;
+ }
+
/**
* Thread local QName cache for general use
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org