Apache Lucene open-source search software
LUCENE-9321: Port markdown task to Gradle (#1477)
Uwe Schindler06df50e759a8
diff --git a/build.gradle b/build.gradleindex 0260fe804ce..7e93c33931c 100644--- a/build.gradle+++ b/build.gradle@@ -29,6 +29,9 @@ plugins {// Project version.version = "9.0.0-SNAPSHOT"+// General metadata.+description = 'Grandparent project for Apache Lucene Core and Apache Solr'+// Propagate version and derived properties across projects.allprojects {version = rootProject.version@@ -43,6 +46,14 @@ ext {}return m[0][1]}()+ // "majorVersion" is an integer with just the major version. Compute it.+ majorVersion = {+ def m = (version =~ /^(\d+)\.\d+\.\d+(-(.+))?/)+ if (!m) {+ throw GradleException("Can't strip version to just major version: " + rootProject.version)+ }+ return m[0][1] as int+ }// Build timestamp.def tstamp = ZonedDateTime.now()@@ -58,6 +69,7 @@ ext {"javacc": "5.0","jflex": "1.7.0","jgit": "5.3.0.201903130848-r",+ "flexmark": "0.61.24",]}@@ -133,4 +145,5 @@ apply from: file('gradle/ant-compat/forbidden-api-rules-in-sync.gradle')apply from: file('gradle/documentation/documentation.gradle')apply from: file('gradle/documentation/changes-to-html.gradle')+apply from: file('gradle/documentation/markdown.gradle')apply from: file('gradle/render-javadoc.gradle')diff --git a/gradle/documentation/changes-to-html.gradle b/gradle/documentation/changes-to-html.gradleindex 8d4b6dd0980..25dee7699b6 100644--- a/gradle/documentation/changes-to-html.gradle+++ b/gradle/documentation/changes-to-html.gradle@@ -34,8 +34,6 @@ class ChangesToHtmlTask extends DefaultTask {@OutputDirectoryFile targetDir = project.file("${project.docroot}/changes")- def luceneDocUrl = "https://lucene.apache.org/core/${project.version.replace(".", "_")}/".toString()-def loadVersions(File outfile) {// load version properties from DOAP RDFdef prefix = "doap.${project.name}".toString()@@ -60,7 +58,7 @@ class ChangesToHtmlTask extends DefaultTask {project.rootProject.file("${siteDir}/changes2html.pl").toString(),"${project.name}",versionsFile.toString(),- luceneDocUrl+ project.luceneDocUrl.concat('/')]}diff --git a/gradle/documentation/documentation.gradle b/gradle/documentation/documentation.gradleindex d63569d7e95..fdc7107af93 100644--- a/gradle/documentation/documentation.gradle+++ b/gradle/documentation/documentation.gradle@@ -16,17 +16,21 @@*/configure(rootProject) {+ def urlVersion = project.baseVersion.replace('.', '_')+ def refguideUrlVersion = project.baseVersion.replaceFirst(/^(\d+)\.(\d+).*$/, '$1_$2')++ ext {+ luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', "https://lucene.apache.org/core/${urlVersion}")+ solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${urlVersion}")+ solrRefguideUrl = project.propertyOrDefault('solr.refguide.url', "https://lucene.apache.org/solr/guide/${refguideUrlVersion}")+ }+task documentation() {group = 'documentation'description = 'Generate all documentation'- dependsOn allprojects.collect { prj ->- prj.tasks.matching { task -> task.name in [- "changesToHtml",- "renderSiteJavadoc"- // TODO: "markdownToHtml"- ]}- }+ dependsOn ':lucene:documentation'+ dependsOn ':solr:documentation'}}@@ -35,4 +39,40 @@ configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {ext {docroot = file("${buildDir}/documentation")}++ task documentation() {+ group = 'documentation'+ description = "Generate ${project.name.capitalize()} documentation"++ dependsOn subprojects.collect { prj ->+ prj.tasks.matching { it.name == 'renderSiteJavadoc' }+ }+ dependsOn 'changesToHtml','copyDocumentationAssets',+ 'markdownToHtml','createDocumentationIndex'+ }++ task copyDocumentationAssets(type: Copy) {+ includeEmptyDirs = false+ from('site/html') // lucene+ from('site/assets') // solr+ into project.docroot+ }+}++configure(project(':solr')) {+ ext {+ // required for the "simple" Solr docs shipped in tgz/zip files, only referring to online web pages:+ docrootOnline = file("${buildDir}/docs-online")+ }++ documentation {+ // for Solr we also have a page shipped with zip/tgz that just points to online web pages:+ dependsOn 'copyOnlineDocumentationAssets','createOnlineDocumentationIndex'+ }++ task copyOnlineDocumentationAssets(type: Copy) {+ includeEmptyDirs = false+ from('site/assets')+ into project.docrootOnline+ }}diff --git a/gradle/documentation/markdown.gradle b/gradle/documentation/markdown.gradlenew file mode 100644index 00000000000..6e0a03bf219--- /dev/null+++ b/gradle/documentation/markdown.gradle@@ -0,0 +1,204 @@+/*+ * 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 com.vladsch.flexmark.ast.Heading;+import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension;+import com.vladsch.flexmark.ext.attributes.AttributesExtension;+import com.vladsch.flexmark.ext.autolink.AutolinkExtension;+import com.vladsch.flexmark.html.HtmlRenderer;+import com.vladsch.flexmark.parser.Parser;+import com.vladsch.flexmark.parser.ParserEmulationProfile;+import com.vladsch.flexmark.util.ast.Document;+import com.vladsch.flexmark.util.data.MutableDataSet;+import com.vladsch.flexmark.util.sequence.Escaping;+import groovy.text.SimpleTemplateEngine;++buildscript {+ repositories {+ mavenCentral()+ }++ dependencies {+ classpath "com.vladsch.flexmark:flexmark:${scriptDepVersions['flexmark']}"+ classpath "com.vladsch.flexmark:flexmark-ext-abbreviation:${scriptDepVersions['flexmark']}"+ classpath "com.vladsch.flexmark:flexmark-ext-attributes:${scriptDepVersions['flexmark']}"+ classpath "com.vladsch.flexmark:flexmark-ext-autolink:${scriptDepVersions['flexmark']}"+ }+}++configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {+ task markdownToHtml(type: Copy) {+ dependsOn copyDocumentationAssets++ filteringCharset = 'UTF-8'+ includeEmptyDirs = false+ into project.docroot+ rename(/\.md$/, '.html')+ filter(MarkdownFilter)+ }+}++configure(project(':lucene')) {+ markdownToHtml {+ from('.') {+ include 'MIGRATE.md'+ include 'JRE_VERSION_MIGRATION.md'+ include 'SYSTEM_REQUIREMENTS.md'+ }+ }++ task createDocumentationIndex(type: MarkdownTemplateTask) {+ dependsOn copyDocumentationAssets,markdownToHtml++ outputFile = file("${project.docroot}/index.html")+ templateFile = file('site/xsl/index.template.md')++ def defaultCodecFile = project(':lucene:core').file('src/java/org/apache/lucene/codecs/Codec.java')+ inputs.file(defaultCodecFile)++ // list all properties used by the template here to allow uptodate checks to be correct:+ inputs.property('version', project.version)++ binding.put('defaultCodecPackage', providers.provider{+ // static Codec defaultCodec = LOADER . lookup ( "LuceneXXX" ) ;+ def regex = ~/\bdefaultCodec\s*=\s*LOADER\s*\.\s*lookup\s*\(\s*"([^"]+)"\s*\)\s*;/+ def matcher = regex.matcher(defaultCodecFile.getText('UTF-8'))+ if (!matcher.find()) {+ throw GradleException("Cannot determine default codec from file ${defaultCodecFile}")+ }+ return matcher.group(1).toLowerCase(Locale.ROOT)+ })++ withProjectList()+ }+}++configure(project(':solr')) {+ markdownToHtml {+ from('site') {+ include '**/*.md'+ exclude '**/*.template.md'+ }+ }++ task createDocumentationIndex(type: MarkdownTemplateTask) {+ dependsOn copyDocumentationAssets,markdownToHtml++ outputFile = file("${project.docroot}/index.html")+ templateFile = file('site/index.template.md')++ // list all properties used by the template here to allow uptodate checks to be correct:+ inputs.property('version', project.version)+ inputs.property('solrRefguideUrl', project.solrRefguideUrl)+ inputs.property('luceneDocUrl', project.luceneDocUrl)++ withProjectList()+ }++ task createOnlineDocumentationIndex(type: MarkdownTemplateTask) {+ dependsOn copyOnlineDocumentationAssets++ outputFile = file("${project.docrootOnline}/index.html")+ templateFile = file('site/online-link.template.md')++ // list all properties used by the template here to allow uptodate checks to be correct:+ inputs.property('version', project.version)+ inputs.property('solrDocUrl', project.solrDocUrl)+ }+}++// filter that can be used with the "copy" task of Gradle that transforms Markdown files+// from source location to HTML (adding HTML header, styling,...)+class MarkdownFilter extends FilterReader {++ public MarkdownFilter(Reader reader) throws IOException {+ // this is not really a filter: it reads whole file in ctor,+ // converts it and provides result downstream as a StringReader+ super(new StringReader(convert(reader.text)));+ }++ public static String convert(String markdownSource) {+ // first replace LUCENE and SOLR issue numbers with a markdown link+ markdownSource = markdownSource.replaceAll(/(?s)\b(LUCENE|SOLR)\-\d+\b/,+ '[$0](https://issues.apache.org/jira/browse/$0)');++ // convert the markdown+ MutableDataSet options = new MutableDataSet();+ options.setFrom(ParserEmulationProfile.MARKDOWN);+ options.set(Parser.EXTENSIONS, [ AbbreviationExtension.create(), AutolinkExtension.create(), AttributesExtension.create() ]);+ options.set(HtmlRenderer.RENDER_HEADER_ID, true);+ options.set(HtmlRenderer.MAX_TRAILING_BLANK_LINES, 0);+ Document parsed = Parser.builder(options).build().parse(markdownSource);++ StringBuilder html = new StringBuilder('<html>\n<head>\n');+ CharSequence title = parsed.getFirstChildAny(Heading.class)?.getText();+ if (title != null) {+ html.append('<title>').append(Escaping.escapeHtml(title, false)).append('</title>\n');+ }+ html.append('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n')+ .append('</head>\n<body>\n');+ HtmlRenderer.builder(options).build().render(parsed, html);+ html.append('</body>\n</html>\n');+ return html;+ }+}++// Applies a binding of variables using a template and+// produces Markdown, which is converted to HTML+class MarkdownTemplateTask extends DefaultTask {++ @InputFile+ File templateFile++ @OutputFile+ File outputFile++ @Input+ @Optional+ final MapProperty<String,Object> binding = project.objects.mapProperty(String, Object)++ /** adds a property "projectList" containing all subprojects with javadocs as markdown bullet list */+ void withProjectList() {+ binding.put('projectList', project.providers.provider{+ def projects = project.subprojects.findAll{ it.tasks.findByName('renderSiteJavadoc')?.enabled }+ .sort(false, Comparator.comparing{ (it.name != 'core') as Boolean }+ .thenComparing(Comparator.comparing{ (it.name != 'solrj') as Boolean })+ .thenComparing(Comparator.comparing{ (it.name == 'test-framework') as Boolean })+ .thenComparing(Comparator.comparing{ it.path }));+ return projects.collect{ project ->+ def text = "**[${project.relativeDocPath.replace('/','-')}](${project.relativeDocPath}/index.html):** ${project.description}"+ if (project.name == 'core') {+ text = text.concat(' {style="font-size:larger; margin-bottom:.5em"}')+ }+ return '* ' + text;+ }.join('\n')+ })+ }++ @TaskAction+ void transform() {+ def engine = new SimpleTemplateEngine();+ def resolvedBinding = binding.get() + [+ project : project+ ]+ String markdown = templateFile.withReader('UTF-8') {+ engine.createTemplate(it).make(resolvedBinding).toString();+ }+ outputFile.getParentFile().mkdirs();+ outputFile.write(MarkdownFilter.convert(markdown), 'UTF-8');+ }+}diff --git a/gradle/render-javadoc.gradle b/gradle/render-javadoc.gradleindex 44d9b2f3532..ab5f0ae1dcd 100644--- a/gradle/render-javadoc.gradle+++ b/gradle/render-javadoc.gradle@@ -146,10 +146,10 @@ class RenderJavadocTask extends DefaultTask {def offlineLinks = [:]@Input- def luceneDocUrl = project.propertyOrDefault('lucene.javadoc.url', "https://lucene.apache.org/core/${project.baseVersion.replace(".", "_")}")+ def luceneDocUrl = project.luceneDocUrl@Input- def solrDocUrl = project.propertyOrDefault('solr.javadoc.url', "https://lucene.apache.org/solr/${project.baseVersion.replace(".", "_")}")+ def solrDocUrl = project.solrDocUrl/** Utility method to recursively collect all tasks with same name like this one that we depend on */private Set findRenderTasksInDependencies() {diff --git a/lucene/analysis/common/build.gradle b/lucene/analysis/common/build.gradleindex 397489ce6b4..ff5857bf1ba 100644--- a/lucene/analysis/common/build.gradle+++ b/lucene/analysis/common/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analyzers for indexing content in different languages and domains'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/analysis/icu/build.gradle b/lucene/analysis/icu/build.gradleindex 0630645c4ab..2eab9633077 100644--- a/lucene/analysis/icu/build.gradle+++ b/lucene/analysis/icu/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analysis integration with ICU (International Components for Unicode)'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/kuromoji/build.gradle b/lucene/analysis/kuromoji/build.gradleindex 1ca302cbdcb..af2bfa5ff93 100644--- a/lucene/analysis/kuromoji/build.gradle+++ b/lucene/analysis/kuromoji/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Japanese Morphological Analyzer'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/morfologik/build.gradle b/lucene/analysis/morfologik/build.gradleindex 69d0c900ab2..153515fa113 100644--- a/lucene/analysis/morfologik/build.gradle+++ b/lucene/analysis/morfologik/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analyzer for dictionary stemming, built-in Polish dictionary'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/nori/build.gradle b/lucene/analysis/nori/build.gradleindex 74ed1c42920..60fe3725a39 100644--- a/lucene/analysis/nori/build.gradle+++ b/lucene/analysis/nori/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Korean Morphological Analyzer'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/opennlp/build.gradle b/lucene/analysis/opennlp/build.gradleindex eb97f65f872..c4672c06abd 100644--- a/lucene/analysis/opennlp/build.gradle+++ b/lucene/analysis/opennlp/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'OpenNLP Library Integration'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/phonetic/build.gradle b/lucene/analysis/phonetic/build.gradleindex 11764a390cf..0f716e82b4a 100644--- a/lucene/analysis/phonetic/build.gradle+++ b/lucene/analysis/phonetic/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analyzer for indexing phonetic signatures (for sounds-alike search)'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/smartcn/build.gradle b/lucene/analysis/smartcn/build.gradleindex 244bbb928cd..8d5eeb1f42d 100644--- a/lucene/analysis/smartcn/build.gradle+++ b/lucene/analysis/smartcn/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analyzer for indexing Chinese'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/analysis/stempel/build.gradle b/lucene/analysis/stempel/build.gradleindex 1ca302cbdcb..3b80f9f7f88 100644--- a/lucene/analysis/stempel/build.gradle+++ b/lucene/analysis/stempel/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analyzer for indexing Polish'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/backward-codecs/build.gradle b/lucene/backward-codecs/build.gradleindex 2d39e12a59c..aa4730207eb 100644--- a/lucene/backward-codecs/build.gradle+++ b/lucene/backward-codecs/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Codecs for older versions of Lucene'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/benchmark/build.gradle b/lucene/benchmark/build.gradleindex 52b54d9fe69..ee98e6e5856 100644--- a/lucene/benchmark/build.gradle+++ b/lucene/benchmark/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'System for benchmarking Lucene'+dependencies {api project(':lucene:core')diff --git a/lucene/build.gradle b/lucene/build.gradleindex 1efd5f4d6a0..1c71edb190b 100644--- a/lucene/build.gradle+++ b/lucene/build.gradle@@ -15,6 +15,8 @@* limitations under the License.*/+description = 'Parent project for Apache Lucene Core'+subprojects {group "org.apache.lucene"}\ No newline at end of filediff --git a/lucene/classification/build.gradle b/lucene/classification/build.gradleindex 19c9ae7cc20..736dfb305a7 100644--- a/lucene/classification/build.gradle+++ b/lucene/classification/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Classification module for Lucene'+dependencies {api project(':lucene:core')diff --git a/lucene/codecs/build.gradle b/lucene/codecs/build.gradleindex e39f2724af4..ad26aae2d94 100644--- a/lucene/codecs/build.gradle+++ b/lucene/codecs/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Lucene codecs and postings formats'+dependencies {implementation project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/core/build.gradle b/lucene/core/build.gradleindex f5609bdb703..989c57f0935 100644--- a/lucene/core/build.gradle+++ b/lucene/core/build.gradle@@ -15,9 +15,10 @@* limitations under the License.*/-apply plugin: 'java-library'+description = 'Lucene core library'+dependencies {testImplementation project(':lucene:codecs')testImplementation project(':lucene:test-framework')diff --git a/lucene/demo/build.gradle b/lucene/demo/build.gradleindex 2871774bbf8..8407fa6b5d6 100644--- a/lucene/demo/build.gradle+++ b/lucene/demo/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Simple example code for Apache Lucene'+dependencies {implementation project(':lucene:core')implementation project(':lucene:facet')diff --git a/lucene/expressions/build.gradle b/lucene/expressions/build.gradleindex 62d197830e7..7ba76a7f3a9 100644--- a/lucene/expressions/build.gradle+++ b/lucene/expressions/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Dynamically computed values to sort/facet/search on based on a pluggable grammar'+dependencies {api project(':lucene:core')diff --git a/lucene/facet/build.gradle b/lucene/facet/build.gradleindex c0ffc91e929..6b6a6ef137e 100644--- a/lucene/facet/build.gradle+++ b/lucene/facet/build.gradle@@ -18,6 +18,7 @@apply plugin: 'java-library'+description = 'Faceted indexing and search capabilities'dependencies {api project(':lucene:core')diff --git a/lucene/grouping/build.gradle b/lucene/grouping/build.gradleindex b18d3d9cf4d..b0838e3dfd2 100644--- a/lucene/grouping/build.gradle+++ b/lucene/grouping/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Collectors for grouping search results'+dependencies {api project(':lucene:core')diff --git a/lucene/highlighter/build.gradle b/lucene/highlighter/build.gradleindex f369aef62c0..6e105d59b6e 100644--- a/lucene/highlighter/build.gradle+++ b/lucene/highlighter/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Highlights search keywords in results'+dependencies {api project(':lucene:core')diff --git a/lucene/join/build.gradle b/lucene/join/build.gradleindex eab86224587..143daa13711 100644--- a/lucene/join/build.gradle+++ b/lucene/join/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Index-time and Query-time joins for normalized content'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/luke/build.gradle b/lucene/luke/build.gradleindex aaa0d7336d9..6e32b1b35a5 100644--- a/lucene/luke/build.gradle+++ b/lucene/luke/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Luke - Lucene Toolbox'+dependencies {api project(':lucene:core')diff --git a/lucene/memory/build.gradle b/lucene/memory/build.gradleindex a52f88cdbcd..0d3bc1f7b03 100644--- a/lucene/memory/build.gradle+++ b/lucene/memory/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Single-document in-memory index implementation'+dependencies {api project(':lucene:core')diff --git a/lucene/misc/build.gradle b/lucene/misc/build.gradleindex eab86224587..bdf575df562 100644--- a/lucene/misc/build.gradle+++ b/lucene/misc/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Index tools and other miscellaneous code'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/monitor/build.gradle b/lucene/monitor/build.gradleindex cc30dbed8af..3dd65a4da7a 100644--- a/lucene/monitor/build.gradle+++ b/lucene/monitor/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Reverse-search implementation for monitoring and classification'+dependencies {api project(':lucene:core')diff --git a/lucene/queries/build.gradle b/lucene/queries/build.gradleindex 199b39b9f20..64c2bf41dad 100644--- a/lucene/queries/build.gradle+++ b/lucene/queries/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Filters and Queries that add to core Lucene'+dependencies {api project(':lucene:core')diff --git a/lucene/queryparser/build.gradle b/lucene/queryparser/build.gradleindex 9b01271df8b..077eb245bc8 100644--- a/lucene/queryparser/build.gradle+++ b/lucene/queryparser/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Query parsers and parsing framework'+dependencies {api project(':lucene:core')api project(':lucene:queries')diff --git a/lucene/replicator/build.gradle b/lucene/replicator/build.gradleindex 7e389e9dce4..32d5cc78732 100644--- a/lucene/replicator/build.gradle+++ b/lucene/replicator/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Lucene index files replication utility'+dependencies {api project(':lucene:core')diff --git a/lucene/sandbox/build.gradle b/lucene/sandbox/build.gradleindex 5543dec15bb..ec2d9ca8056 100644--- a/lucene/sandbox/build.gradle+++ b/lucene/sandbox/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Various third party contributions and new ideas'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/site/xsl/index.template.md b/lucene/site/xsl/index.template.mdnew file mode 100644index 00000000000..22447add342--- /dev/null+++ b/lucene/site/xsl/index.template.md@@ -0,0 +1,50 @@+++# Apache Lucene™ ${project.version} Documentation++Lucene is a Java full-text search engine. Lucene is not a complete application,+but rather a code library and API that can easily be used to add search capabilities+to applications.++This is the official documentation for **Apache Lucene ${project.version}**.+Additional documentation is available in the+[Wiki](https://cwiki.apache.org/confluence/display/lucene).++## Getting Started++The following section is intended as a "getting started" guide. It has three+audiences: first-time users looking to install Apache Lucene in their+application; developers looking to modify or base the applications they develop+on Lucene; and developers looking to become involved in and contribute to the+development of Lucene. The goal is to help you "get started". It does not go into great depth+on some of the conceptual or inner details of Lucene:++* [Lucene demo, its usage, and sources](demo/overview-summary.html#overview.description):+ Tutorial and walk-through of the command-line Lucene demo.+* [Introduction to Lucene's APIs](core/overview-summary.html#overview.description):+ High-level summary of the different Lucene packages. </li>+* [Analysis overview](core/org/apache/lucene/analysis/package-summary.html#package.description):+ Introduction to Lucene's analysis API. See also the+ [TokenStream consumer workflow](core/org/apache/lucene/analysis/TokenStream.html).++## Reference Documents++* [Changes](changes/Changes.html): List of changes in this release.+* [System Requirements](SYSTEM_REQUIREMENTS.html): Minimum and supported Java versions.+* [Migration Guide](MIGRATE.html): What changed in Lucene ${project.majorVersion()}; how to migrate code from+ Lucene ${project.majorVersion()-1}.x.+* [JRE Version Migration](JRE_VERSION_MIGRATION.html): Information about upgrading between major JRE versions.+* [File Formats](core/org/apache/lucene/codecs/${defaultCodecPackage}/package-summary.html#package.description):+ Guide to the supported index format used by Lucene. This can be customized by using+ [an alternate codec](core/org/apache/lucene/codecs/package-summary.html#package.description).+* [Search and Scoring in Lucene](core/org/apache/lucene/search/package-summary.html#package.description):+ Introduction to how Lucene scores documents.+* [Classic Scoring Formula](core/org/apache/lucene/search/similarities/TFIDFSimilarity.html):+ Formula of Lucene's classic [Vector Space](https://en.wikipedia.org/wiki/Vector_Space_Model) implementation+ (look [here](core/org/apache/lucene/search/similarities/package-summary.html#package.description) for other models).+* [Classic QueryParser Syntax](queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description):+ Overview of the Classic QueryParser's syntax and features.++## API Javadocs++${projectList}diff --git a/lucene/site/xsl/index.xsl b/lucene/site/xsl/index.xslindex 88c93efd2a7..b3be85f79b5 100644--- a/lucene/site/xsl/index.xsl+++ b/lucene/site/xsl/index.xsl@@ -55,7 +55,7 @@<p>This is the official documentation for <b><xsl:text>Apache Lucene </xsl:text><xsl:value-of select="$version"/></b>. Additional documentation is available in the- <a href="http://wiki.apache.org/lucene-java">Wiki</a>.+ <a href="https://cwiki.apache.org/confluence/display/lucene">Wiki</a>.</p><h2>Getting Started</h2><p>The following section is intended as a "getting started" guide. It has three@@ -77,11 +77,11 @@<ul><li><a href="changes/Changes.html">Changes</a>: List of changes in this release.</li><li><a href="SYSTEM_REQUIREMENTS.html">System Requirements</a>: Minimum and supported Java versions.</li>- <li><a href="MIGRATE.html">Migration Guide</a>: What changed in Lucene 8; how to migrate code from Lucene 7.x.</li>+ <li><a href="MIGRATE.html">Migration Guide</a>: What changed in Lucene 9; how to migrate code from Lucene 8.x.</li><li><a href="JRE_VERSION_MIGRATION.html">JRE Version Migration</a>: Information about upgrading between major JRE versions.</li><li><a href="core/org/apache/lucene/codecs/{$defaultCodecPackage}/package-summary.html#package.description">File Formats</a>: Guide to the supported index format used by Lucene. This can be customized by using <a href="core/org/apache/lucene/codecs/package-summary.html#package.description">an alternate codec</a>.</li><li><a href="core/org/apache/lucene/search/package-summary.html#package.description">Search and Scoring in Lucene</a>: Introduction to how Lucene scores documents.</li>- <li><a href="core/org/apache/lucene/search/similarities/TFIDFSimilarity.html">Classic Scoring Formula</a>: Formula of Lucene's classic <a href="http://en.wikipedia.org/wiki/Vector_Space_Model">Vector Space</a> implementation. (look <a href="core/org/apache/lucene/search/similarities/package-summary.html#package.description">here</a> for other models)</li>+ <li><a href="core/org/apache/lucene/search/similarities/TFIDFSimilarity.html">Classic Scoring Formula</a>: Formula of Lucene's classic <a href="https://en.wikipedia.org/wiki/Vector_Space_Model">Vector Space</a> implementation. (look <a href="core/org/apache/lucene/search/similarities/package-summary.html#package.description">here</a> for other models)</li><li><a href="queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description">Classic QueryParser Syntax</a>: Overview of the Classic QueryParser's syntax and features.</li></ul><h2>API Javadocs</h2>diff --git a/lucene/spatial-extras/build.gradle b/lucene/spatial-extras/build.gradleindex 3994385e835..2766f7b34a5 100644--- a/lucene/spatial-extras/build.gradle+++ b/lucene/spatial-extras/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Geospatial search'+dependencies {api project(':lucene:core')api project(':lucene:spatial3d')diff --git a/lucene/spatial3d/build.gradle b/lucene/spatial3d/build.gradleindex eab86224587..415981b5360 100644--- a/lucene/spatial3d/build.gradle+++ b/lucene/spatial3d/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = '3D spatial planar geometry APIs'+dependencies {api project(':lucene:core')testImplementation project(':lucene:test-framework')diff --git a/lucene/suggest/build.gradle b/lucene/suggest/build.gradleindex 74ed1c42920..54a559624da 100644--- a/lucene/suggest/build.gradle+++ b/lucene/suggest/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Auto-suggest and Spellchecking support'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/lucene/test-framework/build.gradle b/lucene/test-framework/build.gradleindex 5abf89d9c77..4b0cadee4bf 100644--- a/lucene/test-framework/build.gradle+++ b/lucene/test-framework/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Framework for testing Lucene-based applications'+dependencies {api project(':lucene:core')diff --git a/solr/build.gradle b/solr/build.gradleindex 148c8e8f968..9edc4d1aa2c 100644--- a/solr/build.gradle+++ b/solr/build.gradle@@ -15,6 +15,8 @@* limitations under the License.*/+description = 'Parent project for Apache Solr'+subprojects {group "org.apache.solr"}\ No newline at end of filediff --git a/solr/build.xml b/solr/build.xmlindex b0ff51149ed..c3cf6bc6a13 100644--- a/solr/build.xml+++ b/solr/build.xml@@ -207,7 +207,7 @@</xslt><markdown todir="${javadoc.dir}">- <fileset dir="site" includes="**/*.md"/>+ <fileset dir="site" includes="**/*.md" excludes="**/*.template.md"/><globmapper from="*.md" to="*.html"/></markdown>diff --git a/solr/contrib/analysis-extras/build.gradle b/solr/contrib/analysis-extras/build.gradleindex 1a3a4233036..c39629a7bee 100644--- a/solr/contrib/analysis-extras/build.gradle+++ b/solr/contrib/analysis-extras/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Additional analysis components'+dependencies {api project(':solr:core')diff --git a/solr/contrib/analytics/build.gradle b/solr/contrib/analytics/build.gradleindex 9f975d25bcf..91e165ab2e4 100644--- a/solr/contrib/analytics/build.gradle+++ b/solr/contrib/analytics/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Analytics Package'+dependencies {implementation project(':solr:core')testImplementation project(':solr:test-framework')diff --git a/solr/contrib/clustering/build.gradle b/solr/contrib/clustering/build.gradleindex e939a297d0f..d308d2dc80a 100644--- a/solr/contrib/clustering/build.gradle+++ b/solr/contrib/clustering/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Clustering Integraton'+dependencies {implementation project(':solr:core')implementation project(':lucene:analysis:common')diff --git a/solr/contrib/dataimporthandler-extras/build.gradle b/solr/contrib/dataimporthandler-extras/build.gradleindex 2207224e190..fde00c3cec8 100644--- a/solr/contrib/dataimporthandler-extras/build.gradle+++ b/solr/contrib/dataimporthandler-extras/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Data Import Handler Extras'+dependencies {implementation project(':solr:core')diff --git a/solr/contrib/dataimporthandler/build.gradle b/solr/contrib/dataimporthandler/build.gradleindex 403a11d07fc..9286d4317b6 100644--- a/solr/contrib/dataimporthandler/build.gradle+++ b/solr/contrib/dataimporthandler/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Data Import Handler'+dependencies {implementation project(':solr:core')diff --git a/solr/contrib/extraction/build.gradle b/solr/contrib/extraction/build.gradleindex 6bb8684617f..20f07bfbc35 100644--- a/solr/contrib/extraction/build.gradle+++ b/solr/contrib/extraction/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Solr Integration with Tika for extracting content from binary file formats such as Microsoft Word and Adobe PDF'+dependencies {implementation project(':solr:core')diff --git a/solr/contrib/jaegertracer-configurator/build.gradle b/solr/contrib/jaegertracer-configurator/build.gradleindex bcbb3f6c06b..d2094b1bc34 100644--- a/solr/contrib/jaegertracer-configurator/build.gradle+++ b/solr/contrib/jaegertracer-configurator/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Jaeger tracer configurator for tracing Solr using OpenTracing with Jaeger backend'+dependencies {implementation project(':solr:core')diff --git a/solr/contrib/langid/build.gradle b/solr/contrib/langid/build.gradleindex 8ca54bf187f..f9cfdb73e3e 100644--- a/solr/contrib/langid/build.gradle+++ b/solr/contrib/langid/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Language Identifier contrib for extracting language from a document being indexed'+dependencies {implementation project(':solr:core')diff --git a/solr/contrib/ltr/build.gradle b/solr/contrib/ltr/build.gradleindex 98908fac007..f3288d98665 100644--- a/solr/contrib/ltr/build.gradle+++ b/solr/contrib/ltr/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Learning to Rank Package'+dependencies {implementation project(':solr:core')implementation project(':lucene:analysis:common')diff --git a/solr/contrib/prometheus-exporter/build.gradle b/solr/contrib/prometheus-exporter/build.gradleindex c2fa1bdd903..13a9748bc44 100644--- a/solr/contrib/prometheus-exporter/build.gradle+++ b/solr/contrib/prometheus-exporter/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Prometheus exporter for exposing metrics from Solr using Metrics API and Search API'+dependencies {implementation project(':solr:core')implementation project(':lucene:analysis:common')diff --git a/solr/contrib/velocity/build.gradle b/solr/contrib/velocity/build.gradleindex b824433beed..b17b38be9f6 100644--- a/solr/contrib/velocity/build.gradle+++ b/solr/contrib/velocity/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Solr Velocity Response Writer'+dependencies {implementation project(':solr:core')diff --git a/solr/core/build.gradle b/solr/core/build.gradleindex 8c7a414f0c0..6e9a06824b1 100644--- a/solr/core/build.gradle+++ b/solr/core/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Apache Solr Core'+dependencies {api project(':lucene:core')api project(':lucene:analysis:common')diff --git a/solr/example/build.gradle b/solr/example/build.gradleindex c948ee35947..3b6b3d16eed 100644--- a/solr/example/build.gradle+++ b/solr/example/build.gradle@@ -19,6 +19,8 @@// I am not convinced packaging of examples should be a separate project... Seems more logical to// move it to just the packaging project (?). Let's leave it for now though.+description = 'Solr examples'+configurations {packagingpostJardiff --git a/solr/packaging/build.gradle b/solr/packaging/build.gradleindex e45c3081fb0..55b78ca0182 100644--- a/solr/packaging/build.gradle+++ b/solr/packaging/build.gradle@@ -15,7 +15,6 @@* limitations under the License.*/-// This project puts together a "distribution", assembling dependencies from// various other projects.@@ -23,6 +22,8 @@ plugins {id 'base'}+description = 'Solr packaging'+ext {distDir = file("$buildDir/solr-${version}")devDir = file("$buildDir/dev")diff --git a/solr/server/build.gradle b/solr/server/build.gradleindex 5a74f3d10ef..371c5ce456f 100644--- a/solr/server/build.gradle+++ b/solr/server/build.gradle@@ -17,6 +17,8 @@apply plugin: 'java-library'+description = 'Solr Server'+configurations {api {exclude group: "org.slf4j"diff --git a/solr/site/index.template.md b/solr/site/index.template.mdnew file mode 100644index 00000000000..d961c23f200--- /dev/null+++ b/solr/site/index.template.md@@ -0,0 +1,37 @@+<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>++# Apache Solr™ ${project.version} Documentation++Solr is the popular, blazing fast, open source NoSQL search platform from the Apache Lucene project. Its major+features include powerful full-text search, hit highlighting, faceted search and analytics, rich document+parsing, geospatial search, extensive REST APIs as well as parallel SQL. Solr is enterprise grade, secure and+highly scalable, providing fault tolerant distributed search and indexing, and powers the search and navigation+features of many of the world's largest internet sites.++Solr is written in Java and runs as a standalone full-text search server. Solr uses the Lucene Java search+library at its core for full-text indexing and search, and has REST-like JSON APIs that make it easy to use+from virtually any programming language. Solr's powerful configuration APIs and files allows it to be tailored+to almost any type of application without Java coding, and it has an extensive plugin architecture when more+advanced customization is required.++This is the official documentation for **Apache Solr ${project.version}**.++## Reference Documents++* [Reference Guide](${project.solrRefguideUrl}/): The main documentation for Solr+* [Changes](changes/Changes.html): List of changes in this release+* [System Requirements](SYSTEM_REQUIREMENTS.html): Minimum and supported Java versions+* [Solr Tutorial](${project.solrRefguideUrl}/solr-tutorial.html):+ This document covers the basics of running Solr using an example schema, and some sample data+* [Lucene Documentation](${project.luceneDocUrl}/index.html)++## API Javadocs++${projectList}diff --git a/solr/site/online-link.template.md b/solr/site/online-link.template.mdnew file mode 100644index 00000000000..1ea7142d052--- /dev/null+++ b/solr/site/online-link.template.md@@ -0,0 +1,19 @@+<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>++# Apache Solr™ ${project.version} Documentation++<%+if ("${project.version}" == "${project.baseVersion}") { // compare as strings because of lazy evaluation+ println "Follow [this link to view online documentation](${project.solrDocUrl}) for Apache Solr ${project.version}."+} else {+ println "No online documentation available for custom builds or `SNAPSHOT` versions."+ println "Run `gradlew documentation` from `src.tgz` package to build docs locally."+}+%>diff --git a/solr/solr-ref-guide/build.gradle b/solr/solr-ref-guide/build.gradleindex 50f056ad2d6..f61a9e0d134 100644--- a/solr/solr-ref-guide/build.gradle+++ b/solr/solr-ref-guide/build.gradle@@ -52,6 +52,8 @@ plugins {id 'com.github.jruby-gradle.base' version '2.0.0-alpha.7'}+description = 'Solr reference guide'+// Use an internal proxy to ruby gems.repositories {ruby.gems()diff --git a/solr/solrj/build.gradle b/solr/solrj/build.gradleindex eb85711e2f0..e8c8a072d05 100644--- a/solr/solrj/build.gradle+++ b/solr/solrj/build.gradle@@ -18,6 +18,8 @@apply plugin: 'java-library'+description = 'Solrj - Solr Java Client'+dependencies {api 'org.slf4j:slf4j-api'implementation 'org.slf4j:jcl-over-slf4j'diff --git a/solr/test-framework/build.gradle b/solr/test-framework/build.gradleindex b6cbdbad60f..62a724c506d 100644--- a/solr/test-framework/build.gradle+++ b/solr/test-framework/build.gradle@@ -15,9 +15,10 @@* limitations under the License.*/-apply plugin: 'java-library'+description = 'Solr Test Framework'+dependencies {api project(':solr:core')api project(':solr:solrj')diff --git a/solr/webapp/build.gradle b/solr/webapp/build.gradleindex df875b7ea7c..a687fdb38ce 100644--- a/solr/webapp/build.gradle+++ b/solr/webapp/build.gradle@@ -20,6 +20,8 @@ plugins {id 'war'}+description = 'Solr webapp'+configurations {war {}}