Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ workflows:
jobs:
- validate-with-maven-script:
name: "releasenotes-builder"
image-name: &custom_img "amitkumardeoghoria/jdk-17-groovy-git-mvn:v1.0"
image-name: &custom_img "amitkumardeoghoria/jdk-21-groovy5-git-mvn-ant-jq:latest"
command: "./.ci/validation.sh releasenotes-builder"
- validate-with-maven-script:
name: "patch-diff-report-tool"
Expand Down
26 changes: 16 additions & 10 deletions checkstyle-tester/diff.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import groovy.util.CliBuilder
import groovy.util.AntBuilder
import static java.lang.System.err
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING

Expand Down Expand Up @@ -50,32 +52,36 @@ static void main(String[] args) {

def getCliOptions(args) {
def cliOptionsDescLineLength = 120
def cli = new CliBuilder(usage:'groovy diff.groovy [options]', header: 'options:', width: cliOptionsDescLineLength)
def cli = new CliBuilder(
usageMessage: 'groovy diff.groovy [options]',
headerHeading: 'Options:\n',
width: cliOptionsDescLineLength
)
cli.with {
r(longOpt: 'localGitRepo', args: 1, required: true, argName: 'path',
r(longOpt: 'localGitRepo', arity: "1", required: true, argName: 'path',
'Path to local git repository (required)')
b(longOpt: 'baseBranch', args: 1, required: false, argName: 'branch_name',
b(longOpt: 'baseBranch', arity: "1", required: false, argName: 'branch_name',
'Base branch name. Default is master (optional, default is master)')
p(longOpt: 'patchBranch', args: 1, required: true, argName: 'branch_name',
p(longOpt: 'patchBranch', arity: "1", required: true, argName: 'branch_name',
'Name of the patch branch in local git repository (required)')
bc(longOpt: 'baseConfig', args: 1, required: false, argName: 'path', 'Path to the base ' \
bc(longOpt: 'baseConfig', arity: "1", required: false, argName: 'path', 'Path to the base ' \
+ 'checkstyle config file (optional, if absent then the tool will use only ' \
+ 'patchBranch in case the tool mode is \'single\', otherwise baseBranch ' \
+ 'will be set to \'master\')')
pc(longOpt: 'patchConfig', args: 1, required: false, argName: 'path',
pc(longOpt: 'patchConfig', arity: "1", required: false, argName: 'path',
'Path to the patch checkstyle config file (required if baseConfig is specified)')
c(longOpt: 'config', args: 1, required: false, argName: 'path', 'Path to the checkstyle ' \
c(longOpt: 'config', arity: "1", required: false, argName: 'path', 'Path to the checkstyle ' \
+ 'config file (required if baseConfig and patchConfig are not secified)')
g(longOpt: 'allowExcludes', required: false, 'Whether to allow excludes specified in the list of ' \
+ 'projects (optional, default is false)')
h(longOpt: 'useShallowClone', 'Enable shallow cloning')
l(longOpt: 'listOfProjects', args: 1, required: true, argName: 'path',
l(longOpt: 'listOfProjects', arity: "1", required: true, argName: 'path',
'Path to file which contains projects to test on (required)')
s(longOpt: 'shortFilePaths', required: false, 'Whether to save report file paths' \
+ ' as a shorter version to prevent long paths. (optional, default is false)')
m(longOpt: 'mode', args: 1, required: false, argName: 'mode', 'The mode of the tool:' \
m(longOpt: 'mode', arity: "1", required: false, argName: 'mode', 'The mode of the tool:' \
+ ' \'diff\' or \'single\'. (optional, default is \'diff\')')
xm(longOpt: 'extraMvnRegressionOptions', args: 1, required: false, 'Extra arguments to pass to Maven' \
xm(longOpt: 'extraMvnRegressionOptions', arity: "1", required: false, 'Extra arguments to pass to Maven' \
+ 'for Checkstyle Regression run (optional, ex: -Dmaven.prop=true)')
}
return cli.parse(args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN curl -s "https://get.sdkman.io" | bash
# Install Java 21, Groovy, Maven via SDKMAN
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && \
sdk install java 21.0.4-tem && \
sdk install groovy 3.0.21 && \
sdk install groovy 5.0.0 && \
sdk install maven 3.9.11"

# Update PATH and setup environment
Expand All @@ -24,6 +24,4 @@ ENV PATH=$GROOVY_HOME/bin:$SDKMAN_DIR/candidates/maven/current/bin:$JAVA_HOME/bi
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && \
java -version && \
groovy --version && \
mvn -version && \
groovy -e 'new CliBuilder(); println \"CliBuilder OK\"' && \
groovy -e 'new AntBuilder(); println \"AntBuilder OK\"'"
mvn -version"
5 changes: 5 additions & 0 deletions patch-diff-report-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-ant</artifactId>
<version>4.0.23</version> <!-- match your Groovy version -->
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-jxr</artifactId>
Expand Down