Skip to content

alhino/revapi

 
 

Repository files navigation

Revapi

Build Status

Revapi is a tool for API analysis and change tracking.

Warning
Do not use revapi-maven-plugin version 0.3.9 and below with revapi-java version 0.5.x (revapi-maven-plugin:0.3.10 is OK). These are incompatible due to overriding of versions of dependencies to be used by revapi-java and revapi-maven-plugin.

Summary

While Revapi is designed to be extensible and in theory should support API checks in other languages than Java (not just programming languages but anything that can be decomposed to a tree structure) the only extension in existence today is the Java API checker.

The main distinguishing features of the Java API checker include:

  • large number of API checks

    • categorized by their influence on source, binary and "semantical" compatibility

  • support for computing the API "surface" by tracking usages of types across the checked library and also its dependencies (ability to report type "leakage" from deps)

  • support for Java8 constructs (default methods in particular)

  • powerful filtering stuff to check and reclassification of found problems

  • ability to filter by annotation presence (new as of java extension 0.5.2)

  • Maven plugin automatically includes depenendcies in the check

Other features:

  • pluggable reporting (standard output, maven site generation, JUnit report generator (TBD))

Building

This is a maven project, so to build you simply:

mvn install

Usage

Revapi can be invoked in a couple of ways. It can be used as a standalone program, as a maven plugin or it can also be embedded in your application and used as a library.

Standalone

Download the standalone distribution zip and

unzip rhq-revapi-XXX.zip
cd rhq-revapi-XXX
./revapi.sh

Read the usage info and go.

Maven

<build>
    <plugins>
        <plugin>
            <groupId>org.revapi</groupId>
            <artifactId>revapi-maven-plugin</artifactId>
            <version>...</version>
            <dependencies>
                <dependency>
                    <groupId>org.revapi</groupId>
                    <artifactId>revapi-java</artifactId>
                    <version>...</version>
                </dependency>
                <dependency>
                    <groupId>com.acme</groupId>
                    <artifactId>my-extension</artifactId>
                    <version>...</version>
                </dependency>
                ...
            </dependencies>
            <configuration>
                ...
            </configuration>
            <executions>
                <execution>
                    <id>api-check</id>
                    <goals><goal>check</goal></goals>
                    ...
                </execution>
                ...
            </executions>
        </plugin>
        ...
    </plugins>
    ...
</build>

Embedding

Revapi revapi = Revapi.builder().withAllExtensionsFromThreadContextClassLoader().build();

AnalysisContext analysisContext = AnalysisContext.builder()
    .withOldAPI(API.of(...))
    .withNewAPI(API.of(...))
    .withConfigurationFromJSON("json").build();

revapi.analyze(analysisContext);

Extending Revapi

See the site for more info.

About

Revapi is an API checker for the masses. It makes sure you don't cause headaches to your users when they upgrade to a new version of your stuff.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 96.9%
  • HTML 1.0%
  • Ruby 1.0%
  • CSS 0.6%
  • Shell 0.4%
  • JavaScript 0.1%