Skip to content

A simple API for analysing a java classpath in order to find cyclic dependencies

License

Notifications You must be signed in to change notification settings

dbahlbeck/jcyclic

Repository files navigation

JCyclic Introduction

This API provides a simple a mechanism for finding cyclic dependencies in you classpath.

Usage

The basic usage is this:

  1. Instantiate something that can find your classes. Either:
  • DirectoryFinder
  • ClasspathFinder
  1. Instantiate ClassDependencies with that 'class finder' and a base package.
  2. Now you can query the results.
@Test
public void testForPackageCyclicDependencies() {
    ClassFinder finder = new DirectoryFinder(new File("build/classes/main"));
    ClassDependencies classDependencies = new ClassDependencies(classFinder, "se.cyclic.jcyclic");

    // Analyse the package and class graph
    Set<String> cycles = classDependencies.getPackagesInCycles();
    List<List<String>> cycles = classDependencies.getPackageCycles();
}

Coming soon

  • Gradle plugin

About

A simple API for analysing a java classpath in order to find cyclic dependencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages