Skip to content

exercism/java-analyzer

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Jun 18, 2021
Jun 24, 2024
Feb 14, 2024
Apr 2, 2024
Apr 9, 2024
Apr 9, 2024
Nov 23, 2021
Feb 14, 2024
Feb 14, 2024
Feb 2, 2024
Jan 23, 2024
Apr 2, 2024
Jul 31, 2020
Feb 14, 2024
May 21, 2024
Oct 27, 2023
Apr 2, 2024
Oct 27, 2023

Repository files navigation

Java Analyzer Coverage Status

The Java analyzer uses Abstract Syntax Trees (ASTs) to analyze submitted solutions using the javaparser library.

The documentation for this project can be found at exercism.github.io/java-analyzer/.

Contributing

If you want to contribute to the Java analyzer, please refer to the Contributing Guide.

Usage

Running directly

Start by building the JAR using Gradle:

./gradlew build

Then, run the Java analyzer using build/libs/java-analyzer.jar. For example, to analyze a solution for the leap exercise, run:

java -jar build/libs/java-analyzer.jar leap /path/to/leap /path/to/output/folder

The analyzer output is written to analysis.json and tags.json in /path/to/output/folder.

Running with Docker

To run the Java analyzer using Docker, first build and tag the Docker image:

docker build -t exercism/java-analyzer .

Then, run the image and mount the directory of the solution to analyze. For example, to analyze a solution for the leap exercise located at ~/exercism/java/leap, run:

docker run -v /path/to/leap:/input -v /path/to/output/folder:/output exercism/java-analyzer leap /input /output

The analyzer output is written to analysis.json and tags.json in /path/to/output/folder.

Tests

Unit tests

To run the unit tests:

./gradlew test

Smoke tests

To run the smoke tests using Docker:

bin/run-tests-in-docker.sh