Skip to content

Commit

Permalink
Merge branch 'release-0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
siom79 committed Feb 1, 2015
2 parents 962479c + a457eaf commit c780886
Show file tree
Hide file tree
Showing 118 changed files with 4,005 additions and 2,167 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
382 changes: 191 additions & 191 deletions LICENSE

Large diffs are not rendered by default.

61 changes: 26 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

japicmp is a tool to compare two versions of a jar archive:

java -jar japicmp-0.2.3-jar-with-dependencies.jar -n new-version.jar -o old-version.jar
java -jar japicmp-0.3.0-jar-with-dependencies.jar -n new-version.jar -o old-version.jar

It can also be used as a library:

Expand All @@ -15,7 +15,7 @@ japicmp is available in the Maven Central Repository. The corresponding dependen
<dependency>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp</artifactId>
<version>0.2.3</version>
<version>0.3.0</version>
</dependency>

##Motivation##
Expand Down Expand Up @@ -46,6 +46,7 @@ The comparison of annotations makes this approach suitable for annotation-based
* All changes between all classes/methods/fields are compared. If necessary, output can be limited to changes that are binary incompatible (as described in the [Java Language Specification](http://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html)).
* All changes between annotations are compared, hence japicmp can be used to track annotation-based APIs like JAXB, JPA, JAX-RS, etc.
* A maven plugin is available that allows you to compare the current artifact version with some older version from the repository.
* The option `--semantic-versioning` tells you which part of the version you have to increment in order to follow [semantic versioning](http://semver.org/).

[melix](https://github.com/melix) has developed a [gradle plugin](https://github.com/melix/japicmp-gradle-plugin) for japicmp.

Expand All @@ -55,6 +56,9 @@ The comparison of annotations makes this approach suitable for annotation-based

japicmp has a set of CLI parameters that are described in the following:

NAME
java -jar japicmp.jar - Compares jars

SYNOPSIS
java -jar japicmp.jar [-a <accessModifier>] [(-b | --only-incompatible)]
[(-e <packagesToExclude> | --exclude <packagesToExclude>)]
Expand All @@ -63,6 +67,7 @@ japicmp has a set of CLI parameters that are described in the following:
[(-m | --only-modified)]
[(-n <pathToNewVersionJar> | --new <pathToNewVersionJar>)]
[(-o <pathToOldVersionJar> | --old <pathToOldVersionJar>)]
[(-s | --semantic-versioning)]
[(-x <pathToXmlOutputFile> | --xml-file <pathToXmlOutputFile>)]

OPTIONS
Expand Down Expand Up @@ -97,13 +102,16 @@ japicmp has a set of CLI parameters that are described in the following:
-o <pathToOldVersionJar>, --old <pathToOldVersionJar>
Provides the path to the old version of the jar.

-s, --semantic-versioning
Tells you which part of the version to increment.

-x <pathToXmlOutputFile>, --xml-file <pathToXmlOutputFile>
Provides the path to the xml output file.

When your library under investigation implements interfaces or extends classes from other libraries than the JDK, you will
have to add these to the class path:

java -cp japicmp-0.2.3-SNAPSHOT-jar-with-dependencies.jar;otherLibrary.jar japicmp.JApiCmp -n new-version.jar -o old-version.jar
java -cp japicmp-0.3.0-jar-with-dependencies.jar;otherLibrary.jar japicmp.JApiCmp -n new-version.jar -o old-version.jar

###Usage maven plugin###

Expand All @@ -114,13 +122,13 @@ The maven plugin can be included in the pom.xml file of your artifact in the fol
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.2.3</version>
<version>0.3.0</version>
<configuration>
<oldVersion>
<dependency>
<groupId>japicmp</groupId>
<artifactId>japicmp-test-v1</artifactId>
<version>0.2.3</version>
<version>0.3.0</version>
</dependency>
</oldVersion>
<newVersion>
Expand Down Expand Up @@ -296,41 +304,24 @@ As can bee seen from the output above, the XML attributes title and author have

##Downloads##

The following releases are available:

* [Version 0.2.3](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.2.3)
* Changes:
* [Fails to recognize changed interfaces](https://github.com/siom79/japicmp/issues/12)
* [Version 0.2.2](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.2.2)
* Changes:
* [japicmp should provide a single page HTML report](https://github.com/siom79/japicmp/issues/18)
* [Version 0.2.1](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.2.1)
* Changes:
* [japicmp should provide a boolean flag for each change that indicates if this modification breaks binary compatibility](https://github.com/siom79/japicmp/issues/16)
* [japicmp should track changes on annotations](https://github.com/siom79/japicmp/issues/15)
* [Version 0.2.0](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.2.0)
* Changes:
* added support for the comparison of constructors, implemented interfaces, superclass and fields
* added support for the comparison of modifiers (access, final, static, abstract)
* added support for the synthetic attribute for classes, methods, constructors and fields
* [Version 0.1.1](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.1.1)
* Changes:
* [The maven-plugin should be available in the central repository](https://github.com/siom79/japicmp/issues/8)
* [Version 0.1.0](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.1.0)
* Changes:
* [The functionality of japicmp should be available as a maven plugin](https://github.com/siom79/japicmp/issues/6)
* [Version 0.0.2](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.0.2)
* Changes:
* [Command-line option to filter packages](https://github.com/siom79/japicmp/issues/1)
* [CLI option for comparing public, package, protected or private classes/class members](https://github.com/siom79/japicmp/issues/2)
* ["No differences" output when comparing the same file](https://github.com/siom79/japicmp/issues/4)
* [Giving a non-jar file as argument should not output "Comparing..."](https://github.com/siom79/japicmp/issues/5)
* [Version 0.0.1](https://github.com/siom79/japicmp/releases/tag/japicmp-base-0.0.1)
You can download the latest version from the [release page](https://github.com/siom79/japicmp/releases) or directly from the [maven central repository](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22japicmp%22).

##Development##

* ![Build Status](https://travis-ci.org/siom79/japicmp.svg?branch=development)

##Contributions

Pull requests are welcome, but please ensure the following rules:

* Use `Java Conventions` as provided by your IDE for formatting with the following settings:
* Indentation with tab
* Newline: LF
* Line length: 180
* Provide a unit test for every change
* [Clean Code](http://www.amazon.de/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)
* Especially name the classes/methods/fields under `japicmp-test-v1` and `japicmp-test-v2` expressively

##Related work##

The following projects have related goals:
Expand Down
2 changes: 1 addition & 1 deletion japicmp-testbase/japicmp-test-maven-plugin-japicmp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
</dependency>
</oldVersion>
<newVersion>
Expand Down
8 changes: 7 additions & 1 deletion japicmp-testbase/japicmp-test-v1/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.siom79.japicmp</groupId>
Expand All @@ -9,6 +10,11 @@

<artifactId>japicmp-test-v1</artifactId>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<source.skip>true</source.skip>
</properties>

<dependencies>
<dependency>
<groupId>javax</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package japicmp.test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class MethodReturnType {

public int methodReturnTypeUnchanged() {
return 42;
}

public int methodReturnTypeChangesFromIntToString() {
return 42;
}

public String methodReturnTypeChangesFromStringToInt() {
return "";
}

public List<MethodReturnType> methodReturnTypeChangesFromListToMap() {
return Collections.EMPTY_LIST;
}

public void methodReturnTypeChangesFromVoidToInt() {

}
}
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
package japicmp.test;

public class Modifier {

public void publicToPrivateMethod() {

}

public static class ModifierPublicToProtected {

}

public void nonFinalToFinalMethod() {

}

public final void finalToNonFinalMethod() {

}

public final void finalStaysFinalMethod() {

}

public void nonFinalStaysNonFinalMethod() {

}

public void nonStaticToStaticMethod() {

}

public static void StaticToNonStaticMethod() {

}

public static void staticStaysStaticMethod() {

}

public void nonStaticStaysNonStaticMethod() {

}
}
package japicmp.test;

public class Modifier {

public void publicToPrivateMethod() {

}

public static class ModifierPublicToProtected {

}

public void nonFinalToFinalMethod() {

}

public final void finalToNonFinalMethod() {

}

public final void finalStaysFinalMethod() {

}

public void nonFinalStaysNonFinalMethod() {

}

public void nonStaticToStaticMethod() {

}

public static void StaticToNonStaticMethod() {

}

public static void staticStaysStaticMethod() {

}

public void nonStaticStaysNonStaticMethod() {

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package japicmp.test;

public class Removed {
}
package japicmp.test;

public class Removed {
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ public static class NoSuperclassRemainsNoSuperclass {
public static class SuperClassChanges extends SuperclassA {

}

public static class RemovedWithSuperclass extends SuperclassA {

}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package japicmp.test;

public class Unchanged {

public void unchangedMethod(String str) {
System.out.println(str);
}

public void unchangedMethodWith2Params(String param1, String param2) {

}
}
package japicmp.test;

public class Unchanged {

public void unchangedMethod(String str) {
System.out.println(str);
}

public void unchangedMethodWith2Params(String param1, String param2) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package japicmp.test.annotation;

public class AnnotationAddedToConstructor {

public AnnotationAddedToConstructor(String arg) {

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package japicmp.test.packageOne;

public class PackageOne {
}
package japicmp.test.packageOne;

public class PackageOne {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package japicmp.test.packageTwo;

public class PackageTwo {
}
package japicmp.test.packageTwo;

public class PackageTwo {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package japicmp.test.semver.finalfield;

public class PublicClassWithFinalField {

private String fieldChangesFromPrivateToPrivateFinal;

public PublicClassWithFinalField(String fieldChangesFromPrivateToPrivateFinal) {
this.fieldChangesFromPrivateToPrivateFinal = fieldChangesFromPrivateToPrivateFinal;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package japicmp.test.semver.finalpublicmethod;

public class ClassWithFinalPublicMethod {

public void methodChangesFromNonFinalToFinal() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package japicmp.test.semver001.a;

public class SemverTestee001a {

public void methodUnchanged() {

}

public int methodImplementationChanges(int a, int b) {
return a + b;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package japicmp.test.semver010.a;

public class SemverTestee010a {

public void methodAnnotationDeprecatedAdded() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package japicmp.test.semver010.b;

class SemverTestee010bAccessModiferChangesFromDefaultToPublic {

}
Loading

0 comments on commit c780886

Please sign in to comment.