[maven-doxia] Update to upstream version 1.5

Michael Šimáček msimacek at fedoraproject.org
Wed Dec 11 08:29:00 UTC 2013


commit 788126fd2a4e084b932f077f0e0d94b247dc3345
Author: Michael Simacek <msimacek at redhat.com>
Date:   Tue Dec 10 17:27:59 2013 +0100

    Update to upstream version 1.5

 .gitignore            |    1 +
 RenderingContext.java |  194 +++++++++++++++++++++++++++++++++++++++++++++++++
 maven-doxia.spec      |   21 ++++-
 sources               |    2 +-
 4 files changed, 213 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1a0b595..009f80a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ maven-doxia-1.1.2.tar.gz
 /doxia-1.2-source-release.zip
 /doxia-1.3-source-release.zip
 /doxia-1.4-source-release.zip
+/doxia-1.5-source-release.zip
diff --git a/RenderingContext.java b/RenderingContext.java
new file mode 100644
index 0000000..4523231
--- /dev/null
+++ b/RenderingContext.java
@@ -0,0 +1,194 @@
+package org.apache.maven.doxia.sink.render;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.codehaus.plexus.util.PathTool;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * The rendering context of a document.
+ *
+ * @author <a href="mailto:jason at maven.org">Jason van Zyl</a>
+ * @version $Id: RenderingContext.java 1090706 2011-04-09 23:15:28Z hboutemy $
+ * @since 1.1
+ */
+public class RenderingContext
+{
+    private final File basedir;
+
+    private final String inputName;
+
+    private final String outputName;
+
+    private final String parserId;
+
+    private final String relativePath;
+
+    private final String extension;
+
+    private Map<String, String> attributes;
+
+    /**
+     * <p>Constructor for RenderingContext.</p>
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @param document a {@link java.lang.String} object.
+     */
+    public RenderingContext( File basedir, String document )
+    {
+        this( basedir, document, null );
+    }
+
+    /**
+     * <p>Constructor for RenderingContext.</p>
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @param document a {@link java.lang.String} object.
+     * @param parserId a {@link java.lang.String} object.
+     */
+    public RenderingContext( File basedir, String document, String parserId )
+    {
+        this( basedir, document, parserId, null );
+
+    }
+
+    /**
+     * <p>Constructor for RenderingContext.</p>
+     *
+     * @param basedir a {@link java.io.File} object.
+     * @param document a {@link java.lang.String} object.
+     * @param parserId a {@link java.lang.String} object.
+     * @param extension a {@link java.lang.String} object.
+     */
+    public RenderingContext( File basedir, String document, String parserId, String extension )
+    {
+        this.basedir = basedir;
+        this.extension = extension;
+        if ( StringUtils.isNotEmpty( extension ) )
+        {
+            // here we now the parserId we can play with this
+            // index.xml -> index.html
+            // index.xml.vm -> index.html
+            // download.apt.vm --> download.html
+            int startIndexOfExtension =
+                document.toLowerCase( Locale.ENGLISH ).indexOf( "." + extension.toLowerCase( Locale.ENGLISH ) );
+            String fileNameWithoutExt = document.substring( 0, startIndexOfExtension );
+            this.outputName = fileNameWithoutExt + ".html";
+        }
+        else
+        {
+            this.outputName = document.substring( 0, document.indexOf( '.' ) ).replace( '\\', '/' ) + ".html";
+        }
+        this.relativePath = PathTool.getRelativePath( basedir.getPath(), new File( basedir, document ).getPath() );
+
+        this.inputName = document;
+
+        this.parserId = parserId;
+
+        this.attributes = new HashMap<String, String>();
+    }
+
+    /**
+     * <p>Getter for the field <code>basedir</code>.</p>
+     *
+     * @return a {@link java.io.File} object.
+     */
+    public File getBasedir()
+    {
+        return basedir;
+    }
+
+    /**
+     * <p>Getter for the field <code>inputName</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getInputName()
+    {
+        return inputName;
+    }
+
+    /**
+     * <p>Getter for the field <code>outputName</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getOutputName()
+    {
+        return outputName;
+    }
+
+    /**
+     * <p>Getter for the field <code>parserId</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getParserId()
+    {
+        return parserId;
+    }
+
+    /**
+     * <p>Getter for the field <code>relativePath</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getRelativePath()
+    {
+        return relativePath;
+    }
+
+    /**
+     * <p>setAttribute.</p>
+     *
+     * @param key a {@link java.lang.String} object.
+     * @param value a {@link java.lang.String} object.
+     */
+    public void setAttribute( String key, String value )
+    {
+        attributes.put( key, value );
+    }
+
+    /**
+     * <p>getAttribute.</p>
+     *
+     * @param key a {@link java.lang.String} object.
+     * @return a {@link java.lang.String} object.
+     */
+    public String getAttribute( String key )
+    {
+        return (String) attributes.get( key );
+    }
+
+    /**
+     * <p>Getter for the field <code>extension</code>.</p>
+     *
+     * @return a {@link java.lang.String} object.
+     */
+    public String getExtension()
+    {
+        return extension;
+    }
+}
diff --git a/maven-doxia.spec b/maven-doxia.spec
index 91b3aa9..a885243 100644
--- a/maven-doxia.spec
+++ b/maven-doxia.spec
@@ -34,8 +34,8 @@
 %endif
 
 Name:           maven-doxia
-Version:        1.4
-Release:        6%{?dist}
+Version:        1.5
+Release:        1%{?dist}
 Epoch:          0
 Summary:        Content generation framework
 License:        ASL 2.0
@@ -44,6 +44,13 @@ URL:            http://maven.apache.org/doxia/
 
 Source0:        http://repo2.maven.org/maven2/org/apache/maven/doxia/doxia/%{version}/doxia-%{version}-source-release.zip
 
+# Class used only by dependent packages that was moved to doxia-sitetools in
+# previous release. But doxia-sitetools doesn't have 1.5 release so putting it
+# back otherwise it would break all doxia dependent packages.
+# Please remove it as soon as new doxia-sitetools containing this class is
+# released
+Source1:        RenderingContext.java
+
 
 # abstract class should not be annotated as component because maven
 # will pick it up and try to instantiate
@@ -251,6 +258,9 @@ API documentation for %{name}.
 %patch3 -p1
 %patch4 -p1
 
+mkdir doxia-core/src/main/java/org/apache/maven/doxia/sink/render
+cp -p %SOURCE1 doxia-core/src/main/java/org/apache/maven/doxia/sink/render/
+
 # we don't have clirr-maven-plugin
 %pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin pom.xml
 
@@ -269,8 +279,6 @@ API documentation for %{name}.
 %endif
 
 %build
-# tests disabled because some use old plexus-container and don't work
-# with new
 %mvn_build -s
 
 %install
@@ -308,6 +316,11 @@ API documentation for %{name}.
 
 
 %changelog
+* Tue Dec 10 2013 Michael Simacek <msimacek at redhat.com> - 0:1.5-1
+- Update to upstream version 1.5
+- Move back RenderingContext.java that was moved to doxia-sitetools which
+  doesn't have a release yet
+
 * Thu Dec  5 2013 Mikolaj Izdebski <mizdebsk at redhat.com> - 0:1.4-6
 - BuildRequire plexus-containers-container-default 1.5.5-14
 - Resolves: rhbz#1036584
diff --git a/sources b/sources
index ca752f0..a6cacf2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b7ebf0fc2678710dcf4b45a6991732d0  doxia-1.4-source-release.zip
+4b9a6b8d0cb1c92afac3cd3b6a9c3dcf  doxia-1.5-source-release.zip


More information about the scm-commits mailing list