Coder Social home page Coder Social logo

archeck's Introduction

Java Architecture Analysis

ArCheck is a tool that analyses the structure of Java source code using the top level directories as a way of splitting the code into separate components and can produce a Java dependency diagram. Dividing large programs into smaller more manageable components is a fundamental principle of programming.

Installation

The installation steps are as follows:

  1. Ensure the Java runtime is installed
  2. Download and unzip the archeck release.
  3. Ensure that chcheck executable is added to you path.
  4. Optionally install graphviz. Required for the graphical dependency diagrams.
  5. Ensure the graphviz executable is added to your path.

Running

To produce dependency diagrams ensure graphviz is installed and added to your path.

Choose a project that you want analyze and type the following:

archeck <path-to-source-code>

Where <path-to-source-code> is the directory of just the java source code e.g. archeck src/main/java/

To generate an html output type the following:

archeck --html <html-output-dir> <path-to-source-code>

You can also pass a configuration file to archeck

archeck --config <config-file> --html <html-output-dir>

The default config file archeck.config will automatically be loaded if found in the current directory.

NOTE: Ensure all unused imports are removed as these may generate unwanted dependencies.

The Configuration file

The configuration file is a json file in which comments and unquoted field names are allowed.

item Description
root-dir: The path to the root directory of the project. Can be either absolute or relative to the location of the configuration file.
report-dir: Generates an HTML report in the specified directory.
modules: A json array with details of the list of modules in the project.
name: The name of the module.
path: The path from the root dir to the source code. For multiple source paths use a json string array.
max-depth: Controls the maximum depth to descend into package directories before the sub-dirs are merged together.

Example configuration file

An example of configuration is as follows:

// Example Json config for Googles bazel project
{
    root-dir: "project/bazel/",
    modules: [
        {
            name: "bazel",
            path: "bazel/src/main/java/com/google/devtools/build/lib/",
            max-depth: 0
        }
    ]
}

Building

Requirements:

  • Java
  • gradle

Type the following on the command line:

gradle installApp

The executable will be in the build/install/archeck/bin directory

To generate an archeck report on archeck using the default archeck.config file type:

gradle run
OR
build/install/archeck/bin/archeck

archeck's People

Contributors

louis-barman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.