Skip to content

Commit 047e14d

Browse files
authored
packaging: Remove docs/ from the Solr binary distribution (apache#4641)
And add online links to README.txt
1 parent 86bd520 commit 047e14d

7 files changed

Lines changed: 32 additions & 90 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: >
2+
Remove docs/ from the Solr binary distribution. Add online links to such in README.txt
3+
type: other
4+
authors:
5+
- name: David Smiley
6+
links:
7+
- name: PR#4641
8+
url: https://github.com/apache/solr/pull/4641

dev-tools/scripts/smokeTestRelease.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,9 @@ def verifyBinaryUnpacked(java, artifact, unpackPath, version, gitRevision):
679679
is_in_list(in_root_folder, ['LICENSE.txt', 'NOTICE.txt', 'README.txt', 'CHANGELOG.md'])
680680

681681
if isSlim:
682-
is_in_list(in_root_folder, ['bin', 'docker', 'docs', 'example', 'licenses', 'server', 'lib'])
682+
is_in_list(in_root_folder, ['bin', 'docker', 'example', 'licenses', 'server', 'lib'])
683683
else:
684-
is_in_list(in_root_folder, ['bin', 'modules', 'cross-dc-manager', 'docker', 'docs', 'example', 'licenses', 'server', 'lib'])
684+
is_in_list(in_root_folder, ['bin', 'modules', 'cross-dc-manager', 'docker', 'example', 'licenses', 'server', 'lib'])
685685

686686
if len(in_root_folder) > 0:
687687
raise RuntimeError('solr: unexpected files/dirs in artifact %s: %s' % (artifact, in_root_folder))

gradle/documentation/documentation.gradle

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@ configure(rootProject) {
4747
group = 'documentation'
4848
description = 'Generate all documentation'
4949

50-
dependsOn ':solr:documentation:assemble'
50+
dependsOn ':solr:documentation:documentation'
5151
}
52-
53-
assemble.dependsOn documentation
5452
}
5553

5654
// docroot will point to Lucene and Solr relative directory for each sub-project.
5755
configure(project(':solr:documentation')) {
5856
ext {
5957
docroot = file("${buildDir}/site")
60-
docrootMinimal = file("${buildDir}/minimalSite")
6158

6259
markdownSrc = file("src/markdown")
6360
assets = file("src/assets")
@@ -80,62 +77,22 @@ configure(project(':solr:documentation')) {
8077
into project.docroot
8178
}
8279

83-
assemble {
84-
dependsOn documentation
85-
}
86-
8780
configurations {
88-
site
81+
// Not part of 'assemble': only built on demand (e.g. by the release process or the ref guide build).
82+
site {
83+
visible = false
84+
}
8985
}
9086

9187
artifacts {
9288
site project.docroot, {
9389
builtBy documentation
9490
}
9591
}
96-
97-
task documentationMinimal() {
98-
group = 'documentation'
99-
description = "Generate stub Solr documentation pointing to web page (that's part of Solr TGZ)"
100-
dependsOn 'copyMiniDocumentationAssets',
101-
'createMiniDocumentationIndex',
102-
'copyChangesToHtmlForMiniSite'
103-
}
104-
105-
task copyChangesToHtmlForMiniSite(type: Copy) {
106-
dependsOn 'copyDocumentationAssets'
107-
dependsOn 'markdownToHtml'
108-
109-
from project.docroot
110-
into project.docrootMinimal
111-
include 'changes/**'
112-
dependsOn 'changesToHtml'
113-
}
114-
115-
task copyMiniDocumentationAssets(type: Copy) {
116-
includeEmptyDirs = false
117-
from('src/assets')
118-
into project.docrootMinimal
119-
}
120-
121-
assemble {
122-
dependsOn documentationMinimal
123-
}
124-
125-
configurations {
126-
minimalSite
127-
}
128-
129-
artifacts {
130-
minimalSite project.docrootMinimal, {
131-
builtBy documentationMinimal
132-
}
133-
}
13492
}
13593

13694
configure(project(":solr")) {
13795
ext {
13896
docroot = project('documentation').docroot
139-
docrootMinimal = project('documentation').docrootMinimal
14097
}
14198
}

gradle/documentation/markdown.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ configure(project(':solr:documentation')) {
7373

7474
withProjectList()
7575
}
76-
77-
task createMiniDocumentationIndex(type: MarkdownTemplateTask) {
78-
outputFile = file("${project.docrootMinimal}/index.html")
79-
templateFile = file("${project.markdownSrc}/online-link.template.md")
80-
81-
// list all properties used by the template here to allow uptodate checks to be correct:
82-
inputs.property('version', project.version)
83-
inputs.property('solrDocUrl', project.solrDocUrl).optional(true)
84-
}
8576
}
8677

8778
// filter that can be used with the "copy" task of Gradle that transforms Markdown files

solr/documentation/src/markdown/online-link.template.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

solr/packaging/README.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,15 @@ docker/
8181
`docker/scripts` contains scripts that the Docker image uses to manage Solr.
8282
Refer to the README.md for instructions on how to build an image.
8383

84-
docs/index.html
85-
A link to the online version of Apache Solr Javadoc API documentation and Tutorial
84+
CHANGELOG.md
85+
The list of changes in this release.
86+
87+
Online Documentation
88+
The online version of Apache Solr Javadoc API documentation and Tutorial:
89+
@SOLR_DOC_URL@
90+
91+
Changes in this release are also published there, at:
92+
@SOLR_CHANGES_URL@
8693

8794
licenses/
8895
Licenses, notice files and signatures for Solr dependencies.

solr/packaging/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
import org.apache.tools.ant.filters.ReplaceTokens
1819
import org.apache.tools.ant.util.TeeOutputStream
1920

2021
// This project puts together a "distribution", assembling dependencies from
@@ -33,14 +34,16 @@ ext {
3334
devDir = file("$buildDir/dev")
3435
slimDevDir = file("$buildDir/dev-slim")
3536
batsLibsDir = file("$buildDir/bats-libs")
37+
onlineDocUnavailable = "Not available for custom/SNAPSHOT builds -- run './gradlew documentation' from the source distribution to build docs locally."
38+
onlineDocUrl = (project.solrDocUrl ? "${project.solrDocUrl}/" : onlineDocUnavailable).toString()
39+
onlineChangesUrl = (project.solrDocUrl ? "${project.solrDocUrl}/changes/Changes.html" : onlineDocUnavailable).toString()
3640
}
3741

3842
configurations {
3943
modules
4044
example
4145
crossDcManager
4246
server
43-
docs
4447
docker
4548
solrFullTgz
4649
solrSlimTgz
@@ -58,9 +61,6 @@ dependencies {
5861
example project(path: ":solr:example", configuration: "packaging")
5962
server project(path: ":solr:server", configuration: "packaging")
6063

61-
// Copy files from documentation output
62-
docs project(path: ':solr:documentation', configuration: 'minimalSite')
63-
6464
docker project(path: ':solr:docker', configuration: 'packaging')
6565

6666
solrFullTgzSignature files("$buildDir/distributions/solr-${version}.tgz.asc") {
@@ -92,6 +92,10 @@ distributions {
9292

9393
from(projectDir, {
9494
include "README.txt"
95+
filter(ReplaceTokens, tokens: [
96+
SOLR_DOC_URL: onlineDocUrl,
97+
SOLR_CHANGES_URL: onlineChangesUrl,
98+
])
9599
})
96100

97101
from('static/lib', {
@@ -106,10 +110,6 @@ distributions {
106110
into "server"
107111
})
108112

109-
from(configurations.docs, {
110-
into "docs"
111-
})
112-
113113
from(configurations.docker, {
114114
into "docker"
115115
filesMatching([

0 commit comments

Comments
 (0)