Skip to content

Commit 71def16

Browse files
committed
Issue #529: Deprecate launch.groovy and merge functionality into diff.groovy
1 parent 8dbf190 commit 71def16

File tree

7 files changed

+1067
-40
lines changed

7 files changed

+1067
-40
lines changed

.ci/travis.sh

+64-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ patch-diff-report-tool)
3434
checkstyle-tester-launch-groovy)
3535
checkout_from https://github.com/checkstyle/checkstyle
3636
cd .ci-temp/checkstyle
37+
LOCAL_GIT_REPO=$(pwd)
3738
mvn --batch-mode clean install -Passembly
3839
cd ../../checkstyle-tester
39-
groovy launch.groovy -l projects-for-travis.properties -c my_check.xml -i
40+
groovy diff.groovy -r "$LOCAL_GIT_REPO" -l projects-for-travis.properties --patchConfig my_check.xml \
41+
--patchBranch master --mode single --allowExcludes
4042
;;
4143

4244
checkstyle-tester-diff-groovy-patch)
@@ -69,6 +71,67 @@ checkstyle-tester-diff-groovy-patch-only)
6971
-pc my_check.xml -p patch-branch -r ../.ci-temp/checkstyle -m single
7072
;;
7173

74+
checkstyle-tester-diff-groovy-regression-single)
75+
# Check out lateset checkstyle from master
76+
checkout_from https://github.com/checkstyle/checkstyle
77+
78+
# Run report from master branch of contribution
79+
checkout_from https://github.com/checkstyle/contribution
80+
cd .ci-temp/contribution/checkstyle-tester
81+
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
82+
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
83+
export MAVEN_OPTS="-Xmx2048m"
84+
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
85+
-pc ../../../checkstyle-tester/diff-groovy-regression-config.xml \
86+
-r ../../checkstyle \
87+
-m single -p master
88+
89+
# Run report with current branch
90+
cd ../../../checkstyle-tester/
91+
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
92+
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
93+
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
94+
-pc diff-groovy-regression-config.xml -r ../.ci-temp/checkstyle/ \
95+
-m single -p master
96+
97+
cd ..
98+
# We need to ignore file paths below, since they will be different between reports
99+
diff -I "contribution" checkstyle-tester/reports/diff/checkstyle/index.html \
100+
.ci-temp/contribution/checkstyle-tester/reports/diff/checkstyle/index.html
101+
;;
102+
103+
checkstyle-tester-diff-groovy-regression)
104+
# Check out latest checkstyle from master
105+
checkout_from https://github.com/checkstyle/checkstyle
106+
cd .ci-temp/checkstyle
107+
MASTER_BRANCH_SHA=$(git log -n 1 --pretty=format:"%H")
108+
cd ../..
109+
110+
# Run report from master branch of contribution
111+
checkout_from https://github.com/checkstyle/contribution
112+
cd .ci-temp/contribution/checkstyle-tester
113+
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
114+
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
115+
export MAVEN_OPTS="-Xmx2048m"
116+
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
117+
-c ../../../checkstyle-tester/diff-groovy-regression-config.xml \
118+
-r ../../checkstyle \
119+
-b "$MASTER_BRANCH_SHA" -p 7190c47ca5515ad8cb827bc4065ae7664d2766c1
120+
121+
# Run report with current branch
122+
cd ../../../checkstyle-tester/
123+
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
124+
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
125+
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
126+
-c diff-groovy-regression-config.xml -r ../.ci-temp/checkstyle/ \
127+
-b "$MASTER_BRANCH_SHA" -p 7190c47ca5515ad8cb827bc4065ae7664d2766c1
128+
129+
cd ..
130+
# We need to ignore file paths below, since they will be different between reports
131+
diff -I "contribution" checkstyle-tester/reports/diff/checkstyle/index.html \
132+
.ci-temp/contribution/checkstyle-tester/reports/diff/checkstyle/index.html
133+
;;
134+
72135
codenarc)
73136
cd checkstyle-tester
74137
./codenarc.sh . diff.groovy > diff.log && cat diff.log && grep '(p1=0; p2=0; p3=0)' diff.log

.travis.yml

+15
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ matrix:
4444
- DESC="checkstyle-tester (diff.groovy) on linux with enabled patchOnly"
4545
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-patch-only"
4646

47+
- jdk: openjdk8
48+
env:
49+
- DESC="checkstyle-tester (diff.groovy) regression on linux in single mode"
50+
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression-single"
51+
52+
- jdk: openjdk8
53+
env:
54+
- DESC="checkstyle-tester (diff.groovy) regression on linux with master specified"
55+
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression"
56+
57+
- jdk: openjdk8
58+
env:
59+
- DESC="checkstyle-tester (diff.groovy) regression on linux with default settings"
60+
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression-default"
61+
4762
# disabled till https://github.com/checkstyle/contribution/issues/448
4863
# - jdk: openjdk8
4964
# env:

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ environment:
8383
CMD3: " && cd checkstyle && git checkout -b patch-branch"
8484
CMD4: " "
8585
CMD5: " && cd ..\\checkstyle-tester "
86-
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -c my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -i -s"
86+
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -c my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -s"
8787
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
8888
DESC: "checkstyle-tester (diff.groovy with base and patch configs) on guava"
8989
CMD1: " git clone -q --depth=10 --branch=master "
9090
CMD2: " https://github.com/checkstyle/checkstyle C:\\projects\\contribution\\checkstyle "
9191
CMD3: " && cd checkstyle && git checkout -b patch-branch"
9292
CMD4: " "
9393
CMD5: " && cd ..\\checkstyle-tester "
94-
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -bc my_check.xml -pc my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -i -s"
94+
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -bc my_check.xml -pc my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -s"
9595

9696
build_script:
9797
- ps: >

checkstyle-tester/LAUNCH_GROOVY_README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# _LAUNCH.GROOVY IS BEING DEPRECATED!!!_
2+
13
# launch.groovy
24

35
Checkstyle report generation

checkstyle-tester/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ This option is useful for Windows users where they are restricted to maximum dir
6565
to maven during the Checkstyle regression run. For example, if you want to skip site generation, you
6666
would add `--extraMvnRegressionOptions "-Dmaven.site.skip=true"` to `diff.groovy` execution.
6767

68+
**failsOnError** (f) - this option tells maven to fail if a checkstyle error is encountered during
69+
report generation. This means that your configuration uses the `<property name="severity" value="warning"/>
70+
` property. If Checkstyle reports a violation for any of the projects that are being tested, the report
71+
generation will fail. This option is good for usage in Checkstyle CI for no-error testing
72+
(optional, default is false).
73+
74+
**allowExcludes** (g) - this option tells `diff.groovy` to allow paths and files defined in a
75+
`projects*.properties` file to be excluded from report generation (optional, default is false).
76+
77+
**checkstyleVersion** (cv) - used to set the Checkstyle version to be used by maven during report
78+
generation; this option should mainly be used by satiellite projects
79+
(optional, default is the latest snapshot).
80+
81+
**sevntuVersion** (sv) - used to set the Sevntu-Checkstyle version to be used by maven during
82+
report generation; this option should mainly be used by satiellite projects
83+
(optional, default is the latest release).
84+
6885
## Outputs
6986

7087
When the script finishes its work the following directory structure will be created

0 commit comments

Comments
 (0)