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

aw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/main by this push:
     new b448f7c1 YETUS-1023. javadocs website creation is broken (#259)
b448f7c1 is described below

commit b448f7c17bf1938e4c3088972229d2d00612cebd
Author: Allen Wittenauer <[email protected]>
AuthorDate: Tue Apr 26 07:11:33 2022 -0700

    YETUS-1023. javadocs website creation is broken (#259)
---
 asf-site-src/config.rb                          | 30 +++--------
 asf-site-src/pom.xml                            | 68 -------------------------
 asf-site-src/source/contribute/releases.html.md |  5 +-
 pom.xml                                         | 22 ++------
 precommit/src/main/shell/plugins.d/rubocop.sh   |  4 +-
 release/update-doc-versions.sh                  | 54 --------------------
 6 files changed, 16 insertions(+), 167 deletions(-)

diff --git a/asf-site-src/config.rb b/asf-site-src/config.rb
index 7e25555e..02727c4c 100644
--- a/asf-site-src/config.rb
+++ b/asf-site-src/config.rb
@@ -119,24 +119,17 @@ def releasenotes(output, version)
 end
 
 def build_release_docs(output, version)
-  # TODO: get the version date from jira and do an up to date check instead of 
building each time.
   puts "Building docs for release #{version}"
-  puts "\tcleaning up output directories in #{output}"
-  FileUtils.rm_rf("#{output}/build-#{version}", secure: true)
-  FileUtils.rm_rf("#{output}/#{version}", secure: true)
 
   puts "Downloading and extracting #{version} from ASF archives"
   `(cd #{output} \
-    && mkdir -p build-#{version} \
+    && mkdir -p site/documentation/#{version} \
     && curl --fail --location --output site-#{version}.tar.gz \
     
https://archive.apache.org/dist/yetus/#{version}/apache-yetus-#{version}-site.tar.gz
 \
-    && tar -C build-#{version} \
-    --strip-components 3 -xzpf site-#{version}.tar.gz \
+    && tar -C site/documentation/#{version} \
+    --strip-components 3 -xzkpf site-#{version}.tar.gz \
     apache-yetus-#{version}-site/documentation/in-progress/ \
     )`
-  puts "Removing #{output}/build-#{version}/CHANGELOG"
-  FileUtils.rm_rf("#{output}/build-#{version}/CHANGELOG", secure: true)
-  FileUtils.rm_rf("#{output}/build-#{version}/RELEASENOTES", secure: true)
 end
 
 def precommit_shelldocs(apidocs_dir, source_dir)
@@ -151,7 +144,7 @@ def precommit_shelldocs(apidocs_dir, source_dir)
 end
 
 # Add in apidocs rendered by other parts of the repo
-after_configuration do # rubocop:disable Metrics/BlockLength
+after_configuration do
   # Since `after_configuration` runs twice in middleman 4,
   # we will build twice if we don't skip the config run
   next if app.config[:mode] == :config
@@ -164,17 +157,6 @@ after_configuration do # rubocop:disable 
Metrics/BlockLength
     end
   end
 
-  # For Audience Annotations we just rely on having made javadocs with Maven
-  sitemap.register_resource_list_manipulator(
-    :audience_annotations,
-    ApiDocs.new(
-      sitemap,
-      'documentation/in-progress/javadocs',
-      File.expand_path('../target/site/documentation/in-progress/javadocs',
-                       File.dirname(__FILE__))
-    )
-  )
-
   # For Precommit we regenerate source files so they can be rendered.
   # we rely on a symlink. to avoid an error from the file watcher, our target
   # has to be outside of the asf-site-src directory.
@@ -184,7 +166,6 @@ after_configuration do # rubocop:disable Metrics/BlockLength
   precommit_shelldocs('target/in-progress/precommit/apidocs/', 
'../precommit/src/main/shell')
   # stitch the javadoc in place
   app.data.versions.releases&.each do |release|
-    build_release_docs('target', release)
     releasenotes('target', release)
     sitemap.register_resource_list_manipulator(
       "#{release}_javadocs".to_sym,
@@ -204,4 +185,7 @@ after_build do
     'target/site/documentation/in-progress/precommit/apidocs-index/index.html',
     'target/site/documentation/in-progress/precommit/apidocs/index.html'
   )
+  app.data.versions.releases&.each do |release|
+    build_release_docs('target', release)
+  end
 end
diff --git a/asf-site-src/pom.xml b/asf-site-src/pom.xml
index b27fca6c..34b646a5 100644
--- a/asf-site-src/pom.xml
+++ b/asf-site-src/pom.xml
@@ -45,74 +45,6 @@
         <artifactId>yetus-maven-plugin</artifactId>
         <version>${project.version}</version>
         <executions>
-          <!-- AUTOMATED_EDIT_BEGIN -->
-          <execution>
-            <id>0.11.1</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.11.1</target>
-              <newLink>${basedir}/source/documentation/0.11.1</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>0.11.1.html.md</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.11.1.html.md</target>
-              <newLink>${basedir}/source/documentation/0.11.1.html.md</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>0.12.0</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.12.0</target>
-              <newLink>${basedir}/source/documentation/0.12.0</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>0.12.0.html.md</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.12.0.html.md</target>
-              <newLink>${basedir}/source/documentation/0.12.0.html.md</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>0.13.0</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.13.0</target>
-              <newLink>${basedir}/source/documentation/0.13.0</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>0.13.0.html.md</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/0.13.0.html.md</target>
-              <newLink>${basedir}/source/documentation/0.13.0.html.md</newLink>
-            </configuration>
-          </execution>
-          <!-- AUTOMATED_EDIT_END -->
           <execution>
             <!-- we create a symlink of current version->in-progress.  This 
will cause
                  middleman to generate two copies of the output. -->
diff --git a/asf-site-src/source/contribute/releases.html.md 
b/asf-site-src/source/contribute/releases.html.md
index ed7603dc..b89f3e06 100644
--- a/asf-site-src/source/contribute/releases.html.md
+++ b/asf-site-src/source/contribute/releases.html.md
@@ -452,7 +452,8 @@ Once a release candidate obtains majority approval from the 
PMC, there are sever
    ```bash
    $ release/update-doc-versions.sh --version=<x.y.z -- version WITHOUT the 
rel/!>
    $ git add -p
-   $ git add asf-site-src/pom.xml
+   $ git add asf-site-src/data/versions.yml
+   $ git add asf-site-src/data/htaccess.yml
    $ git commit
    ```
 
@@ -462,7 +463,7 @@ Once a release candidate obtains majority approval from the 
PMC, there are sever
    YETUS-XXX. add release 0.7.0.
 
    - list in releases
-   - remove 0.4.0, add 0.7.0 to pom.xml
+   - remove 0.4.0, add 0.7.0 to docs and downloads
    ```
 
 1. Commit the patch to the ASF source repo immediately, but do not update the 
website just yet.
diff --git a/pom.xml b/pom.xml
index 64222a82..3b75e00a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,6 +72,7 @@
     <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
     <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
     
<maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
+    <maven-rat-plugin.version>0.13</maven-rat-plugin.version>
     <mockito.version>4.2.0</mockito.version>
     <spotbugs-maven-plugin.version>4.4.1</spotbugs-maven-plugin.version>
 
@@ -173,22 +174,6 @@
             <argLine>${jigsaw.avoidance}</argLine>
           </configuration>
         </plugin>
-
-        <!-- plugin>
-          <groupId>org.apache.rat</groupId>
-          <artifactId>apache-rat-plugin</artifactId>
-          <version>${apache-rat-plugin.version}</version>
-          <executions>
-            <execution>
-              <phase>verify</phase>
-              <goals>
-                <goal>check</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin -->
-
-
       </plugins>
     </pluginManagement>
 
@@ -262,12 +247,11 @@
       <plugin>
         <groupId>org.apache.rat</groupId>
         <artifactId>apache-rat-plugin</artifactId>
-        <version>0.13</version>
+        <version>${maven-rat-plugin.version}</version>
         <configuration>
           <excludeSubprojects>false</excludeSubprojects>
           <excludes>
-            <exclude>.rubocop.yml</exclude>
-            <exclude>Formula/.rubocop.yml</exclude>
+            <exclude>.mvn/maven.config</exclude>
           </excludes>
         </configuration>
       </plugin>
diff --git a/precommit/src/main/shell/plugins.d/rubocop.sh 
b/precommit/src/main/shell/plugins.d/rubocop.sh
index b4216eac..6324ac14 100755
--- a/precommit/src/main/shell/plugins.d/rubocop.sh
+++ b/precommit/src/main/shell/plugins.d/rubocop.sh
@@ -82,7 +82,9 @@ function rubocop_exec
 
   for i in "${CHANGED_FILES[@]}"; do
     if [[ ${i} =~ \.rb$ && -f ${i} ]]; then
-      "${RUBOCOP}" "${args[@]}" "${i}" | "${AWK}" '!/[0-9]* files? inspected/' 
>> "${PATCH_DIR}/${repostatus}-rubocop-result.txt"
+      "${RUBOCOP}" "${args[@]}" "${i}" \
+      | "${AWK}" '!/[0-9]* files? inspected/' \
+      | "${SED}" -e "s,${BASEDIR}/,,g" >> 
"${PATCH_DIR}/${repostatus}-rubocop-result.txt"
     fi
   done
   popd >/dev/null || return 1
diff --git a/release/update-doc-versions.sh b/release/update-doc-versions.sh
index b658f52c..29d08859 100755
--- a/release/update-doc-versions.sh
+++ b/release/update-doc-versions.sh
@@ -75,7 +75,6 @@ update_versions()
   declare vermajor
   declare verminor
   declare -a versions
-  declare produced=false
 
   ## NOTE: $REPLY, the default for read, is used
   ## here because it will maintain any leading spaces!
@@ -114,59 +113,6 @@ update_versions()
   done
 
   mv "${newfile}" "${BASEDIR}"/asf-site-src/data/versions.yml
-
-
-  ## NOTE: $REPLY, the default for read, is used
-  ## here because it will maintain any leading spaces!
-  ## if read is given a variable, then IFS manipulation
-  ## will be required!
-
-  found=false
-  produced=false
-  while read -r; do
-    if [[ "${REPLY}" =~ AUTOMATED_EDIT_BEGIN ]]; then
-      echo "${REPLY}" >> "${newfile}"
-      found=true
-    elif [[ "${REPLY}" =~ AUTOMATED_EDIT_END ]]; then
-      echo "${REPLY}" >> "${newfile}"
-      found=false
-    elif [[ ${found} == false ]]; then
-      echo "${REPLY}" >> "${newfile}"
-    elif [[ "${produced}" == true ]]; then
-      continue
-    elif [[ "${found}" == true ]]; then
-      for ver in "${versions[@]}"; do
-        cat << EOF >> "${newfile}"
-          <execution>
-            <id>${ver}</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/${ver}</target>
-              <newLink>\${basedir}/source/documentation/${ver}</newLink>
-            </configuration>
-          </execution>
-          <execution>
-            <id>${ver}.html.md</id>
-            <phase>pre-site</phase>
-            <goals>
-              <goal>symlink</goal>
-            </goals>
-            <configuration>
-              <target>../../target/${ver}.html.md</target>
-              
<newLink>\${basedir}/source/documentation/${ver}.html.md</newLink>
-            </configuration>
-          </execution>
-EOF
-      done
-      produced=true
-    fi
-  done < "${BASEDIR}"/asf-site-src/pom.xml
-
-  mv "${newfile}" "${BASEDIR}"/asf-site-src/pom.xml
-
 }
 
 update_htaccess()

Reply via email to