Skip to content

Commit ce69491

Browse files
committed
Execute CodeNarc after compiling the sources to make it work on Travis CI.
1 parent 1165ed2 commit ce69491

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/main/scripts/ci/check-build-and-verify.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ fi
1919

2020
CS_STATUS=
2121
PMD_STATUS=
22-
CODENARC_STATUS=
2322
LICENSE_STATUS=
2423
POM_STATUS=
2524
BOOTLINT_STATUS=
@@ -28,6 +27,7 @@ JASMINE_STATUS=
2827
HTML_STATUS=
2928
ENFORCER_STATUS=
3029
TEST_STATUS=
30+
CODENARC_STATUS=
3131
FINDBUGS_STATUS=
3232
VERIFY_STATUS=
3333

@@ -115,12 +115,6 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
115115
fi
116116
print_status "$PMD_STATUS" 'Run PMD'
117117

118-
if [ "$CODENARC_STATUS" != 'skip' ]; then
119-
mvn --batch-mode codenarc:codenarc -Dcodenarc.maxPriority1Violations=0 -Dcodenarc.maxPriority2Violations=0 -Dcodenarc.maxPriority3Violations=0 \
120-
>codenarc.log 2>&1 || CODENARC_STATUS=fail
121-
fi
122-
print_status "$CODENARC_STATUS" 'Run CodeNarc'
123-
124118
if [ "$LICENSE_STATUS" != 'skip' ]; then
125119
mvn --batch-mode license:check \
126120
>license.log 2>&1 || LICENSE_STATUS=fail
@@ -182,6 +176,13 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
182176
fi
183177
print_status "$TEST_STATUS" 'Run unit tests'
184178

179+
if [ "$CODENARC_STATUS" != 'skip' ]; then
180+
# run after tests for getting compiled sources
181+
mvn --batch-mode codenarc:codenarc -Dcodenarc.maxPriority1Violations=0 -Dcodenarc.maxPriority2Violations=0 -Dcodenarc.maxPriority3Violations=0 \
182+
>codenarc.log 2>&1 || CODENARC_STATUS=fail
183+
fi
184+
print_status "$CODENARC_STATUS" 'Run CodeNarc'
185+
185186
if [ "$FINDBUGS_STATUS" != 'skip' ]; then
186187
# run after tests for getting compiled sources
187188
mvn --batch-mode findbugs:check \
@@ -206,7 +207,6 @@ print_status "$DANGER_STATUS" 'Run danger'
206207
if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
207208
[ "$CS_STATUS" = 'skip' ] || print_log cs.log 'Run CheckStyle'
208209
[ "$PMD_STATUS" = 'skip' ] || print_log pmd.log 'Run PMD'
209-
[ "$CODENARC_STATUS" = 'skip' ] || print_log codenarc.log 'Run CodeNarc'
210210
[ "$LICENSE_STATUS" = 'skip' ] || print_log license.log 'Check license headers'
211211
[ "$POM_STATUS" = 'skip' ] || print_log pom.log 'Check sorting of pom.xml'
212212
[ "$BOOTLINT_STATUS" = 'skip' ] || print_log bootlint.log 'Run bootlint'
@@ -215,6 +215,7 @@ if [ "$RUN_ONLY_INTEGRATION_TESTS" = 'no' ]; then
215215
[ "$HTML_STATUS" = 'skip' ] || print_log validator.log 'Run html5validator'
216216
[ "$ENFORCER_STATUS" = 'skip' ] || print_log enforcer.log 'Run maven-enforcer-plugin'
217217
[ "$TEST_STATUS" = 'skip' ] || print_log test.log 'Run unit tests'
218+
[ "$CODENARC_STATUS" = 'skip' ] || print_log codenarc.log 'Run CodeNarc'
218219
[ "$FINDBUGS_STATUS" = 'skip' ] || print_log findbugs.log 'Run FindBugs'
219220
fi
220221

@@ -224,8 +225,8 @@ if [ "$DANGER_STATUS" != 'skip' ]; then
224225
print_log danger.log 'Run danger'
225226
fi
226227

227-
rm -f cs.log pmd.log codenarc.log license.log pom.log bootlint.log rflint.log jasmine.log validator.log enforcer.log test.log findbugs.log verify-raw.log verify.log danger.log
228+
rm -f cs.log pmd.log license.log pom.log bootlint.log rflint.log jasmine.log validator.log enforcer.log test.log codenarc.log findbugs.log verify-raw.log verify.log danger.log
228229

229-
if echo "$CS_STATUS$PMD_STATUS$CODENARC_STATUS$LICENSE_STATUS$POM_STATUS$BOOTLINT_STATUS$RFLINT_STATUS$JASMINE_STATUS$HTML_STATUS$ENFORCER_STATUS$TEST_STATUS$FINDBUGS_STATUS$VERIFY_STATUS$DANGER_STATUS" | fgrep -qs 'fail'; then
230+
if echo "$CS_STATUS$PMD_STATUS$LICENSE_STATUS$POM_STATUS$BOOTLINT_STATUS$RFLINT_STATUS$JASMINE_STATUS$HTML_STATUS$ENFORCER_STATUS$TEST_STATUS$CODENARC_STATUS$FINDBUGS_STATUS$VERIFY_STATUS$DANGER_STATUS" | fgrep -qs 'fail'; then
230231
exit 1
231232
fi

0 commit comments

Comments
 (0)