From 5ed04ea5a0587b73a1d4f1dd13814a426fc034f0 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 18 Feb 2022 14:48:18 +0100 Subject: [PATCH] Fix build.sh --- .ci/build.sh | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index c720ccc6a6..b40190edda 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -40,7 +40,9 @@ function build() { pmd_ci_log_group_end # also run dogfood for PRs (only on linux) - pmd_ci_dogfood + pmd_ci_log_group_start "Executing PMD dogfood test with ${PMD_CI_MAVEN_PROJECT_VERSION}" + pmd_ci_dogfood + pmd_ci_log_group_end fi exit 0 @@ -88,9 +90,13 @@ function build() { regression_tester_uploadBaseline pmd_ci_log_group_end + # + # everything from here runs only on snapshots, not on release builds + # if pmd_ci_maven_isSnapshotBuild; then + pmd_ci_log_group_start "Executing PMD dogfood test with ${PMD_CI_MAVEN_PROJECT_VERSION}" pmd_ci_dogfood - fi + pmd_ci_log_group_end pmd_ci_log_group_start "Executing build with sonar" # Note: Sonar also needs GITHUB_TOKEN (!) @@ -238,20 +244,18 @@ ${rendered_release_notes}" # Runs the dogfood ruleset with the currently built pmd against itself # function pmd_ci_dogfood() { - pmd_ci_log_group_start "Executing PMD dogfood test with ${PMD_CI_MAVEN_PROJECT_VERSION}" - ./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false - sed -i 's/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *\)/'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml - if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then - sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml - fi - ./mvnw verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" \ - -DskipTests \ - -Dmaven.javadoc.skip=true \ - -Dmaven.source.skip=true \ - -Dcheckstyle.skip=true - ./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}" -DgenerateBackupPoms=false - git checkout -- pom.xml - pmd_ci_log_group_end + ./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false + sed -i 's/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *\)/'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml + if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then + sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml + fi + ./mvnw verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" \ + -DskipTests \ + -Dmaven.javadoc.skip=true \ + -Dmaven.source.skip=true \ + -Dcheckstyle.skip=true + ./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}" -DgenerateBackupPoms=false + git checkout -- pom.xml } build