lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject lucene-solr:branch_6x: SOLR-9450: The docs/ folder in the binary distribution now contains a single index.html file linking to the online documentation, reducing the size of the download
Date Thu, 23 Feb 2017 14:45:05 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 52b70c225 -> 9ecc1ec79


SOLR-9450: The docs/ folder in the binary distribution now contains a single index.html file
linking to the online documentation, reducing the size of the download


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9ecc1ec7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9ecc1ec7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9ecc1ec7

Branch: refs/heads/branch_6x
Commit: 9ecc1ec79db7ed2b7f8f7bb4ce6cf93d2ce3c382
Parents: 52b70c2
Author: Uwe Schindler <uschindler@apache.org>
Authored: Thu Feb 23 15:43:45 2017 +0100
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Thu Feb 23 15:44:49 2017 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt          |  6 ++--
 solr/README.txt           |  2 +-
 solr/build.xml            | 21 +++++++++++--
 solr/common-build.xml     | 18 ++++++++++-
 solr/site/online-link.xsl | 69 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 109 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ecc1ec7/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 4b0af9f..6d849f6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -188,6 +188,9 @@ Other Changes
 
 * SOLR-10020: Cannot reload a core if it fails initialization. (Mike Drob via Erick Erickson)
 
+* SOLR-9450: The docs/ folder in the binary distribution now contains a single index.html
file linking
+  to the online documentation, reducing the size of the download (janhoy, Shawn Heisey, Uwe
Schindler)
+
 ==================  6.4.2 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
@@ -651,7 +654,7 @@ Upgrade Notes
 
 New Features
 ----------------------
-* SOLR-5725: facet.method=enum can bypass exact counts calculation with facet.exists=true,
it just returns 1 for 
+* SOLR-5725: facet.method=enum can bypass exact counts calculation with facet.exists=true,
it just returns 1 for
   terms which exists in result docset. (Alexey Kozhemiakin, Sebastian Koziel, Radoslaw Zielinski
via Mikhail Khludnev)
 
 * SOLR-9127: Excel workbook (.xlsx) response writer. use 'wt=xlsx' (Tony Moriarty, noble)
@@ -936,7 +939,6 @@ Other Changes
 * SOLR-9371: Fix bin/solr calculations for start/stop wait time and RMI_PORT.
   (Shawn Heisey via Erick Erickson)
 
-
 ==================  6.2.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ecc1ec7/solr/README.txt
----------------------------------------------------------------------
diff --git a/solr/README.txt b/solr/README.txt
index 3e7a09c..4ef5eac 100644
--- a/solr/README.txt
+++ b/solr/README.txt
@@ -118,7 +118,7 @@ dist/solr-<component>-XX.jar
   for more information).
 
 docs/index.html
-  The Apache Solr Javadoc API documentation and Tutorial
+  A link to the online version of Apache Solr Javadoc API documentation and Tutorial
 
 
 Instructions for Building Apache Solr from Source

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ecc1ec7/solr/build.xml
----------------------------------------------------------------------
diff --git a/solr/build.xml b/solr/build.xml
index b900aed..b176585 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -209,6 +209,21 @@
       </filterchain>
     </copy>
   </target>
+  
+  <target name="documentation-online" description="Generate a link to the online documentation"
+      depends="define-solr-javadoc-url">
+    <xslt in="${ant.file}" out="${javadoc-online.dir}/index.html" style="site/online-link.xsl"
force="true">
+      <outputproperty name="method" value="html"/>
+      <outputproperty name="version" value="4.0"/>
+      <outputproperty name="encoding" value="UTF-8"/>
+      <outputproperty name="indent" value="yes"/>
+      <param name="version" expression="${version}"/>
+      <param name="solrJavadocUrl" expression="${solr.javadoc.url}"/>
+    </xslt>
+    <copy todir="${javadoc-online.dir}">
+      <fileset dir="site/assets" includes="**/solr.svg"/>
+    </copy>
+  </target>
 
   <target name="process-webpages" depends="define-lucene-javadoc-url,resolve-pegdown">
     <makeurl property="process-webpages.buildfiles" separator="|">
@@ -455,7 +470,7 @@
   <target name="prepare-release" depends="prepare-release-no-sign, sign-artifacts"/>
  
   <!-- make a distribution -->
-  <target name="package" depends="package-src-tgz,create-package,-dist-changes,-dist-keys"/>
+  <target name="package" depends="package-src-tgz,create-package,documentation,-dist-changes,-dist-keys"/>
 
   <!-- copy changes/ to the release folder -->
   <target name="-dist-changes">
@@ -545,7 +560,7 @@
       <target name="init-dist"/>
       <target name="dist"/>
       <target name="server"/>
-      <target name="documentation"/>
+      <target name="documentation-online"/>
     </antcall>
     <mkdir dir="${dest}/${fullnamever}"/>
     <delete includeemptydirs="true">
@@ -586,7 +601,7 @@
                             dist/solrj-lib/*
                             dist/test-framework/**"
                   excludes="**/*.tgz **/*.zip **/*.md5 **/*src*.jar **/*docs*.jar **/*.sha1"
/>
-      <tarfileset dir="${javadoc.dir}"
+      <tarfileset dir="${javadoc-online.dir}"
                   prefix="${fullnamever}/docs" />
     </tar>
     <make-checksums file="${package.dir}/${fullnamever}.tgz"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ecc1ec7/solr/common-build.xml
----------------------------------------------------------------------
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 8bf9db7..5e8976c 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -42,6 +42,7 @@
   <property name="server.dir" location="${common-solr.dir}/server" />
   <property name="example" location="${common-solr.dir}/example" />
   <property name="javadoc.dir" location="${dest}/docs"/>
+  <property name="javadoc-online.dir" location="${dest}/docs-online"/>
   <property name="tests.cleanthreads.sysprop" value="perClass"/>
 
   <property name="changes.target.dir" location="${dest}/docs/changes"/>
@@ -339,7 +340,7 @@
     <groovy><![CDATA[
       String url, version = properties['version'];
       String useLocalJavadocUrl = properties['useLocalJavadocUrl'];
-      if (version.contains('-SNAPSHOT') || Boolean.parseBoolean(useLocalJavadocUrl)) {
+      if (version != properties['version.base'] || Boolean.parseBoolean(useLocalJavadocUrl))
{
         url = new File(properties['common.dir'], 'build' + File.separator + 'docs').toURI().toASCIIString();
         if (!(url =~ /\/$/)) url += '/';
       } else {
@@ -351,6 +352,21 @@
     ]]></groovy>
   </target>
 
+  <target name="define-solr-javadoc-url" depends="resolve-groovy" unless="solr.javadoc.url">
+    <groovy><![CDATA[
+      String url, version = properties['version'];
+      if (version != properties['version.base']) {
+        url = '';
+        task.log('Disabled Solr Javadocs online URL for packaging (custom build / SNAPSHOT
version).');
+      } else {
+        version = version.replace('.', '_');
+        url = 'http://lucene.apache.org/solr/' + version + '/';
+        task.log('Using the following URL to refer to Solr Javadocs: ' + url);
+      }
+      properties['solr.javadoc.url'] = url;
+    ]]></groovy>
+  </target>
+
   <target name="jar-src">
     <sequential>
       <mkdir dir="${build.dir}"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ecc1ec7/solr/site/online-link.xsl
----------------------------------------------------------------------
diff --git a/solr/site/online-link.xsl b/solr/site/online-link.xsl
new file mode 100644
index 0000000..0f2fd18
--- /dev/null
+++ b/solr/site/online-link.xsl
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+  <xsl:param name="version"/>
+  <xsl:param name="solrJavadocUrl"/>
+  
+  <!--
+    NOTE: This template matches the root element of any given input XML document!
+    The XSL input file is ignored completely, but XSL expects one to be given,
+    so build.xml passes itself here. The list of module build.xmls is given via
+    string parameter, that must be splitted at '|'.
+  --> 
+  <xsl:template match="/">
+    <html>
+      <head>
+        <title><xsl:text>Apache Solr </xsl:text><xsl:value-of select="$version"/><xsl:text>
Documentation</xsl:text></title>
+        <link rel="icon" type="image/x-icon" href="images/favicon.ico"/>
+        <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"/>
+      </head>
+      <body>
+        <div>
+          <a href="http://lucene.apache.org/solr/">
+            <img src="images/solr.svg" style="width:210px; margin:22px 0px 7px 20px; border:none;"
title="Apache Solr Logo" alt="Solr" />
+          </a>
+          <div style="z-index:100;position:absolute;top:25px;left:226px">
+            <span style="font-size: x-small">TM</span>
+          </div>
+        </div>
+        <h1>
+          <xsl:text>Apache Solr</xsl:text>
+          <span style="vertical-align: top; font-size: x-small">
+            <xsl:text>TM</xsl:text>
+          </span>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="$version"/>
+          <xsl:text> Documentation</xsl:text>
+        </h1>
+        <p>
+          <xsl:choose>
+            <xsl:when test="$solrJavadocUrl">
+              <a href="{$solrJavadocUrl}">Follow this link to view online documentation
for Solr <xsl:value-of select="$version"/>.</a>
+            </xsl:when>
+            <xsl:otherwise>
+              No online documentation available for custom builds or SNAPSHOT versions. Run
<code>ant documentation</code> from <code>src.tgz</code> package to
build docs locally.
+            </xsl:otherwise>
+          </xsl:choose>
+        </p>
+      </body>
+    </html>
+  </xsl:template>
+
+</xsl:stylesheet>


Mime
View raw message