You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/10/21 12:17:38 UTC
svn commit: r327144 - in /xmlgraphics/fop/trunk: build.xml
src/java/org/apache/fop/Version.java src/java/org/apache/fop/apps/Fop.java
Author: jeremias
Date: Fri Oct 21 03:17:29 2005
New Revision: 327144
URL: http://svn.apache.org/viewcvs?rev=327144&view=rev
Log:
FOP now retrieves the version information from the Manifest or from SVN information if the Manifest is not available.
Added:
xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java (with props)
Modified:
xmlgraphics/fop/trunk/build.xml
xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java
Modified: xmlgraphics/fop/trunk/build.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/build.xml?rev=327144&r1=327143&r2=327144&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/build.xml (original)
+++ xmlgraphics/fop/trunk/build.xml Fri Oct 21 03:17:29 2005
@@ -139,7 +139,7 @@
<exclude name="org/apache/fop/pdf/PDFEncryptionJCE.java" unless="jce.present"/>
</patternset>
- <property name="Name" value="Fop"/>
+ <property name="Name" value="Apache FOP"/>
<property name="name" value="fop"/>
<property name="NAME" value="FOP"/>
<property name="version" value="0.90svn"/>
@@ -437,10 +437,17 @@
<manifest>
<attribute name="Main-Class" value="org.apache.fop.cli.Main"/>
<!--attribute name="Class-Path" value="${manifest-classpath}"/-->
- <attribute name="Implementation-Title" value="${Name}"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
+ <section name="org/apache/fop/">
+ <attribute name="Specification-Title" value="XSL-FO - Extensible Stylesheet Language"/>
+ <attribute name="Specification-Version" value="1.0"/>
+ <attribute name="Specification-Vendor" value="World Wide Web Consortium"/>
+ <attribute name="Specification-URL" value="http://www.w3.org/TR/xsl"/>
+ <attribute name="Implementation-Title" value="${Name}"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
+ <attribute name="Implementation-URL" value="http://xmlgraphics.apache.org/fop/"/>
+ </section>
</manifest>
</jar>
</target>
Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java?rev=327144&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java Fri Oct 21 03:17:29 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2005 Jeremias Maerki
+ *
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop;
+
+/**
+ * This class is used to evaluate the version information contained in the Manifest of FOP's JAR.
+ * Note that this class can only find the version information if it's in the org.apache.fop package
+ * as this package equals the one specified in the manifest.
+ */
+public class Version {
+
+ /**
+ * Get the version of FOP
+ * @return the version string
+ */
+ public static String getVersion() {
+ String version = Version.class.getPackage().getImplementationVersion();
+ if (version == null) {
+ //Fallback if FOP is used in a development environment
+ String revision = "$LastChangedRevision$";
+ if (revision.indexOf(":") >= 0) {
+ revision = revision.substring(1, revision.length() - 2);
+ revision = ", revision" + revision.substring(revision.lastIndexOf(" "));
+ } else {
+ revision = "";
+ }
+ version = "SVN Trunk" + revision;
+ }
+ return version;
+ }
+
+}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java
------------------------------------------------------------------------------
svn:keywords = HeadURL Id LastChangedRevision
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java?rev=327144&r1=327143&r2=327144&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java Fri Oct 21 03:17:29 2005
@@ -156,6 +156,6 @@
* @return the version string
*/
public static String getVersion() {
- return "1.0dev";
+ return org.apache.fop.Version.getVersion();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org
Re: svn commit: r327144 - in /xmlgraphics/fop/trunk: build.xml src/java/org/apache/fop/Version.java src/java/org/apache/fop/apps/Fop.java
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Had to scratch a little itch. :-) I hope nobody minds that. Two
advantages:
- we now only have one place (build.xml) where we set the version.
- we hopefully get better feedback what version people are using when
they report a problem.
On 21.10.2005 12:17:38 jeremias wrote:
> Author: jeremias
> Date: Fri Oct 21 03:17:29 2005
> New Revision: 327144
>
> URL: http://svn.apache.org/viewcvs?rev=327144&view=rev
> Log:
> FOP now retrieves the version information from the Manifest or from SVN information if the Manifest is not available.
>
> Added:
> xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java (with props)
> Modified:
> xmlgraphics/fop/trunk/build.xml
> xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/Fop.java
<snip/>
Jeremias Maerki