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

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

commit 38e00673e41e5213804b9fd7e27f12b5ce86e34a
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Tue Feb 27 07:19:39 2024 +0100

    Perform a full regen during PR build
---
 .github/workflows/pr-build-main.yml |  2 +-
 docs/gulpfile.js                    |  8 ++++----
 docs/pom.xml                        |  2 +-
 dsl/camel-endpointdsl/pom.xml       | 14 ++++++++++++-
 etc/scripts/regen.sh                | 40 ++++---------------------------------
 5 files changed, 23 insertions(+), 43 deletions(-)

diff --git a/.github/workflows/pr-build-main.yml 
b/.github/workflows/pr-build-main.yml
index 13752ab9ac3..3571d9a123b 100644
--- a/.github/workflows/pr-build-main.yml
+++ b/.github/workflows/pr-build-main.yml
@@ -55,7 +55,7 @@ jobs:
           java-version: ${{ matrix.java }}
           cache: 'maven'
       - name: maven build
-        run: ./mvnw -l build.log -Dquickly install
+        run: ./etc/scripts/regen.sh > build.log 2>&1
       - name: archive logs
         uses: actions/upload-artifact@v4
         if: always()
diff --git a/docs/gulpfile.js b/docs/gulpfile.js
index b1c95e2e1b2..7858f78442b 100644
--- a/docs/gulpfile.js
+++ b/docs/gulpfile.js
@@ -114,7 +114,7 @@ const sources = {
     },
     json: {
       source: [
-        
'../components/{*,*/*,*/*/*}/src/generated/resources/org/apache/camel/**/*.json',
+        
'../components/{*,*/*,*/*/*}/src/generated/resources/META-INF/org/apache/camel/**/*.json',
       ],
       destination: 'components/modules/ROOT/examples/json',
       filter: (content) => JSON.parse(content).component, // check if there is 
a "component" key at the root
@@ -194,7 +194,7 @@ const sources = {
     },
     json: {
       source: [
-        
'../core/camel-core-model/src/generated/resources/org/apache/camel/model/**/*.json',
+        
'../core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/**/*.json',
       ],
       destination: 
'../core/camel-core-engine/src/main/docs/modules/eips/examples/json',
       filter: (content) => {
@@ -271,7 +271,7 @@ const tasks = Array.from(sourcesMap).flatMap(([type, 
definition]) => {
   // by default that's only index.adoc, index.adoc is not symlinked
   // so we don't want to remove it
   const clean = (destination, keep) => {
-    const deleteAry = [`${destination}/*`] // files in destination needs to be 
deleted
+    const deleteAry = [`${destination}/*`] // files in destination needs to be 
deleted */
     // append any exceptions, i.e. files to keep at the destination
     deleteAry.push(...(keep || ['index.adoc']).map((file) => 
`!${destination}/${file}`))
     return deleteAsync(deleteAry, {
@@ -346,7 +346,7 @@ const tasks = Array.from(sourcesMap).flatMap(([type, 
definition]) => {
 
   // creates symlinks from source to destination for every example
   // file referenced from .adoc file in the source maintaining the
-  // basedir from the file path, i.e. symlinking from a deep hiearchy
+  // basedir from the file path, i.e. symlinking from a deep hierarchy
   const createExampleSymlinks = (source, destination) => {
     const extractExamples = function (file, enc, done) {
       const asciidoc = file.contents.toString()
diff --git a/docs/pom.xml b/docs/pom.xml
index 393b574c18d..5f15fbfbae5 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -93,7 +93,7 @@
             </properties>
         </profile>
         <profile>
-            <id>full</id>
+            <id>regen</id>
             <activation>
                 <property>
                     <name>!quickly</name>
diff --git a/dsl/camel-endpointdsl/pom.xml b/dsl/camel-endpointdsl/pom.xml
index a18e39da1b6..0374dfb1073 100644
--- a/dsl/camel-endpointdsl/pom.xml
+++ b/dsl/camel-endpointdsl/pom.xml
@@ -185,7 +185,7 @@
     </build>
     <profiles>
         <profile>
-            <id>full</id>
+            <id>regen</id>
             <activation>
                 <property>
                     <name>!quickly</name>
@@ -207,6 +207,18 @@
                             </execution>
                         </executions>
                     </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>full</id>
+            <activation>
+                <property>
+                    <name>!quickly</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-surefire-plugin</artifactId>
diff --git a/etc/scripts/regen.sh b/etc/scripts/regen.sh
index 31da1e11452..1693627e08f 100755
--- a/etc/scripts/regen.sh
+++ b/etc/scripts/regen.sh
@@ -16,46 +16,14 @@
 # limitations under the License.
 #
 
-if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
-    echo "Error: Bash 4 or higher is required to run this script, but found 
${BASH_VERSINFO}"
-    exit 1
-fi
-
-shopt -s globstar
-
-CAMEL_DIR=$(cd `dirname "$0"`/../..; pwd)
-cd $CAMEL_DIR
+# Move to top directory
+cd `dirname "$0"`/../..
 
 # Force clean
 git clean -fdx
 rm -Rf **/src/generated/
 
 # Regenerate everything
-./mvnw -Pfull,update-camel-releases -DskipTests package
+./mvnw --batch-mode -Pupdate-camel-releases,regen -DskipTests install
 # One additional pass to get the info for the 'others' jars
-./mvnw -Pfull,update-camel-releases -DskipTests package -f 
catalog/camel-catalog
-
-# Update links
-find docs/components/modules/ROOT/examples/json -type l -delete
-for json_file in components/**/src/generated/resources/META-INF/**/*.json ; do
-    # Get relative path of json file
-    if [[ "$OSTYPE" == "linux-gnu"* ]]; then
-        rel_path=$(realpath 
--relative-to=docs/components/modules/ROOT/examples/json $json_file)
-    else 
-        rel_path=$(grealpath 
--relative-to=docs/components/modules/ROOT/examples/json $json_file)
-    fi
-    # Create symbolic link in dir-b
-    ln -sf $rel_path docs/components/modules/ROOT/examples/json/$(basename 
$json_file)
-done
-
-find core/camel-core-engine/src/main/docs/modules/eips/examples/json -type l 
-delete
-for json_file in 
core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/*.json
 ; do
-    # Get relative path of json file
-    if [[ "$OSTYPE" == "linux-gnu"* ]]; then
-        rel_path=$(realpath 
--relative-to=core/camel-core-engine/src/main/docs/modules/eips/examples/json 
$json_file)
-    else
-        rel_path=$(grealpath 
--relative-to=core/camel-core-engine/src/main/docs/modules/eips/examples/json 
$json_file)
-    fi
-    # Create symbolic link in dir-b
-    ln -sf $rel_path 
core/camel-core-engine/src/main/docs/modules/eips/examples/json/$(basename 
$json_file)
-done
+./mvnw --batch-mode install -f catalog/camel-catalog

Reply via email to