This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch jira/solr-15556-antora
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/jira/solr-15556-antora by this 
push:
     new 8b405d4  Cleaning up a bit
8b405d4 is described below

commit 8b405d419cf725ee0fdb304d356655b34bcea963
Author: Houston Putman <[email protected]>
AuthorDate: Fri Feb 4 16:24:52 2022 -0500

    Cleaning up a bit
---
 solr/solr-ref-guide/README.adoc  |  5 ++--
 solr/solr-ref-guide/build.gradle | 55 ++++++++++++++++++++++++++++++----------
 2 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/solr/solr-ref-guide/README.adoc b/solr/solr-ref-guide/README.adoc
index f02b598..1bbfa83 100644
--- a/solr/solr-ref-guide/README.adoc
+++ b/solr/solr-ref-guide/README.adoc
@@ -18,10 +18,11 @@
 
 This is the source for the Solr Reference Guide.
 
-Raw content is stored in Asciidoc (`.adoc`) formatted files in the `src/` 
directory.
+Raw content is stored in Asciidoc (`.adoc`) formatted files in the `modules/` 
directory.
 
-To build the Ref Guide, simply run `./gradlew checkSite`.
+To build the Ref Guide, simply run `./gradlew buildSite`.
 This will build the HTML files and validate that page references and internal 
links work properly.
+You can find the home page of the generated site under `build/site/index.html`
 
 See the `../../dev-docs/ref-guide` directory for information about editing and 
publishing the Ref Guide.
 
diff --git a/solr/solr-ref-guide/build.gradle b/solr/solr-ref-guide/build.gradle
index 9b24e76..75c7242 100644
--- a/solr/solr-ref-guide/build.gradle
+++ b/solr/solr-ref-guide/build.gradle
@@ -57,6 +57,7 @@ ext {
 
     siteDir = "${buildDir}/site"
     playbooksDir = "${buildDir}/playbooks"
+    uiBuildDir = "${buildDir}/ui"
     playbookTemplate = "playbook.template.yml"
     localPlaybook = "local-playbook.yml"
     officialPlaybook = "official-playbook.yml"
@@ -64,8 +65,11 @@ ext {
     playbookFilePath = "${project.ext.playbooksDir}/${isLocalGuide ? 
project.ext.localPlaybook : project.ext.officialPlaybook}"
 }
 
+/*
+    Generating the Antora and Playbook YAML files
+ */
 task buildAntoraYaml {
-    description "Creates an antora.yml with all variables populated"
+    description "Creates an antora.yml with all variables populated. Note: 
This will change the antora.yml in the repo, not a build folder."
 
     def templateYaml = "antora.yml.template"
     def outputYaml = "antora.yml"
@@ -160,6 +164,10 @@ dependencies {
     }
 }
 
+/*
+    Downloading Build Tools
+ */
+
 // We use Node to install and run Antora
 node {
     download = true
@@ -238,33 +246,40 @@ task startUIBuildDir(type: Copy) {
     }
     duplicatesStrategy = 'INCLUDE'
 
-    into "${buildDir}/ui"
+    into project.ext.uiBuildDir
 }
 
 task setupUIBuildDir(type: NpmTask) {
     dependsOn tasks.startUIBuildDir
-    workingDir = file("${buildDir}/ui")
+    workingDir = file(project.ext.uiBuildDir)
     args = ["install"]
 
-    inputs.files("${buildDir}/ui/package.json")
-    outputs.dir("${buildDir}/ui/node_modules/")
+    inputs.files("${project.ext.uiBuildDir}/package.json")
+    outputs.dir("${project.ext.uiBuildDir}/node_modules/")
 }
 
+// Note that Gulp must be installed in the UI Build Directory, not our project 
node_modules
 task downloadGulp(type: NpmTask) {
     dependsOn tasks.startUIBuildDir
 
     args = ["install", "gulp-cli", "--legacy-peer-deps"]
     execOverrides {
         // The it variable contains the `ExecSpec`
-        workingDir = "${buildDir}/ui"
+        workingDir = project.ext.uiBuildDir
     }
 
     inputs.property("Antora version", project.ext.antoraVersion)
-    inputs.files("${buildDir}/ui/package.json")
-    outputs.dir("${buildDir}/ui/node_modules/")
+    inputs.files("${project.ext.uiBuildDir}/package.json")
+    outputs.dir("${project.ext.uiBuildDir}/node_modules/")
 }
 
+/*
+    Build and/or validate the Site
+ */
+
 task buildUIBundle(type: NpxTask) {
+    description "Creates a local UI bundle using the 'ui-src' directory. This 
can be used to preview UI changes with a local ref-guide build."
+
     dependsOn tasks.setupUIBuildDir
     dependsOn tasks.downloadGulp
 
@@ -275,23 +290,28 @@ task buildUIBundle(type: NpxTask) {
     ]
     execOverrides {
         // The it variable contains the `ExecSpec`
-        workingDir = "${buildDir}/ui"
+        workingDir = project.ext.uiBuildDir
     }
 
     doLast {
         copy {
-            from "${buildDir}/ui/build/ui-bundle.zip"
+            from "${project.ext.uiBuildDir}/build/ui-bundle.zip"
             into "${buildDir}/dist"
         }
     }
 
-    inputs.files(fileTree("${buildDir}/ui/src") {
-        exclude "node_modules"
-    })
-    outputs.dir(project.ext.siteDir)
+    inputs.files(fileTree("${project.ext.uiBuildDir}/src"))
+    outputs.file("${buildDir}/dist/ui-bundle.zip")
+
+    doLast {
+        project.logger.lifecycle("The generated ui-bundle.zip can be found 
at:")
+        project.logger.lifecycle("\t${buildDir}/dist/ui-bundle.zip")
+    }
 }
 
 task buildSite(type: NpxTask) {
+    description "Creates a local build of the ref-guide."
+
     dependsOn tasks.downloadAntora
     dependsOn tasks.buildAntoraYaml
     dependsOn configurations.playbookInUse
@@ -333,9 +353,16 @@ task buildSite(type: NpxTask) {
         inputs.files("${buildDir}/dist/ui-bundle.zip")
     }
     outputs.dir(project.ext.siteDir)
+
+    doLast {
+        project.logger.lifecycle("The generated ref-guide can be found at:")
+        project.logger.lifecycle("\t${project.ext.siteDir}")
+    }
 }
 
 task checkSiteLinks(type: NpxTask) {
+    description "Check that all links in the ref-guide, both internal and 
java-docs, are correct."
+
     dependsOn tasks.downloadLinkValidator
     dependsOn tasks.buildSite
 

Reply via email to